wet coords

This commit is contained in:
jakob.schratter 2026-01-27 16:37:38 +01:00
commit da569352cc
3 changed files with 29 additions and 7 deletions

View file

@ -847,6 +847,22 @@ const std::vector<int> Mesh::EdgeSubdomains() const
return _edgeSubdomains; return _edgeSubdomains;
} }
const std::vector<int> Mesh::TopNodes() const
{
vector<int> topNodes;
for (size_t i = 0; i < _outerEdgesNodes.size(); ++i)
{
int nodeIndex = _outerEdgesNodes[i];
if (abs(_xc[2*nodeIndex + 1] - 105.0) < 0.01 ) // if y-coordinate of node is 105, i.e. node is on top
{
topNodes.push_back(nodeIndex);
}
}
return topNodes;
}
// Only the outer edges for Robin BC // Only the outer edges for Robin BC
void Mesh::InitializeOuterEdges() void Mesh::InitializeOuterEdges()

View file

@ -352,7 +352,7 @@ public:
const std::vector<int> OuterEdgesNodes() const; const std::vector<int> OuterEdgesNodes() const;
const std::vector<int> ElementSubdomains() const; const std::vector<int> ElementSubdomains() const;
const std::vector<int> EdgeSubdomains() const; const std::vector<int> EdgeSubdomains() const;
const std::vector<int> TopNodes() const;

View file

@ -106,14 +106,20 @@ int main(int argc, char **argv )
precice::Participant participantSolid(solverName, configFileName, commRank, commSize); precice::Participant participantSolid(solverName, configFileName, commRank, commSize);
int meshDim = participantSolid.getMeshDimensions(meshName); // gets mesh dimensions (=2) from config file int meshDim = participantSolid.getMeshDimensions(meshName); // gets mesh dimensions (=2) from config file
int numberOfVertices; // number of vertices at "wet" surface
// Determine number of "wet" vertices
vector<int> wetNodes = mesh_c.TopNodes();
int numberOfVertices = wetNodes.size();
// Determine coordinates of "wet" vertices
std::vector<double> allCoords = mesh_c.GetCoords();
std::vector<double> coords(numberOfVertices*meshDim);
for (size_t i = 0; i < numberOfVertices*meshDim; ++i)
{ {
// TODO: DETERMINE NUMBER OF VERTICES AT TOP coords.push_back(allCoords[2*wetNodes[i]]); // x-coord of node
} coords.push_back(allCoords[2*wetNodes[i + 1]]); // y-coord of node
std::vector<double> coords(numberOfVertices*meshDim); // coords of vertices at "wet" surface
{
// TODO: DETERMINE COORDINATES OF VERTICES AT TOP
} }
std::vector<int> vertexIDs(numberOfVertices); std::vector<int> vertexIDs(numberOfVertices);
participantSolid.setMeshVertices(meshName, coords, vertexIDs); participantSolid.setMeshVertices(meshName, coords, vertexIDs);