10 #if !defined(KRATOS_ASSIGN_TORQUE_ABOUT_AN_AXIS_TO_CONDITIONS_PROCESS_H_INCLUDED)
11 #define KRATOS_ASSIGN_TORQUE_ABOUT_AN_AXIS_TO_CONDITIONS_PROCESS_H_INCLUDED
59 "model_part_name":"MODEL_PART_NAME",
60 "variable_name": "VARIABLE_NAME",
78 for(
unsigned int i=0;
i<3;
i++)
171 vector_value.
clear();
191 std::string
Info()
const override
193 return "AssignTorqueAboutAnAxisToConditionsProcess";
199 rOStream <<
"AssignTorqueAboutAnAxisToConditionsProcess";
269 #pragma omp parallel for
270 for(
int i = 0;
i<nconditions;
i++)
272 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
274 it->SetValue(rVariable, rvector_value);
279 void AssignTorqueAboutAnAxis(
const Variable<array_1d<double,3> >& rVariable)
289 std::vector<array_1d<double,3> > Couples(nconditions);
290 std::vector<array_1d<double,3> > Forces(nconditions);
293 array_1d<double,3>
radius;
294 array_1d<double,3> distance;
295 array_1d<double,3> force;
297 #pragma omp parallel for private(rotation_matrix,radius,distance,force)
298 for(
int i = 0;
i<nconditions;
i++)
300 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
302 Geometry< Node >& rGeometry = it->GetGeometry();
305 unsigned int size = rGeometry.size();
306 array_1d<double,3> couple;
308 array_1d<double,3> moment;
310 for (
unsigned int j = 0;
j < size;
j++ )
326 noalias(couple) += force*norm_radius;
328 double norm =
norm_2(force);
335 noalias(moment) += norm_radius *
prod(rotation_matrix, force);
338 const unsigned int dimension = rGeometry.WorkingSpaceDimension();
346 Forces[
i] = couple * (1.0/
double(size));
350 double total_size = 1.0;
351 array_1d<double,3> torque;
352 for(
int i = 0;
i<nconditions;
i++)
354 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
355 Geometry< Node >& rGeometry = it->GetGeometry();
356 const unsigned int dimension = rGeometry.WorkingSpaceDimension();
364 torque += Couples[
i];
371 for(
int i = 0;
i<3;
i++)
379 array_1d<double,3>
load;
380 #pragma omp parallel for private(torque)
381 for(
int i = 0;
i<nconditions;
i++)
383 ModelPart::ConditionsContainerType::iterator it = it_begin +
i;
384 load = value * Forces[
i];
385 it->SetValue(rVariable, load);
439 rOStream << std::endl;
The base class for assigning a value to scalar variables or array_1d components processes in Kratos.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:34
ModelPart & mrModelPart
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:221
AssignTorqueAboutAnAxisToConditionsProcess(ModelPart &model_part)
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:47
double mvalue
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:223
~AssignTorqueAboutAnAxisToConditionsProcess() override
Destructor.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:99
AssignTorqueAboutAnAxisToConditionsProcess(ModelPart &model_part, Parameters rParameters)
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:51
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:107
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:149
array_1d< double, 3 > mcenter
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:225
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:144
void Execute() override
Execute method is used to execute the AssignTorqueAboutAnAxisToConditionsProcess algorithms.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:119
AssignTorqueAboutAnAxisToConditionsProcess(AssignTorqueAboutAnAxisToConditionsProcess const &rOther)
Copy constructor.
array_1d< double, 3 > mdirection
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:224
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:203
void ExecuteBeforeSolutionLoop() override
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:138
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:197
void ExecuteAfterOutputStep() override
this function will be executed at every time step AFTER writing the output
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:161
void ExecuteBeforeOutputStep() override
this function will be executed at every time step BEFORE writing the output
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:155
std::string Info() const override
Turn back information as a string.
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:191
void ExecuteInitialize() override
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:132
void ExecuteFinalize() override
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:168
std::string mvariable_name
Definition: assign_torque_about_an_axis_to_conditions_process.hpp:222
KRATOS_CLASS_POINTER_DEFINITION(AssignTorqueAboutAnAxisToConditionsProcess)
Pointer definition of AssignTorqueAboutAnAxisToConditionsProcess.
static void VectorToSkewSymmetricTensor(const TVector3 &rVector, TMatrix3 &rSkewSymmetricTensor)
Definition: beam_math_utilities.hpp:231
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
ConditionsContainerType & Conditions()
Definition: mesh.h:691
ConditionIterator ConditionsBegin()
Definition: mesh.h:671
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType & GetMesh(IndexType ThisIndex=0)
Definition: model_part.h:1791
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
The base class for all processes in Kratos.
Definition: process.h:49
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int domain_size
Definition: face_heat.py:4
model_part
Definition: face_heat.py:14
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
float radius
Definition: mesh_to_mdpa_converter.py:18
def load(f)
Definition: ode_solve.py:307
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17