Skip to content
Snippets Groups Projects
Commit 4463681c authored by Matteo Cicuttin's avatar Matteo Cicuttin
Browse files

Fixed performance problem in bnd/iface source evaluation.

parent 37206f51
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,11 @@ eval_boundary_sources(const model& mod, const parameter_loader& mpl,
{
for (size_t iF = 0; iF < e.num_faces(); iF++)
{
auto gfnum = face_num_base + iF;
auto bd = bds[gfnum];
if (bd.type == face_type::NONE or bd.type == face_type::INTERFACE)
continue;
auto& pf = e.face(iF);
auto bar = pf.barycenter();
auto eps = mpl.epsilon(e.gmsh_tag(), bar);
......@@ -26,11 +31,6 @@ eval_boundary_sources(const model& mod, const parameter_loader& mpl,
vec3d n = state.eds[e.number()].normals.row(iF);
auto gfnum = face_num_base + iF;
auto bd = bds[gfnum];
if (bd.type == face_type::NONE or bd.type == face_type::INTERFACE)
continue;
switch ( mpl.boundary_type(bd.gmsh_entity) )
{
case boundary_condition::UNSPECIFIED:
......@@ -53,9 +53,11 @@ eval_boundary_sources(const model& mod, const parameter_loader& mpl,
case boundary_condition::PLANE_WAVE_E: {
auto fE = [&](const point_3d& pt) -> vec3d {
return vec3d();
return mpl.eval_boundary_source(bd.gmsh_entity, pt, state.curr_time);
};
auto fH = [&](const point_3d& pt) -> vec3d {
return vec3d();
vec3d E = mpl.eval_boundary_source(bd.gmsh_entity, pt, state.curr_time);
return n.cross(E)/Z;
};
......@@ -102,13 +104,13 @@ eval_interface_sources(const model& mod, const parameter_loader& mpl,
{
for (size_t iF = 0; iF < e.num_faces(); iF++)
{
vec3d n = state.eds[e.number()].normals.row(iF);
auto gfnum = face_num_base + iF;
auto bd = bds[gfnum];
if (bd.type == face_type::NONE or bd.type == face_type::BOUNDARY)
continue;
vec3d n = state.eds[e.number()].normals.row(iF);
switch ( mpl.interface_type(bd.gmsh_entity) )
{
case interface_condition::UNSPECIFIED:
......
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