13 #if !defined(KRATOS_CONDITION_H_INCLUDED )
14 #define KRATOS_CONDITION_H_INCLUDED
125 , mpProperties(nullptr)
134 , mpProperties(nullptr)
143 , mpProperties(nullptr)
152 , mpProperties(pProperties)
160 , mpProperties(rOther.mpProperties)
184 mpProperties = rOther.mpProperties;
206 PropertiesType::Pointer pProperties)
const
209 KRATOS_ERROR <<
"Please implement the First Create method in your derived Condition" <<
Info() << std::endl;
210 return Kratos::make_intrusive<Condition>(NewId,
GetGeometry().
Create(ThisNodes), pProperties);
222 GeometryType::Pointer pGeom,
223 PropertiesType::Pointer pProperties)
const
226 KRATOS_ERROR <<
"Please implement the Second Create method in your derived Condition" <<
Info() << std::endl;
227 return Kratos::make_intrusive<Condition>(NewId, pGeom, pProperties);
241 KRATOS_WARNING(
"Condition") <<
" Call base class condition Clone " << std::endl;
243 p_new_cond->SetData(this->
GetData());
244 p_new_cond->Set(
Flags(*
this));
263 if (rResult.size() != 0) {
276 if (rElementalDofList.size() != 0) {
277 rElementalDofList.resize(0);
412 if (rLeftHandSideMatrix.size1() != 0) {
413 rLeftHandSideMatrix.
resize(0, 0,
false);
415 if (rRightHandSideVector.size() != 0) {
416 rRightHandSideVector.
resize(0,
false);
429 if (rLeftHandSideMatrix.size1() != 0) {
430 rLeftHandSideMatrix.
resize(0, 0,
false);
443 if (rRightHandSideVector.size() != 0) {
444 rRightHandSideVector.
resize(0,
false);
469 if (rLeftHandSideMatrix.size1() != 0) {
470 rLeftHandSideMatrix.
resize(0, 0,
false);
472 if (rRightHandSideVector.size() != 0) {
473 rRightHandSideVector.
resize(0,
false);
486 if (rLeftHandSideMatrix.size1() != 0) {
487 rLeftHandSideMatrix.
resize(0, 0,
false);
500 if (rRightHandSideVector.size() != 0) {
501 rRightHandSideVector.
resize(0,
false);
526 if (rLeftHandSideMatrix.size1() != 0) {
527 rLeftHandSideMatrix.
resize(0, 0,
false);
529 if (rRightHandSideVector.size() != 0) {
530 rRightHandSideVector.
resize(0,
false);
543 if (rLeftHandSideMatrix.size1() != 0) {
544 rLeftHandSideMatrix.
resize(0, 0,
false);
557 if (rRightHandSideVector.size() != 0) {
558 rRightHandSideVector.
resize(0,
false);
576 if (rMassMatrix.size1() != 0) {
577 rMassMatrix.
resize(0, 0,
false);
588 if (rDampingMatrix.size1() != 0) {
589 rDampingMatrix.
resize(0, 0,
false);
628 KRATOS_ERROR <<
"Base condition class is not able to assemble rRHS to the desired variable. destination variable is " << rDestinationVariable << std::endl;
646 KRATOS_ERROR <<
"Base condition class is not able to assemble rRHS to the desired variable. destination variable is " << rDestinationVariable << std::endl;
664 KRATOS_ERROR <<
"Base condition class is not able to assemble rLHS to the desired variable. destination variable is " << rDestinationVariable << std::endl;
708 std::vector<bool>& rOutput,
715 std::vector<int>& rOutput,
722 std::vector<double>& rOutput,
757 std::vector<Vector>& rOutput,
764 std::vector<Matrix>& rOutput,
784 const std::vector<bool>& rValues,
791 const std::vector<int>& rValues,
798 const std::vector<double>& rValues,
833 const std::vector<Vector>& rValues,
840 const std::vector<Matrix>& rValues,
858 KRATOS_ERROR_IF( this->
Id() < 1 ) <<
"Condition found with Id " << this->
Id() << std::endl;
861 KRATOS_ERROR_IF( domain_size < 0.0 ) <<
"Condition " << this->
Id() <<
" has negative size " << domain_size << std::endl;
878 if (rMassMatrix.size1() != 0) {
879 rMassMatrix.
resize(0, 0,
false);
902 if (rDampMatrix.size1() != 0) {
903 rDampMatrix.
resize(0, 0,
false);
925 if (rDampingMatrix.size1() != 0) {
926 rDampingMatrix.
resize(0, 0,
false);
937 if (rOutput.size1() != 0)
938 rOutput.
resize(0, 0,
false);
948 if (rOutput.size1() != 0)
949 rOutput.
resize(0, 0,
false);
977 <<
"Tryining to get the properties of " <<
Info()
978 <<
", which are uninitialized." << std::endl;
979 return *mpProperties;
985 <<
"Tryining to get the properties of " <<
Info()
986 <<
", which are uninitialized." << std::endl;
987 return *mpProperties;
992 mpProperties = pProperties;
1002 return mpProperties !=
nullptr;
1040 "time_integration" : [],
1041 "framework" : "lagrangian",
1042 "symmetric_lhs" : false,
1043 "positive_definite_lhs" : false,
1046 "nodal_historical" : [],
1047 "nodal_non_historical" : [],
1050 "required_variables" : [],
1051 "required_dofs" : [],
1053 "compatible_geometries" : [],
1054 "element_integrates_in_time" : true,
1055 "compatible_constitutive_laws": {
1060 "required_polynomial_degree_of_geometry" : -1,
1061 "documentation" : "This is the base condition"
1064 return specifications;
1071 std::stringstream buffer;
1072 buffer <<
"Condition #" <<
Id();
1073 return buffer.str();
1080 rOStream <<
"Condition #" <<
Id();
1128 Properties::Pointer mpProperties;
1142 void save(
Serializer& rSerializer)
const override
1145 rSerializer.
save(
"Properties", mpProperties);
1151 rSerializer.
load(
"Properties", mpProperties);
1184 rOStream <<
" : " << std::endl;
1199 #undef KRATOS_EXPORT_MACRO
1200 #define KRATOS_EXPORT_MACRO KRATOS_API
1204 #undef KRATOS_EXPORT_MACRO
1205 #define KRATOS_EXPORT_MACRO KRATOS_NO_EXPORT
Base class for all Conditions.
Definition: condition.h:59
virtual void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:273
virtual void CalculateSensitivityMatrix(const Variable< double > &rDesignVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:933
virtual void CalculateOnIntegrationPoints(const Variable< bool > &rVariable, std::vector< bool > &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:706
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new condition pointer.
Definition: condition.h:205
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: condition.h:1085
std::size_t SizeType
Definition: condition.h:94
GeometryData::IntegrationMethod IntegrationMethod
Type definition for integration methods.
Definition: condition.h:105
virtual const Parameters GetSpecifications() const
This method provides the specifications/requirements of the element.
Definition: condition.h:1037
virtual void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 >> &rVariable, std::vector< array_1d< double, 3 >> &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:727
virtual void Calculate(const Variable< array_1d< double, 3 > > &rVariable, array_1d< double, 3 > &Output, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:679
virtual void SetValuesOnIntegrationPoints(const Variable< array_1d< double, 3 >> &rVariable, const std::vector< array_1d< double, 3 >> &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:803
virtual void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:922
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(Condition)
Pointer definition of Condition.
GeometricalObject BaseType
base type: an GeometricalObject that automatically has a unique number
Definition: condition.h:71
virtual void ResetConstitutiveLaw()
Definition: condition.h:352
Condition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: condition.h:150
virtual void DampMatrix(MatrixType &rDampMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:900
PointerVectorSet< DofType > DofsArrayType
Definition: condition.h:102
virtual void CalculateSecondDerivativesLHS(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:540
virtual void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< array_1d< double, 3 > > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo)
This function is designed to make the condition to assemble an rRHS vector identified by a variable r...
Definition: condition.h:639
Dof< double > DofType
Definition: condition.h:96
virtual void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:389
std::size_t IndexType
Definition: condition.h:92
Node NodeType
definition of node type (default is: Node)
Definition: condition.h:74
virtual Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const
It creates a new condition pointer.
Definition: condition.h:221
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: condition.h:86
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
virtual void GetSecondDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:323
virtual void CalculateFirstDerivativesLHS(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:483
virtual void Calculate(const Variable< Vector > &rVariable, Vector &Output, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:685
virtual void CalculateOnIntegrationPoints(const Variable< int > &rVariable, std::vector< int > &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:713
virtual void AddMassMatrix(MatrixType &rLeftHandSideMatrix, double coeff, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:889
Matrix MatrixType
Definition: condition.h:90
virtual void Calculate(const Variable< Matrix > &rVariable, Matrix &Output, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:691
virtual void AddInertiaForces(VectorType &rRightHandSideVector, double coeff, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:911
virtual Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const
It creates a new condition pointer and clones the previous condition data.
Definition: condition.h:238
std::string Info() const override
Turn back information as a string.
Definition: condition.h:1069
Condition(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: condition.h:141
PropertiesType & GetProperties()
Definition: condition.h:974
virtual void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:720
virtual void SetValuesOnIntegrationPoints(const Variable< bool > &rVariable, const std::vector< bool > &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:782
virtual void CalculateFirstDerivativesRHS(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:497
virtual void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:368
bool HasProperties() const
Check that the Condition has a correctly initialized pointer to a Properties instance.
Definition: condition.h:1000
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
virtual void SetValuesOnIntegrationPoints(const Variable< array_1d< double, 9 >> &rVariable, const std::vector< array_1d< double, 9 >> &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:824
void SetProperties(PropertiesType::Pointer pProperties)
Definition: condition.h:990
Vector VectorType
Definition: condition.h:88
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:313
virtual void SetValuesOnIntegrationPoints(const Variable< int > &rVariable, const std::vector< int > &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:789
virtual void SetValuesOnIntegrationPoints(const Variable< Vector > &rVariable, const std::vector< Vector > &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:831
virtual void CalculateOnIntegrationPoints(const Variable< array_1d< double, 6 >> &rVariable, std::vector< array_1d< double, 6 >> &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:741
virtual void SetValuesOnIntegrationPoints(const Variable< array_1d< double, 4 >> &rVariable, const std::vector< array_1d< double, 4 >> &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:810
Properties PropertiesType
Definition: condition.h:80
GeometryData GeometryDataType
Definition: condition.h:107
virtual void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:426
Condition ConditionType
definition of condition type
Definition: condition.h:68
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: condition.h:1078
virtual void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:574
virtual void CalculateFirstDerivativesContributions(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:465
virtual void CalculateSensitivityMatrix(const Variable< array_1d< double, 3 > > &rDesignVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:944
virtual void MassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:876
virtual void SetValuesOnIntegrationPoints(const Variable< array_1d< double, 6 >> &rVariable, const std::vector< array_1d< double, 6 >> &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:817
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:854
const PropertiesType::Pointer pGetProperties() const
Definition: condition.h:969
virtual void AddExplicitContribution(const MatrixType &rLHSMatrix, const Variable< MatrixType > &rLHSVariable, const Variable< Matrix > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo)
This function is designed to make the condition to assemble an rRHS vector identified by a variable r...
Definition: condition.h:657
Condition & operator=(Condition const &rOther)
Assignment operator.
Definition: condition.h:181
virtual void SetValuesOnIntegrationPoints(const Variable< double > &rVariable, const std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:796
virtual void Initialize(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:344
~Condition() override
Destructor.
Definition: condition.h:166
virtual void SetValuesOnIntegrationPoints(const Variable< Matrix > &rVariable, const std::vector< Matrix > &rValues, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:838
Condition(Condition const &rOther)
Copy constructor.
Definition: condition.h:158
PropertiesType const & GetProperties() const
Definition: condition.h:982
virtual void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:375
virtual void CalculateOnIntegrationPoints(const Variable< array_1d< double, 9 >> &rVariable, std::vector< array_1d< double, 9 >> &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:748
virtual void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:586
PropertiesType::Pointer pGetProperties()
returns the pointer to the property of the condition. Does not throw an error, to allow copying of co...
Definition: condition.h:964
virtual IntegrationMethod GetIntegrationMethod() const
Definition: condition.h:288
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:260
virtual void CalculateSecondDerivativesRHS(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:554
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:440
virtual void CalculateOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:762
Condition(IndexType NewId=0)
Definition: condition.h:123
virtual void Calculate(const Variable< double > &rVariable, double &Output, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:673
virtual void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:382
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: condition.h:83
virtual void CalculateOnIntegrationPoints(const Variable< array_1d< double, 4 >> &rVariable, std::vector< array_1d< double, 4 >> &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:734
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:408
virtual void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< double > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo)
This function is designed to make the condition to assemble an rRHS vector identified by a variable r...
Definition: condition.h:621
Condition(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: condition.h:132
virtual void GetValuesVector(Vector &values, int Step=0) const
Definition: condition.h:303
virtual void AddExplicitContribution(const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:609
virtual void CalculateOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:755
virtual void CalculateSecondDerivativesContributions(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:522
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
std::size_t IndexType
Definition: flags.h:74
Flags()
Default constructor.
Definition: flags.h:119
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
GeometryType::Pointer pGetGeometry()
Returns the pointer to the geometry.
Definition: geometrical_object.h:140
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
GeometricalObject & operator=(GeometricalObject const &rOther)
Assignment operator.
Definition: geometrical_object.h:112
DataValueContainer & GetData()
Definition: geometrical_object.h:212
Definition: geometry_data.h:60
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
virtual int Check() const
Definition: geometry.h:3790
virtual double DomainSize() const
This method calculate and return length, area or volume of this geometry depending to it's dimension.
Definition: geometry.h:1371
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
IndexType Id() const
Definition: indexed_object.h:107
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
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
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
#define KRATOS_WARNING(label)
Definition: logger.h:265
#define KRATOS_API_EXTERN
Definition: kratos_export_api.h:57
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void AddKratosComponent(std::string const &Name, ExplicitBuilderType const &ThisComponent)
Definition: register_factories.cpp:23
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
KRATOS_DEFINE_VARIABLE(Vector, BIOT_STRAIN_VECTOR)
list coeff
Definition: bombardelli_test.py:41
list values
Definition: bombardelli_test.py:42
int domain_size
Definition: face_heat.py:4
def load(f)
Definition: ode_solve.py:307