Skip to content
Snippets Groups Projects
Commit 2eaec2bc authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/SurfaceFlux] Impl. getSurfaceNormal for lines.

parent 2b9f6a8f
No related branches found
No related tags found
No related merge requests found
...@@ -120,13 +120,34 @@ public: ...@@ -120,13 +120,34 @@ public:
std::vector<GlobalVector*> const&)> std::vector<GlobalVector*> const&)>
getFlux) override getFlux) override
{ {
auto surface_element_normal = auto get_surface_normal =
MeshLib::FaceRule::getSurfaceNormal(&_surface_element); [this, &bulk_mesh](
surface_element_normal.normalize(); MeshLib::Element const& surface_element) -> MathLib::Vector3 {
// At the moment (2016-09-28) the surface normal is not oriented MathLib::Vector3 surface_element_normal;
// according to the right hand rule if (surface_element.getGeomType() == MeshLib::MeshElemType::LINE)
// for correct results it is necessary to multiply the normal with -1 {
surface_element_normal *= -1; auto const bulk_normal = MeshLib::FaceRule::getSurfaceNormal(
bulk_mesh.getElements()[_bulk_element_id]);
MathLib::Vector3 const line{*_surface_element.getNodes()[0],
*_surface_element.getNodes()[1]};
surface_element_normal =
MathLib::crossProduct(bulk_normal, line);
}
else
{
surface_element_normal =
MeshLib::FaceRule::getSurfaceNormal(&surface_element);
}
surface_element_normal.normalize();
// At the moment (2016-09-28) the surface normal is not oriented
// according to the right hand rule
// for correct results it is necessary to multiply the normal
// with -1
surface_element_normal *= -1;
return surface_element_normal;
};
auto const surface_element_normal =
get_surface_normal(_surface_element);
double element_area = 0.0; double element_area = 0.0;
std::size_t const n_integration_points = std::size_t const n_integration_points =
...@@ -142,7 +163,6 @@ public: ...@@ -142,7 +163,6 @@ public:
bulk_mesh, _bulk_element_id, _bulk_face_id, wp); bulk_mesh, _bulk_element_id, _bulk_face_id, wp);
auto const bulk_flux = auto const bulk_flux =
getFlux(_bulk_element_id, bulk_element_point, t, x); getFlux(_bulk_element_id, bulk_element_point, t, x);
for (int component_id(0); for (int component_id(0);
component_id < specific_flux.getNumberOfComponents(); component_id < specific_flux.getNumberOfComponents();
++component_id) ++component_id)
......
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