Skip to content
Snippets Groups Projects
Commit 67bcfa23 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

[Mesh] fix the nonlinear node ID check

parent e61f4d0b
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ Mesh::Mesh(const std::string &name, ...@@ -42,7 +42,7 @@ Mesh::Mesh(const std::string &name,
assert(n_base_nodes <= nodes.size()); assert(n_base_nodes <= nodes.size());
this->resetNodeIDs(); this->resetNodeIDs();
this->resetElementIDs(); this->resetElementIDs();
if (isNonlinear()) if ((n_base_nodes==0 && hasNonlinearElement()) || isNonlinear())
this->checkNonlinearNodeIDs(); this->checkNonlinearNodeIDs();
this->setDimension(); this->setDimension();
this->setElementsConnectedToNodes(); this->setElementsConnectedToNodes();
...@@ -278,6 +278,17 @@ void Mesh::checkNonlinearNodeIDs() const ...@@ -278,6 +278,17 @@ void Mesh::checkNonlinearNodeIDs() const
} }
} }
bool Mesh::hasNonlinearElement() const
{
for (auto* const e : _elements)
{
if (e->getNumberOfNodes() == e->getNumberOfBaseNodes())
continue;
return true;
}
return false;
}
void scaleMeshPropertyVector(MeshLib::Mesh & mesh, void scaleMeshPropertyVector(MeshLib::Mesh & mesh,
std::string const& property_name, std::string const& property_name,
double factor) double factor)
......
...@@ -165,6 +165,9 @@ protected: ...@@ -165,6 +165,9 @@ protected:
/// Check if all the nonlinear nodes are stored at the end of the node vector /// Check if all the nonlinear nodes are stored at the end of the node vector
void checkNonlinearNodeIDs() const; void checkNonlinearNodeIDs() const;
/// Check if the mesh contains any nonlinear element
bool hasNonlinearElement() const;
std::size_t const _id; std::size_t const _id;
unsigned _mesh_dimension; unsigned _mesh_dimension;
/// The minimal and maximal edge length over all elements in the mesh /// The minimal and maximal edge length over all elements in the mesh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment