Skip to content
Snippets Groups Projects
Commit d67e7b1b authored by PATELA Julie's avatar PATELA Julie
Browse files

Use MeshData to get face lenght/area

parent 62cc9df2
No related branches found
No related tags found
No related merge requests found
...@@ -116,26 +116,15 @@ Heat5PointsAlgorithm<Dimension>::Heat5PointsAlgorithm( ...@@ -116,26 +116,15 @@ Heat5PointsAlgorithm<Dimension>::Heat5PointsAlgorithm(
0, true); // forces last output 0, true); // forces last output
const CellValue<const double> dual_Vj = diamond_mesh_data.Vj(); const CellValue<const double> dual_Vj = diamond_mesh_data.Vj();
const auto& face_to_node_matrix = mesh->connectivity().faceToNodeMatrix();
const FaceValue<const double> mes_l = [=] { const FaceValue<const double> mes_l = [&] {
FaceValue<double> compute_mes_l{mesh->connectivity()};
const NodeValue<const TinyVector<Dimension>>& xr = mesh->xr();
if constexpr (Dimension == 1) { if constexpr (Dimension == 1) {
FaceValue<double> compute_mes_l{mesh->connectivity()};
compute_mes_l.fill(1); compute_mes_l.fill(1);
} else if constexpr (Dimension == 2) { return compute_mes_l;
parallel_for(
mesh->numberOfFaces(), PUGS_LAMBDA(FaceId face_id) {
const auto& face_to_node = face_to_node_matrix[face_id];
const NodeId node_id1 = face_to_node[0];
const NodeId node_id2 = face_to_node[1];
const TinyVector<Dimension, double> r = xr[node_id1] - xr[node_id2];
compute_mes_l[face_id] = l2Norm(r);
});
} else { } else {
throw NotImplementedError("Not implemented in 3D"); return mesh_data.ll();
} }
return compute_mes_l;
}(); }();
const CellValue<const double> dual_mes_l_j = [=] { const CellValue<const double> dual_mes_l_j = [=] {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment