96 LinearSolverType::Pointer pThisLinearSolver = nullptr
101 const bool origin_are_conditions_is_defined = ThisParameters.Has(
"origin_are_conditions");
102 const bool destination_are_conditions_is_defined = ThisParameters.Has(
"destination_are_conditions");
103 ThisParameters.ValidateAndAssignDefaults(default_parameters);
106 if (!origin_are_conditions_is_defined) {
108 ThisParameters[
"origin_are_conditions"].SetBool(
false);
109 KRATOS_WARNING(
"SimpleMortarMapperProcessWrapper") <<
"\'origin_are_conditions\' changed to \'False\'. Mapping from elements." << std::endl;
111 KRATOS_ERROR <<
"No conditions defined on origin model part" << std::endl;
114 if (!destination_are_conditions_is_defined) {
116 ThisParameters[
"destination_are_conditions"].SetBool(
false);
117 KRATOS_WARNING(
"SimpleMortarMapperProcessWrapper") <<
"\'destination_are_conditions\' changed to \'False\'. Mapping from elements." << std::endl;
119 KRATOS_ERROR <<
"No conditions defined on destination model part" << std::endl;
124 auto& r_geometry_origin = ThisParameters[
"origin_are_conditions"].GetBool() ? rOriginModelPart.
Conditions().begin()->GetGeometry() : rOriginModelPart.
Elements().begin()->GetGeometry();
125 auto& r_geometry_destination = ThisParameters[
"destination_are_conditions"].GetBool() ? rDestinationModelPart.
Conditions().begin()->GetGeometry() : rDestinationModelPart.
Elements().begin()->GetGeometry();
129 const SizeType size_1 = r_geometry_origin.size();
130 const SizeType size_2 = r_geometry_destination.size();
133 const std::string& r_origin_variable_name = ThisParameters[
"origin_variable"].GetString();
134 const std::string& r_destination_variable_name = ThisParameters[
"destination_variable"].GetString();
136 bool double_variable =
true;
139 KRATOS_ERROR <<
"The destination variable is not the same type (double) as the origin" << std::endl;
142 double_variable =
false;
144 KRATOS_ERROR <<
"The destination variable is not the same type (array_1d< double, 3>) as the origin" << std::endl;
146 KRATOS_ERROR <<
"The types of the variables are not supported array_1d< double, 3> or double" << std::endl;
152 if (double_variable) {
153 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<2, 2, Variable<double>>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
155 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<2, 2, Variable<array_1d< double, 3>>>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
159 if (size_1 == 3 && size_2 == 3) {
160 if (double_variable) {
161 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 3, Variable<double>>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
163 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 3, Variable<array_1d< double, 3>>>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
165 }
else if (size_1 == 4 && size_2 == 4) {
166 if (double_variable) {
167 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 4, Variable<double>>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
169 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 4, Variable<array_1d< double, 3>>>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
171 }
else if (size_1 == 4 && size_2 == 3) {
172 if (double_variable) {
173 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 3, Variable<double>, 4>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
175 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 3, Variable<array_1d< double, 3>>, 4>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
177 }
else if (size_1 == 3 && size_2 == 4) {
178 if (double_variable) {
179 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 4, Variable<double>, 3>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
181 mpMapperProcess = Kratos::make_shared<SimpleMortarMapperProcess<3, 4, Variable<array_1d< double, 3>>, 3>>(rOriginModelPart, rDestinationModelPart, ThisParameters, pThisLinearSolver);
184 KRATOS_ERROR <<
"Combination of dimensions and sizes not compatible. Dimension: " <<
dimension <<
" Size Origin: " << size_1 <<
" Size Destination: " << size_2 << std::endl;
226 mpMapperProcess->Execute();
234 mpMapperProcess->ExecuteInitializeSolutionStep();
245 "consider_tessellation" : false,
246 "using_average_nodal_normal" : true,
247 "discontinuous_interface" : false,
248 "discontinous_interface_factor" : 1.0e-4,
249 "absolute_convergence_tolerance" : 1.0e-9,
250 "relative_convergence_tolerance" : 1.0e-4,
251 "max_number_iterations" : 10,
252 "integration_order" : 2,
253 "distance_threshold" : 1.0e24,
254 "zero_tolerance_factor" : 1.0e0,
255 "remove_isolated_conditions" : false,
256 "mapping_coefficient" : 1.0e0,
257 "origin_variable" : "TEMPERATURE",
258 "destination_variable" : "",
259 "origin_variable_historical" : true,
260 "origin_are_conditions" : true,
261 "destination_variable_historical" : true,
262 "destination_are_conditions" : true,
263 "update_interface" : true,
264 "search_parameters" : {
265 "allocation_size" : 1000,
267 "search_factor" : 3.5
271 return default_parameters;
287 std::string
Info()
const override
289 return "SimpleMortarMapperProcessWrapper";
295 rOStream <<
"SimpleMortarMapperProcessWrapper";
315 Process::Pointer mpMapperProcess =
nullptr;
std::size_t IndexType
Definition: flags.h:74
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
Base class for all the linear solvers in Kratos.
Definition: linear_solver.h:65
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
SizeType NumberOfElements(IndexType ThisIndex=0) const
Definition: model_part.h:1027
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
SizeType NumberOfConditions(IndexType ThisIndex=0) const
Definition: model_part.h:1218
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
The base class for all processes in Kratos.
Definition: process.h:49
This class wraps automatically the different types mof mappers.
Definition: simple_mortar_mapper_wrapper_process.h:54
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: simple_mortar_mapper_wrapper_process.h:224
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: simple_mortar_mapper_wrapper_process.h:293
typename SparseSpaceType::MatrixType MatrixType
Type definition for matrix.
Definition: simple_mortar_mapper_wrapper_process.h:69
typename SparseSpaceType::VectorType VectorType
Type definition for vector.
Definition: simple_mortar_mapper_wrapper_process.h:72
std::string Info() const override
Turn back information as a string.
Definition: simple_mortar_mapper_wrapper_process.h:287
KRATOS_CLASS_POINTER_DEFINITION(SimpleMortarMapperProcessWrapper)
Pointer definition of SimpleMortarMapperProcessWrapper.
void operator()()
Definition: simple_mortar_mapper_wrapper_process.h:212
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: simple_mortar_mapper_wrapper_process.h:299
void ExecuteInitializeSolutionStep() override
Definition: simple_mortar_mapper_wrapper_process.h:232
~SimpleMortarMapperProcessWrapper() override=default
Destructor.
const Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: simple_mortar_mapper_wrapper_process.h:240
SimpleMortarMapperProcessWrapper(ModelPart &rOriginModelPart, ModelPart &rDestinationModelPart, Parameters ThisParameters=Parameters(R"({})"), LinearSolverType::Pointer pThisLinearSolver=nullptr)
Default constructor.
Definition: simple_mortar_mapper_wrapper_process.h:92
A class template for handling data types, matrices, and vectors in a Ublas space.
Definition: ublas_space.h:121
TMatrixType MatrixType
The matrix type considered.
Definition: ublas_space.h:133
TVectorType VectorType
The vector type considered.
Definition: ublas_space.h:136
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_WARNING(label)
Definition: logger.h:265
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123