103 ConstructorArgs&&... args)
const
105 auto const type_idx = std::type_index(
typeid(mesh_item));
106 auto const it = _builder.find(type_idx);
108 if (it == _builder.end())
111 "You are trying to build a local assembler for an unknown mesh "
112 "element type ({:s})."
113 " Maybe you have disabled this mesh element type in your build "
114 "configuration, or a mesh element order does not match shape "
115 "function order given in the project file.",
119 auto const n_local_dof = _dof_table.getNumberOfElementDOF(
id);
120 auto const varIDs = _dof_table.getElementVariableIDs(
id);
121 bool const isPressureDeactivated = (varIDs.front() != 0);
122 std::vector<int> involved_varIDs;
123 involved_varIDs.reserve(varIDs.size() + 1);
124 if (isPressureDeactivated)
126 involved_varIDs.push_back(0);
128 involved_varIDs.insert(involved_varIDs.end(), varIDs.begin(),
131 std::vector<unsigned> dofIndex_to_localIndex;
134 dofIndex_to_localIndex.resize(n_local_dof);
135 std::vector<unsigned> vec_n_element_nodes;
137 vec_n_element_nodes.push_back(
139 auto const max_varID = *std::max_element(varIDs.begin(), varIDs.end());
140 for (
int i = 1; i < max_varID + 1; i++)
142 vec_n_element_nodes.push_back(
146 unsigned local_id = 0;
148 for (
unsigned i = 0; i < involved_varIDs.size(); i++)
150 auto const var_id = involved_varIDs[i];
151 auto const n_var_comp =
152 _dof_table.getNumberOfVariableComponents(var_id);
153 auto const n_var_element_nodes = vec_n_element_nodes[i];
154 for (
int var_comp_id = 0; var_comp_id < n_var_comp; var_comp_id++)
156 auto const& ms = _dof_table.getMeshSubset(var_id, var_comp_id);
157 auto const mesh_id = ms.getMeshID();
158 for (
unsigned k = 0; k < n_var_element_nodes; k++)
162 getNodeIndex(mesh_item, k));
164 _dof_table.getGlobalIndex(l, var_id, var_comp_id);
166 dof_id < n_local_dof)
168 dofIndex_to_localIndex[dof_id++] = local_id;
175 return it->second(mesh_item, involved_varIDs.size(), n_local_dof,
176 dofIndex_to_localIndex,
177 std::forward<ConstructorArgs>(args)...);
199 return [integration_order](
201 std::size_t
const n_variables,
202 std::size_t
const local_matrix_size,
203 std::vector<unsigned>
const& dofIndex_to_localIndex,
204 ConstructorArgs&&... args)
206 auto const& integration_method = NumLib::IntegrationMethodRegistry::
207 template getIntegrationMethod<
208 typename ShapeFunctionDisplacement::MeshElement>(
213 if (n_variables == 2)
216 ShapeFunctionDisplacement, ShapeFunctionPressure,
217 GlobalDim>{e, n_variables, local_matrix_size,
218 dofIndex_to_localIndex, integration_method,
219 std::forward<ConstructorArgs>(args)...}};
221 return LADataIntfPtr{
new LocalAssemblerDataMatrixNearFracture<
222 ShapeFunctionDisplacement, ShapeFunctionPressure,
223 GlobalDim>{e, n_variables, local_matrix_size,
224 dofIndex_to_localIndex, integration_method,
225 std::forward<ConstructorArgs>(args)...}};
228 ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim>{
229 e, local_matrix_size, dofIndex_to_localIndex,
230 integration_method, std::forward<ConstructorArgs>(args)...}};