10 #if !defined(KRATOS_REFINE_ELEMENTS_ON_THRESHOLD_MESHER_PROCESS_H_INCLUDED )
11 #define KRATOS_REFINE_ELEMENTS_ON_THRESHOLD_MESHER_PROCESS_H_INCLUDED
69 : mrModelPart(rModelPart),
70 mrRemesh(rRemeshingParameters)
101 if( ( mrRemesh.
Refine->RefiningOptions.Is(MesherUtilities::REFINE_ADD_NODES) || mrRemesh.
Refine->RefiningOptions.Is(MesherUtilities::REFINE_INSERT_NODES) ) && (mrRemesh.
Refine->RefiningOptions.Is(MesherUtilities::REFINE_ELEMENTS_ON_THRESHOLD) ) ){
126 std::string
Info()
const override
128 return "RefineElementsOnThresholdMesherProcess";
134 rOStream <<
"RefineElementsOnThresholdMesherProcess";
172 void SetNodesToRefine()
176 ProcessInfo& CurrentProcessInfo = mrModelPart.GetProcessInfo();
178 double max_value = 0;
179 double critical_value = mrRemesh.
Refine->ReferenceThreshold;
183 for(ModelPart::ElementsContainerType::const_iterator iii = mrModelPart.ElementsBegin();
184 iii != mrModelPart.ElementsEnd(); ++iii)
186 double variable_value=0;
187 std::vector<double> Value(1);
193 variable_value = Value[0] * iii->GetGeometry().DomainSize();
197 if( variable_value > max_value )
198 max_value = variable_value;
203 if( variable_value > critical_value )
207 for(
unsigned int i = 0;
i<rGeometry.
size(); ++
i)
209 if(rGeometry[
i].
IsNot(BOUNDARY))
210 rGeometry[
i].
Set(TO_REFINE);
217 if( mEchoLevel >= 1 ){
218 if( max_value < critical_value )
219 std::cout<<
" Threshold Value not REACHED :: max_value "<< max_value<<std::endl;
222 std::cout<<
" Threshold reached "<<
counter<<
" times "<<std::endl;
226 if( mEchoLevel >= 1 )
227 std::cout<<
" Refine Elements On Threshold [number:"<<
counter<<
"]"<<std::endl;
268 rOStream << std::endl;
Base class for all Conditions.
Definition: condition.h:59
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
The base class for processes passed to the solution scheme.
Definition: mesher_process.hpp:37
Short class definition.
Definition: mesher_utilities.hpp:49
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Refine Mesh Elements Process 2D and 3D.
Definition: refine_elements_on_threshold_mesher_process.hpp:49
std::string Info() const override
Turn back information as a string.
Definition: refine_elements_on_threshold_mesher_process.hpp:126
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: refine_elements_on_threshold_mesher_process.hpp:97
ModelPart::ConditionType ConditionType
Definition: refine_elements_on_threshold_mesher_process.hpp:57
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: refine_elements_on_threshold_mesher_process.hpp:85
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: refine_elements_on_threshold_mesher_process.hpp:138
ModelPart::PropertiesType PropertiesType
Definition: refine_elements_on_threshold_mesher_process.hpp:58
virtual ~RefineElementsOnThresholdMesherProcess()
Destructor.
Definition: refine_elements_on_threshold_mesher_process.hpp:77
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: refine_elements_on_threshold_mesher_process.hpp:132
KRATOS_CLASS_POINTER_DEFINITION(RefineElementsOnThresholdMesherProcess)
Pointer definition of Process.
RefineElementsOnThresholdMesherProcess(ModelPart &rModelPart, MesherUtilities::MeshingParameters &rRemeshingParameters, int EchoLevel)
Default constructor.
Definition: refine_elements_on_threshold_mesher_process.hpp:66
ConditionType::GeometryType GeometryType
Definition: refine_elements_on_threshold_mesher_process.hpp:59
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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 counter
Definition: script_THERMAL_CORRECT.py:218
integer i
Definition: TensorModule.f:17
Definition: mesher_utilities.hpp:631
RefiningParameters::Pointer Refine
Definition: mesher_utilities.hpp:684