19 #if !defined(KRATOS_TOPOLOGY_UPDATING_UTILITIES_H_INCLUDED)
20 #define KRATOS_TOPOLOGY_UPDATING_UTILITIES_H_INCLUDED
108 if ( strcmp( update_type ,
"oc_algorithm" ) == 0 ){
110 KRATOS_INFO(
"[TopOpt]") <<
" Optimality Criterion Method (OC) chosen to solve the optimization problem" << std::endl;
121 KRATOS_INFO(
"[TopOpt]") <<
" Grey Scale Filter activated, q = " <<
q << std::endl;
125 KRATOS_INFO(
"[TopOpt]") <<
" Grey Scale Filter deactivated, q = " <<
q << std::endl;
131 const double move = 0.2;
139 while ((l2-l1)/(l1+l2) > 0.001)
149 const double x_old = element_i->GetValue(X_PHYS_OLD);
150 const int solid_void = element_i->GetValue(SOLID_VOID);
151 const double dcdx = element_i->GetValue(DCDX);
152 const double dvdx = element_i->GetValue(DVDX);
153 const double initial_element_size = element_i->GetValue(INITIAL_ELEMENT_SIZE);
180 KRATOS_INFO(
"[TopOpt]") <<
"This value for SOLID_VOID does not exist."<< std::endl;
185 element_i->SetValue(X_PHYS, x_new);
188 sum_X_Phys = sum_X_Phys + x_new*initial_element_size;
189 model_size += initial_element_size;
193 if( sum_X_Phys > (model_size*volfrac))
200 KRATOS_INFO(
"[TopOpt]") <<
" Updating of values performed [ spent time = " <<
timer.ElapsedSeconds() <<
" ] " << std::endl;
202 KRATOS_ERROR <<
"No valid optimization_algorithm selected for the simulation. Selected one: " << update_type << std::endl;
225 virtual std::string
Info()
const
227 return "TopologyUpdatingUtilities";
233 rOStream <<
"TopologyUpdatingUtilities";
Definition: builtin_timer.h:26
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
MeshType::ElementIterator ElementIterator
Definition: model_part.h:174
Solution utility that updates response values for next iteration.
Definition: topology_updating_utilities.h:65
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: topology_updating_utilities.h:237
void UpdateDensitiesUsingOCMethod(char update_type[], double volfrac, double greyscale, double OptItr, double qmax)
Finds the value of the X_PHYS (density) and updates it into the optimization problem.
Definition: topology_updating_utilities.h:104
TopologyUpdatingUtilities(ModelPart &model_part)
Default constructor.
Definition: topology_updating_utilities.h:79
virtual std::string Info() const
Turn back information as a string.
Definition: topology_updating_utilities.h:225
virtual ~TopologyUpdatingUtilities()
Destructor.
Definition: topology_updating_utilities.h:85
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: topology_updating_utilities.h:231
KRATOS_CLASS_POINTER_DEFINITION(TopologyUpdatingUtilities)
Pointer definition of TopologyUpdatingUtilities.
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_INFO(label)
Definition: logger.h:250
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
model_part
Definition: face_heat.py:14
q
Definition: generate_convection_diffusion_explicit_element.py:109