13 #if !defined( KRATOS_MULTISCALE_REFINING_PROCESS_H_INCLUDED )
14 #define KRATOS_MULTISCALE_REFINING_PROCESS_H_INCLUDED
161 const Parameters GetDefaultParameters()
const override;
166 int Check()
override;
172 void ExecuteRefinement();
178 void ExecuteCoarsening();
186 static void InitializeVisualizationModelPart(
ModelPart& rReferenceModelPart,
ModelPart& rNewModelPart);
195 static void InitializeRefinedModelPart(
ModelPart& rReferenceModelPart,
ModelPart& rNewModelPart);
201 template<
class TVarType>
205 for (
int i = 0; i < static_cast<int>(mrRefinedModelPart.Nodes().size());
i++)
207 auto refined_node = refined_begin +
i;
208 if (refined_node->GetValue(FATHER_NODES).size() == 1)
210 auto& value = refined_node->GetValue(FATHER_NODES)[0].FastGetSolutionStepValue(rVariable);
211 value = refined_node->FastGetSolutionStepValue(rVariable);
225 template<
class TVarType>
229 for (
int i = 0; i < static_cast<int>(mRefinedInterfaceContainer.size());
i++)
231 auto refined_node = refined_begin +
i;
234 std::vector<double> weights = refined_node->GetValue(FATHER_NODES_WEIGHTS);
237 auto& value = refined_node->FastGetSolutionStepValue(rVariable);
238 value = weights[0] * rSubstepFraction * father_nodes[0].FastGetSolutionStepValue(rVariable);
239 value += weights[0] * (1-rSubstepFraction) * father_nodes[0].FastGetSolutionStepValue(rVariable, 1);
241 if (number_of_father_nodes > 1)
245 value += weights[
j] * rSubstepFraction * father_nodes[
j].FastGetSolutionStepValue(rVariable);
246 value += weights[
j] * (1-rSubstepFraction) * father_nodes[
j].FastGetSolutionStepValue(rVariable, 1);
259 template<
class TVarType>
275 return mrCoarseModelPart;
280 return mrRefinedModelPart;
285 return mrVisualizationModelPart;
293 std::string
Info()
const override
295 return "MultiscaleRefiningProcess";
360 unsigned int mEchoLevel;
361 int mDivisionsAtSubscale;
368 std::string mRefinedInterfaceName;
369 std::string mInterfaceConditionName;
371 IndexStringMapType mCollections;
380 void InterpolateLevelBoundaryValuesAtSubStep(
const int& rSubStep,
const int& rSubSteps);
385 void UpdateSubLevel();
390 void TransferDataToCoarseLevel();
395 void InitializeCoarseModelPartInterface();
400 void InitializeRefinedModelPartInterface();
408 static void InitializeNewModelPart(
ModelPart& rReferenceModelPart,
ModelPart& rNewModelPart);
416 static void AddAllPropertiesToModelPart(
ModelPart& rOriginModelPart,
ModelPart& rDestinationModelPart);
424 static void AddAllTablesToModelPart(
ModelPart& rOriginModelPart,
ModelPart& rDestinationModelPart);
432 void MarkElementsFromNodalFlag();
440 void MarkConditionsFromNodalFlag();
448 void CloneNodesToRefine(
IndexType& rNodeId);
454 void CreateElementsToRefine(
IndexType& rElemId, IndexIndexMapType& rElemTag);
460 void CreateConditionsToRefine(
IndexType& rCondId, IndexIndexMapType& rCondTag);
466 void UpdateVisualizationAfterRefinement();
471 void UpdateVisualizationAfterCoarsening();
481 void IdentifyParentNodesToCoarsen();
490 void IdentifyElementsToErase();
499 void IdentifyConditionsToErase();
509 void IdentifyRefinedNodesToErase();
517 void FinalizeRefinement();
524 void FinalizeCoarsening();
531 void IdentifyCurrentInterface();
537 void UpdateRefinedInterface();
589 rOStream << std::endl;
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
std::size_t IndexType
Definition: flags.h:74
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
size_type size() const
Definition: global_pointers_vector.h:307
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class provides a non conforming refinement to perform multi scale analysis @detail This process ...
Definition: multiscale_refining_process.h:86
void TransferLastStepToCoarseModelPart(const TVarType &rVariable)
Copies all the last nodal step data from the refined model part to the coarse one.
Definition: multiscale_refining_process.h:202
~MultiscaleRefiningProcess() override=default
Destructor.
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: multiscale_refining_process.h:156
void operator()()
Definition: multiscale_refining_process.h:147
ModelPart & GetVisualizationModelPart()
Definition: multiscale_refining_process.h:283
std::unordered_map< IndexType, std::vector< std::string > > IndexStringMapType
Definition: multiscale_refining_process.h:121
std::unordered_map< IndexType, IndexType > IndexIndexMapType
Definition: multiscale_refining_process.h:120
std::vector< IndexType > IndexVectorType
Definition: multiscale_refining_process.h:105
void TransferSubstepToRefinedInterface(const TVarType &rVariable, const double &rSubstepFraction)
Copies the nodal step data with a linear interpolation between the last nodal steps of the given vari...
Definition: multiscale_refining_process.h:226
KRATOS_CLASS_POINTER_DEFINITION(MultiscaleRefiningProcess)
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: multiscale_refining_process.h:305
std::size_t IndexType
Definition: multiscale_refining_process.h:100
std::vector< std::string > StringVectorType
Definition: multiscale_refining_process.h:110
ModelPart & GetCoarseModelPart()
Definition: multiscale_refining_process.h:273
std::string Info() const override
Turn back information as a string.
Definition: multiscale_refining_process.h:293
std::unordered_map< IndexType, std::vector< IndexType > > IndexVectorMapType
Definition: multiscale_refining_process.h:122
Node NodeType
Definition: multiscale_refining_process.h:95
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: multiscale_refining_process.h:299
ModelPart & GetRefinedModelPart()
Definition: multiscale_refining_process.h:278
void FixRefinedInterface(const TVarType &rVariable, bool IsFixed)
Applies fixity forthe given variable at the nodes which define the interface.
Definition: multiscale_refining_process.h:260
ModelPart::NodesContainerType NodesArrayType
Definition: multiscale_refining_process.h:115
This class defines the node.
Definition: node.h:65
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 implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
void ApplyFixity(const TVarType &rVar, const bool IsFixed, NodesContainerType &rNodes)
Fixes or frees a variable for all of the nodes in the list. The dof has to exist.
Definition: variable_utils.h:1073
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17