Skip to content
Snippets Groups Projects
Commit 080e86dd authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[PL/BCAndST/NeumannBC] Evaluate parameter at integration point.

parent a1a22fcf
No related branches found
No related tags found
No related merge requests found
...@@ -10,10 +10,13 @@ ...@@ -10,10 +10,13 @@
#pragma once #pragma once
#include <typeinfo>
#include "GenericNaturalBoundaryConditionLocalAssembler.h" #include "GenericNaturalBoundaryConditionLocalAssembler.h"
#include "NumLib/DOF/DOFTableUtil.h" #include "NumLib/DOF/DOFTableUtil.h"
#include "NumLib/Fem/InitShapeMatrices.h" #include "NumLib/Fem/InitShapeMatrices.h"
#include "NumLib/Fem/ShapeMatrixPolicy.h" #include "NumLib/Fem/ShapeMatrixPolicy.h"
#include "ParameterLib/MeshNodeParameter.h"
#include "ParameterLib/Parameter.h" #include "ParameterLib/Parameter.h"
namespace ProcessLib namespace ProcessLib
...@@ -60,12 +63,18 @@ public: ...@@ -60,12 +63,18 @@ public:
unsigned const n_integration_points = unsigned const n_integration_points =
Base::_integration_method.getNumberOfPoints(); Base::_integration_method.getNumberOfPoints();
// Get element nodes for the interpolation from nodes to integration NodalVectorType parameter_node_values;
// point. if (typeid(ParameterLib::MeshNodeParameter<double> const) ==
NodalVectorType parameter_node_values = typeid(_data.neumann_bc_parameter))
_data.neumann_bc_parameter {
.getNodalValuesOnElement(Base::_element, t) // Get element nodes for the interpolation from nodes to integration
.template topRows<ShapeFunction::MeshElement::n_all_nodes>(); // point.
parameter_node_values =
_data.neumann_bc_parameter
.getNodalValuesOnElement(Base::_element, t)
.template topRows<
ShapeFunction::MeshElement::n_all_nodes>();
}
double integral_measure = 1.0; double integral_measure = 1.0;
for (unsigned ip = 0; ip < n_integration_points; ip++) for (unsigned ip = 0; ip < n_integration_points; ip++)
...@@ -85,8 +94,17 @@ public: ...@@ -85,8 +94,17 @@ public:
{ {
integral_measure = (*_data.integral_measure)(t, position)[0]; integral_measure = (*_data.integral_measure)(t, position)[0];
} }
_local_rhs.noalias() += if (typeid(ParameterLib::MeshNodeParameter<double> const) ==
N * parameter_node_values.dot(N) * w * integral_measure; typeid(_data.neumann_bc_parameter))
{
_local_rhs.noalias() +=
N * parameter_node_values.dot(N) * w * integral_measure;
}
else
{
auto const value = _data.neumann_bc_parameter(t, position);
_local_rhs.noalias() += N * value[0] * w * integral_measure;
}
} }
auto const indices = NumLib::getIndices(id, dof_table_boundary); auto const indices = NumLib::getIndices(id, dof_table_boundary);
......
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