14 #ifndef KRATOS_DISTANCE_MODIFICATION_PROCESS_H
15 #define KRATOS_DISTANCE_MODIFICATION_PROCESS_H
65 static constexpr std::array<std::array<std::size_t,2>, 3> NodeIDs2D {{ {{1,2}}, {{2,0}}, {{0,1}} }};
66 static constexpr std::array<std::array<std::size_t,2>, 6> NodeIDs3D {{ {{0,1}}, {{1,2}}, {{2,0}}, {{0,3}}, {{1,3}}, {{2,3}} }};
78 const double FactorCoeff,
79 const double DistanceThreshold,
80 const bool CheckAtEachStep,
81 const bool NegElemDeactivation,
82 const bool RecoverOriginalDistance);
101 void Execute()
override;
105 void ExecuteBeforeSolutionLoop()
override;
107 void ExecuteInitializeSolutionStep()
override;
128 std::string
Info()
const override
130 std::stringstream buffer;
131 buffer <<
"DistanceModificationProcess" ;
136 void PrintInfo(std::ostream& rOStream)
const override {rOStream <<
"DistanceModificationProcess";}
139 void PrintData(std::ostream& rOStream)
const override {}
157 double mDistanceThreshold;
159 bool mContinuousDistance;
160 bool mCheckAtEachStep;
161 bool mNegElemDeactivation;
162 bool mAvoidAlmostEmptyElements;
163 bool mRecoverOriginalDistance;
164 std::vector<std::size_t> mModifiedDistancesIDs;
165 std::vector<double> mModifiedDistancesValues;
166 std::vector<Vector> mModifiedElementalDistancesValues;
167 std::vector<const Variable<double>*> mDoubleVariablesList;
168 std::vector<const ComponentType*> mComponentVariablesList;
178 void CheckDefaultsAndProcessSettings(
Parameters &rParameters);
186 void InitializeEmbeddedIsActive();
188 void ModifyDistance();
190 void ModifyDiscontinuousDistance();
192 void RecoverDeactivationPreviousState();
194 void RecoverOriginalDistance();
196 void RecoverOriginalDiscontinuousDistance();
198 void DeactivateFullNegativeElements();
200 template<
class TDistancesVectorType>
201 void SetElementToSplitFlag(
203 const TDistancesVectorType& rDistancesVector)
205 std::size_t n_pos = 0;
206 std::size_t n_neg = 0;
207 for (
double i_dist : rDistancesVector) {
214 if (n_neg != 0 && n_pos != 0) {
215 rElem.
Set(TO_SPLIT,
true);
217 rElem.
Set(TO_SPLIT,
false);
221 void SetContinuousDistanceToSplitFlag();
223 void SetDiscontinuousDistanceToSplitFlag();
231 void CheckAndStoreVariablesList(
const std::vector<std::string>& rVariableStringArray);
241 const std::array<std::size_t,2> GetNodeIDs(
242 const std::size_t NumEdges,
243 const std::size_t EdgeID);
260 DistanceModificationProcess() =
delete;
263 DistanceModificationProcess&
operator=(DistanceModificationProcess
const& rOther) =
delete;
266 DistanceModificationProcess(DistanceModificationProcess
const& rOther) =
delete;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: periodic_interface_process.hpp:55
void ExecuteInitialize() override
Definition: periodic_interface_process.hpp:37
Definition: distance_modification_process.h:58
Variable< double > ComponentType
Definition: distance_modification_process.h:63
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: distance_modification_process.h:139
std::string Info() const override
Turn back information as a string.
Definition: distance_modification_process.h:128
KRATOS_CLASS_POINTER_DEFINITION(DistanceModificationProcess)
Pointer definition of DistanceModificationProcess.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: distance_modification_process.h:136
~DistanceModificationProcess() override
Destructor.
Definition: distance_modification_process.h:95
Base class for all Elements.
Definition: element.h:60
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21