16 #if !defined(KRATOS_VARIABLE_DATA_H_INCLUDED )
17 #define KRATOS_VARIABLE_DATA_H_INCLUDED
76 operator size_t()
const
92 virtual void* Clone(
const void* pSource)
const;
102 virtual void* Copy(
const void* pSource,
void* pDestination)
const;
111 virtual void Assign(
const void* pSource,
void* pDestination)
const;
118 virtual void AssignZero(
void* pDestination)
const;
126 virtual void Delete(
void* pSource)
const;
134 virtual void Destruct(
void* pSource)
const;
144 virtual void Print(
const void* pSource, std::ostream& rOStream)
const;
154 virtual void PrintData(
const void* pSource, std::ostream& rOStream)
const;
160 virtual void Allocate(
void** pData)
const;
167 virtual void Save(
Serializer& rSerializer,
void* pData)
const;
174 virtual void Load(
Serializer& rSerializer,
void* pData)
const;
194 return mpSourceVariable->mKey;
199 void SetKey(KeyType NewKey);
201 const std::string&
Name()
const
218 return !mIsComponent;
228 constexpr
KeyType first_7_bits=127;
229 return (mKey & first_7_bits);
234 KRATOS_DEBUG_ERROR_IF(mpSourceVariable ==
nullptr) <<
"No source variable is defined for the component" << std::endl;
235 return *mpSourceVariable;
239 KRATOS_ERROR <<
"Calling base class method." << std::endl;
253 virtual std::string
Info()
const;
256 virtual void PrintInfo(std::ostream& rOStream)
const;
259 virtual void PrintData(std::ostream& rOStream)
const;
276 static KeyType GenerateKey(
const std::string& Name, std::size_t
Size,
bool IsComponent,
char ComponentIndex);
284 return (rFirstVariable.mKey == rSecondVariable.mKey);
300 mName = rOtherVariable.mName;
301 mKey = rOtherVariable.mKey;
302 mSize = rOtherVariable.mSize;
303 mpSourceVariable = rOtherVariable.mpSourceVariable;
304 mIsComponent = rOtherVariable.mIsComponent;
314 VariableData(
const std::string& NewName, std::size_t NewSize);
317 VariableData(
const std::string& NewName, std::size_t NewSize,
const VariableData* pSourceVariable,
char ComponentIndex);
348 virtual void save(
Serializer& rSerializer)
const;
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
This class is the base of variables and variable's components which contains their common data.
Definition: variable_data.h:49
KeyType HashKey() const
Definition: variable_data.h:180
virtual void PrintData(const void *pSource, std::ostream &rOStream) const
Definition: variable_data.cpp:80
virtual const void * pZero() const
Definition: variable_data.h:238
KRATOS_CLASS_POINTER_DEFINITION(VariableData)
Pointer definition of VariableData.
KeyType GetComponentIndex() const
Returns the component index.
Definition: variable_data.h:227
virtual ~VariableData()
Destructor.
Definition: variable_data.h:67
KeyType SourceKey() const
Definition: variable_data.h:192
friend bool operator==(const VariableData &rFirstVariable, const VariableData &rSecondVariable)
Definition: variable_data.h:282
std::size_t Size() const
Definition: variable_data.h:206
VariableData & operator=(const VariableData &rOtherVariable)
Definition: variable_data.h:298
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: variable_data.cpp:111
VariableData()
Definition: variable_data.h:322
bool IsNotComponent() const
Definition: variable_data.h:216
const VariableData & GetSourceVariable() const
Definition: variable_data.h:232
bool IsComponent() const
Definition: variable_data.h:211
const std::string & Name() const
Definition: variable_data.h:201
KeyType Key() const
Definition: variable_data.h:187
std::size_t KeyType
Definition: variable_data.h:57
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
void Assign(const Expression &rExpression, const IndexType EntityIndex, const IndexType EntityDataBeginIndex, TDataType &rValue, std::index_sequence< TIndex... >)
Definition: variable_expression_data_io.cpp:41
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
def load(f)
Definition: ode_solve.py:307