18 #if !defined(KRATOS_STRUCTURE_RESPONSE_FUNCTION_UTILITIES_H_INCLUDED)
19 #define KRATOS_STRUCTURE_RESPONSE_FUNCTION_UTILITIES_H_INCLUDED
105 KRATOS_INFO(
"[TopOpt]") <<
" Start calculating strain energy."<<std::endl;
108 double Global_Strain_Energy = 0.0;
115 element_i->Calculate(LOCAL_STRAIN_ENERGY, Out, mr_structure_model_part.
GetProcessInfo());
117 Global_Strain_Energy += element_i->GetValue(LOCAL_STRAIN_ENERGY);
121 KRATOS_INFO(
"[TopOpt]") <<
" Strain energy calculated [ spent time = " <<
timer.ElapsedSeconds() <<
" ] " << std::endl;
124 return Global_Strain_Energy;
134 KRATOS_INFO(
"[TopOpt]") <<
" Start calculating volume fraction."<<std::endl;
136 double Global_Volume_Fraction = 0.0;
137 double elemental_volume = 0.0;
138 double design_variable = 0.0;
139 double Total_volume = 0.0;
147 elemental_volume = element_i->GetValue(INITIAL_ELEMENT_SIZE);
148 design_variable = element_i->GetValue(X_PHYS);
149 Global_Volume_Fraction += (elemental_volume*design_variable);
150 Total_volume += elemental_volume;
154 Global_Volume_Fraction = Global_Volume_Fraction/Total_volume;
155 KRATOS_INFO(
"[TopOpt]") <<
" Global Volume Fraction: " << Global_Volume_Fraction << std::endl;
156 KRATOS_INFO(
"[TopOpt]") <<
" Volume fraction calculated [ spent time = " <<
timer.ElapsedSeconds() <<
" ] " << std::endl;
157 return Global_Volume_Fraction;
178 virtual std::string
Info()
const
180 return "StructureResponseFunctionUtilities";
186 rOStream <<
"StructureResponseFunctionUtilities";
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
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
MeshType::ElementIterator ElementIterator
Definition: model_part.h:174
Solution utility to compute structural analysis responses.
Definition: structure_response_function_utilities.h:61
double ComputeVolumeFraction()
Definition: structure_response_function_utilities.h:129
KRATOS_CLASS_POINTER_DEFINITION(StructureResponseFunctionUtilities)
Pointer definition of StructureResponseFunctionUtilities.
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: structure_response_function_utilities.h:184
virtual std::string Info() const
Turn back information as a string.
Definition: structure_response_function_utilities.h:178
StructureResponseFunctionUtilities(ModelPart &model_part)
Default constructor.
Definition: structure_response_function_utilities.h:75
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: structure_response_function_utilities.h:190
double ComputeStrainEnergy()
Computes the strain energy as the objective function of the optimization problem.
Definition: structure_response_function_utilities.h:100
virtual ~StructureResponseFunctionUtilities()
Destructor.
Definition: structure_response_function_utilities.h:81
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_INFO(label)
Definition: logger.h:250
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
model_part
Definition: face_heat.py:14