66 unsigned const integration_order, unsigned const shapefunction_order,
67 MeshLib::Mesh const& bulk_mesh,
68 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
69 int const variable_id, MeshLib::Mesh const& bc_mesh,
70 ParameterLib::Parameter<double> const& pressure)
72 _integration_order(integration_order),
76 auto const& number_of_components =
77 dof_table_bulk.getNumberOfVariableComponents(variable_id);
78 std::vector<int> component_ids(number_of_components);
79 std::iota(std::begin(component_ids), std::end(component_ids), 0);
82 std::vector<MeshLib::Node*>
const bc_nodes = _bc_mesh.getNodes();
83 DBUG(
"Found {:d} nodes for Natural BCs for the variable {:d}",
84 bc_nodes.size(), variable_id);
90 assert(bulk_element_ids !=
nullptr);
91 auto const& elements = _bc_mesh.getElements();
94 ranges::views::transform(
98 auto const* bulk_element =
99 bulk_mesh.getElement((*bulk_element_ids)[e_ptr->
getID()]);
100 assert(bulk_element !=
nullptr);
102 return computeElementNormal<GlobalDim>(*e_ptr, *bulk_element);
104 ranges::to<std::vector<Eigen::Vector3d>>();
108 _dof_table_boundary = dof_table_bulk.deriveBoundaryConstrainedMap(
109 variable_id, component_ids, std::move(bc_mesh_subset));
111 BoundaryConditionAndSourceTerm::detail::createLocalAssemblers<
112 GlobalDim, LocalAssemblerImplementation>(
113 *_dof_table_boundary, shapefunction_order, _bc_mesh.getElements(),
115 _bc_mesh.isAxiallySymmetric(), _pressure, _element_normals);
121 applyNaturalBC(const double t, std::vector<GlobalVector*> const& x,
122 int const , GlobalMatrix* K, GlobalVector& b,
126 &NormalTractionBoundaryConditionLocalAssemblerInterface::assemble,
127 _local_assemblers, *_dof_table_boundary, t, x, K, b, Jac);
137 unsigned const integration_order,
unsigned const shapefunction_order,
138 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
140 DBUG(
"Constructing NormalTractionBoundaryCondition from config.");
144 auto const parameter_name =
147 DBUG(
"Using parameter {:s}", parameter_name);
150 parameter_name, parameters, 1, &bc_mesh);
153 integration_order, shapefunction_order, bulk_mesh, dof_table,
154 variable_id, bc_mesh, pressure);