Skip to content
Snippets Groups Projects
Commit 5030e6f4 authored by chantrait's avatar chantrait
Browse files

fix

parent 4462d288
No related branches found
No related tags found
No related merge requests found
...@@ -188,7 +188,24 @@ MeshBuilderBase::_checkMesh() const ...@@ -188,7 +188,24 @@ MeshBuilderBase::_checkMesh() const
} }
} }
MeshDataManager::instance().getMeshData(mesh).Vj(); const auto& Cjr = MeshDataManager::instance().getMeshData(mesh).Cjr();
const auto& xr = mesh.xr();
for (CellId cell_id = 0; cell_id < mesh.numberOfCells(); ++cell_id) {
double cell_volume = 0;
auto cell_nodes = cell_to_node_matrix[cell_id];
for (size_t i_node = 0; i_node < cell_nodes.size(); ++i_node) {
cell_volume += dot(Cjr(cell_id, i_node), xr[cell_nodes[i_node]]);
}
if (cell_volume <= 0) {
std::ostringstream error_msg;
error_msg << "invalid mesh.\n\tThe following cell\n";
error_msg << "\t - id=" << cell_id << " number=" << connectivity.cellNumber()[cell_id] << '\n';
error_msg << "\thas non-positive volume: " << cell_volume / Dimension;
throw NormalError(error_msg.str());
}
}
} }
template void MeshBuilderBase::_checkMesh<1>() const; template void MeshBuilderBase::_checkMesh<1>() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment