wet coords
This commit is contained in:
parent
bb45841e61
commit
da569352cc
3 changed files with 29 additions and 7 deletions
|
|
@ -847,6 +847,22 @@ const std::vector<int> Mesh::EdgeSubdomains() const
|
|||
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
|
||||
void Mesh::InitializeOuterEdges()
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ public:
|
|||
const std::vector<int> OuterEdgesNodes() const;
|
||||
const std::vector<int> ElementSubdomains() const;
|
||||
const std::vector<int> EdgeSubdomains() const;
|
||||
|
||||
const std::vector<int> TopNodes() const;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -106,14 +106,20 @@ int main(int argc, char **argv )
|
|||
precice::Participant participantSolid(solverName, configFileName, commRank, commSize);
|
||||
|
||||
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
|
||||
}
|
||||
std::vector<double> coords(numberOfVertices*meshDim); // coords of vertices at "wet" surface
|
||||
{
|
||||
// TODO: DETERMINE COORDINATES 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<int> vertexIDs(numberOfVertices);
|
||||
|
||||
participantSolid.setMeshVertices(meshName, coords, vertexIDs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue