|
10 | 10 | #include "4C_beam3_euler_bernoulli.hpp" |
11 | 11 | #include "4C_beam3_reissner.hpp" |
12 | 12 | #include "4C_beaminteraction_beam_to_solid_edge_contact_pair.hpp" |
| 13 | +#include "4C_beaminteraction_beam_to_solid_mortar_manager.hpp" |
13 | 14 | #include "4C_beaminteraction_beam_to_solid_mortar_manager_contact.hpp" |
14 | 15 | #include "4C_beaminteraction_beam_to_solid_surface_contact_pair.hpp" |
15 | 16 | #include "4C_beaminteraction_beam_to_solid_surface_contact_pair_mortar.hpp" |
@@ -130,20 +131,105 @@ BeamInteraction::BeamToSolidCondition::create_indirect_assembly_manager( |
130 | 131 | { |
131 | 132 | if (condition_data_.is_indirect_assembly_manager) |
132 | 133 | { |
133 | | - // Create the mortar manager. We add 1 to the MaxAllGID since this gives the maximum GID and NOT |
134 | | - // the length of the GIDs. |
135 | | - const int start_gid_lambda = discret->dof_row_map()->max_all_gid() + 1; |
| 134 | + const auto beam_to_volume_params = |
| 135 | + std::dynamic_pointer_cast<const BeamInteraction::BeamToSolidVolumeMeshtyingParams>( |
| 136 | + beam_to_solid_params_); |
| 137 | + const auto beam_to_surface_params = |
| 138 | + std::dynamic_pointer_cast<const BeamInteraction::BeamToSolidSurfaceMeshtyingParams>( |
| 139 | + beam_to_solid_params_); |
| 140 | + const auto beam_to_surface_contact_params = |
| 141 | + std::dynamic_pointer_cast<const BeamInteraction::BeamToSolidSurfaceContactParams>( |
| 142 | + beam_to_solid_params_); |
| 143 | + |
| 144 | + // Get the parameters for the mortar manager. |
| 145 | + MortarManagerParameters mortar_manager_params{}; |
| 146 | + |
| 147 | + { |
| 148 | + // |
| 149 | + // We add 1 to the MaxAllGID since this gives the maximum GID and NOT the length of the GIDs. |
| 150 | + // |
| 151 | + mortar_manager_params.start_value_lambda_gid = discret->dof_row_map()->max_all_gid() + 1; |
| 152 | + |
| 153 | + // |
| 154 | + // Get the dimension of the Lagrange multiplier field |
| 155 | + // |
| 156 | + const bool is_contact = beam_to_surface_contact_params != nullptr; |
| 157 | + const unsigned int n_dim = is_contact ? 1 : 3; |
| 158 | + |
| 159 | + // Get the number of Lagrange multiplier DOF on a beam node and on a beam element. |
| 160 | + const auto& [n_lambda_node_pos, n_lambda_element_pos] = |
| 161 | + mortar_shape_functions_to_number_of_lagrange_values(beam_to_solid_params_, |
| 162 | + beam_to_solid_params_->get_mortar_shape_function_type(), n_dim); |
| 163 | + mortar_manager_params.n_lambda_node_translational = n_lambda_node_pos; |
| 164 | + mortar_manager_params.n_lambda_element_translational = n_lambda_element_pos; |
| 165 | + |
| 166 | + if (beam_to_solid_params_->is_rotational_coupling()) |
| 167 | + { |
| 168 | + // Get the mortar shape functions for rotational coupling |
| 169 | + auto mortar_shape_function_rotation = |
| 170 | + Inpar::BeamToSolid::BeamToSolidMortarShapefunctions::none; |
| 171 | + |
| 172 | + if (beam_to_volume_params != nullptr) |
| 173 | + { |
| 174 | + mortar_shape_function_rotation = |
| 175 | + beam_to_volume_params->get_mortar_shape_function_rotation_type(); |
| 176 | + } |
| 177 | + else if (beam_to_surface_params != nullptr) |
| 178 | + { |
| 179 | + mortar_shape_function_rotation = beam_to_surface_params->get_mortar_shape_function_type(); |
| 180 | + } |
| 181 | + else |
| 182 | + { |
| 183 | + FOUR_C_THROW( |
| 184 | + "Rotational coupling is only implemented for beam-to-solid volume meshtying and " |
| 185 | + "beam-to-solid surface meshtying."); |
| 186 | + } |
| 187 | + |
| 188 | + // Get the number of Lagrange multiplier DOF for rotational coupling on a beam node and on a |
| 189 | + // beam element. |
| 190 | + const auto& [n_lambda_node_rot, n_lambda_element_rot] = |
| 191 | + mortar_shape_functions_to_number_of_lagrange_values( |
| 192 | + beam_to_solid_params_, mortar_shape_function_rotation, n_dim); |
| 193 | + mortar_manager_params.n_lambda_node_rotational = n_lambda_node_rot; |
| 194 | + mortar_manager_params.n_lambda_element_rotational = n_lambda_element_rot; |
| 195 | + } |
| 196 | + |
| 197 | + // |
| 198 | + // Get the penalty parameters |
| 199 | + // |
| 200 | + mortar_manager_params.penalty_parameter_translational = |
| 201 | + beam_to_solid_params_->get_penalty_parameter(); |
| 202 | + if (beam_to_volume_params != nullptr) |
| 203 | + { |
| 204 | + mortar_manager_params.penalty_parameter_rotational = |
| 205 | + beam_to_volume_params->get_rotational_coupling_penalty_parameter(); |
| 206 | + } |
| 207 | + else if (beam_to_surface_params != nullptr) |
| 208 | + { |
| 209 | + mortar_manager_params.penalty_parameter_rotational = |
| 210 | + beam_to_surface_params->get_rotational_coupling_penalty_parameter(); |
| 211 | + } |
| 212 | + |
| 213 | + // |
| 214 | + // Get constraint enforcement flags |
| 215 | + // |
| 216 | + mortar_manager_params.lagrange_formulation = |
| 217 | + beam_to_solid_params_->get_lagrange_formulation(); |
| 218 | + mortar_manager_params.constraint_enforcement = |
| 219 | + beam_to_solid_params_->get_constraint_enforcement(); |
| 220 | + } |
| 221 | + |
| 222 | + // Create the mortar manager as required for the current problem. |
136 | 223 | std::shared_ptr<BeamToSolidMortarManager> mortar_manager = nullptr; |
137 | | - if (std::dynamic_pointer_cast<const BeamToSolidSurfaceContactParams>(beam_to_solid_params_) == |
138 | | - nullptr) |
| 224 | + if (beam_to_surface_contact_params == nullptr) |
139 | 225 | { |
140 | 226 | mortar_manager = std::make_shared<BeamInteraction::BeamToSolidMortarManager>( |
141 | | - discret, beam_to_solid_params_, start_gid_lambda); |
| 227 | + discret, mortar_manager_params); |
142 | 228 | } |
143 | 229 | else |
144 | 230 | { |
145 | 231 | mortar_manager = std::make_shared<BeamInteraction::BeamToSolidMortarManagerContact>( |
146 | | - discret, beam_to_solid_params_, start_gid_lambda); |
| 232 | + discret, mortar_manager_params, beam_to_surface_contact_params); |
147 | 233 | } |
148 | 234 |
|
149 | 235 | // Setup the mortar manager. |
|
0 commit comments