96 ConstructorArgs&&... args)
const
98 auto const type_idx = std::type_index(
typeid(mesh_item));
99 auto const it =
_builder.find(type_idx);
104 "You are trying to build a local assembler for an unknown mesh "
105 "element type ({:s})."
106 " Maybe you have disabled this mesh element type in your build "
107 "configuration, or a mesh element order does not match shape "
108 "function order given in the project file.",
112 auto const n_local_dof =
_dof_table.getNumberOfElementDOF(
id);
113 auto const varIDs =
_dof_table.getElementVariableIDs(
id);
114 bool const isPressureDeactivated = (varIDs.front() != 0);
115 std::vector<int> involved_varIDs;
116 involved_varIDs.reserve(varIDs.size() + 1);
117 if (isPressureDeactivated)
119 involved_varIDs.push_back(0);
121 involved_varIDs.insert(involved_varIDs.end(), varIDs.begin(),
124 std::vector<unsigned> dofIndex_to_localIndex;
127 dofIndex_to_localIndex.resize(n_local_dof);
128 std::vector<unsigned> vec_n_element_nodes;
130 vec_n_element_nodes.push_back(
132 auto const max_varID = *std::max_element(varIDs.begin(), varIDs.end());
133 for (
int i = 1; i < max_varID + 1; i++)
135 vec_n_element_nodes.push_back(
139 unsigned local_id = 0;
141 for (
unsigned i = 0; i < involved_varIDs.size(); i++)
143 auto const var_id = involved_varIDs[i];
144 auto const n_var_comp =
145 _dof_table.getNumberOfVariableComponents(var_id);
146 auto const n_var_element_nodes = vec_n_element_nodes[i];
147 for (
int var_comp_id = 0; var_comp_id < n_var_comp; var_comp_id++)
149 auto const& ms =
_dof_table.getMeshSubset(var_id, var_comp_id);
150 auto const mesh_id = ms.getMeshID();
151 for (
unsigned k = 0; k < n_var_element_nodes; k++)
155 getNodeIndex(mesh_item, k));
157 _dof_table.getGlobalIndex(l, var_id, var_comp_id);
159 dof_id < n_local_dof)
161 dofIndex_to_localIndex[dof_id++] = local_id;
168 return it->second(mesh_item, involved_varIDs.size(), n_local_dof,
169 dofIndex_to_localIndex,
170 std::forward<ConstructorArgs>(args)...);
192 return [integration_order](
194 std::size_t
const n_variables,
195 std::size_t
const local_matrix_size,
196 std::vector<unsigned>
const& dofIndex_to_localIndex,
197 ConstructorArgs&&... args)
199 auto const& integration_method = NumLib::IntegrationMethodRegistry::
200 template getIntegrationMethod<
201 typename ShapeFunctionDisplacement::MeshElement>(
206 if (n_variables == 2)
209 new LocalAssemblerDataMatrix<ShapeFunctionDisplacement,
210 ShapeFunctionPressure,
212 e, n_variables, local_matrix_size,
213 dofIndex_to_localIndex, integration_method,
214 std::forward<ConstructorArgs>(args)...}};
216 return LADataIntfPtr{
new LocalAssemblerDataMatrixNearFracture<
217 ShapeFunctionDisplacement, ShapeFunctionPressure,
218 DisplacementDim>{e, n_variables, local_matrix_size,
219 dofIndex_to_localIndex, integration_method,
220 std::forward<ConstructorArgs>(args)...}};
223 ShapeFunctionDisplacement, ShapeFunctionPressure,
224 DisplacementDim>{e, local_matrix_size, dofIndex_to_localIndex,
226 std::forward<ConstructorArgs>(args)...}};