13 #if !defined(KRATOS_RESULT_DATABASE_H_INCLUDED )
14 #define KRATOS_RESULT_DATABASE_H_INCLUDED
19 #include <unordered_map>
83 ) :
mData(SizeVector, rBaseData)
121 return mData.begin();
127 DataType::const_iterator
begin()
const
129 return mData.begin();
143 DataType::const_iterator
end()
const
190 virtual std::string
Info()
const
192 return "EntityDatabase";
198 rOStream <<
"EntityDatabase";
253 ) :
mData(SizeVector, rBaseData)
291 return mData.begin();
297 DataType::const_iterator
begin()
const
299 return mData.begin();
313 DataType::const_iterator
end()
const
364 virtual std::string
Info()
const
366 return "VariableDatabase";
372 rOStream <<
"VariableDatabase";
453 const std::vector<IndexType>& rVariablesIndexes,
454 const std::vector<IndexType>& rValuesSizes,
464 template<
class TVariableType>
467 const auto it =
mData.find(rVariable.Key());
468 if (it !=
mData.end()) {
471 KRATOS_ERROR <<
"Not allocated Variable: " << rVariable.Name() << std::endl;
480 template<
class TVariableType>
483 const auto it =
mData.find(rVariable.Key());
484 if (it !=
mData.end()) {
487 KRATOS_ERROR <<
"Not allocated Variable: " << rVariable.Name() << std::endl;
501 template<
class TVariableType>
505 const TVariableType& rVariable,
511 auto it =
mData.find(rVariable.Key());
512 if (it !=
mData.end()) {
513 auto& r_database = it->second;
514 r_database.SetValues(rValuesX, rValuesY, EntityIndex, ComponentIndex, GPIndex);
516 KRATOS_ERROR <<
"Not allocated Variable: " << rVariable.Name() << std::endl;
561 virtual std::string
Info()
const
563 return "ResultDatabase";
569 rOStream <<
"ResultDatabase";
585 std::unordered_map<IndexType, VariableDatabase>
mData;
This class stores the results of a entity.
Definition: result_dabatase.h:53
std::size_t SizeType
The definition of the sizetype.
Definition: result_dabatase.h:71
virtual ~EntityDatabase()
Destructor.
Definition: result_dabatase.h:88
DataType::const_iterator begin() const
The const begin iterator.
Definition: result_dabatase.h:127
DataType::iterator end()
The end iterator.
Definition: result_dabatase.h:135
std::size_t IndexType
The definition of the index type.
Definition: result_dabatase.h:68
DataType mData
Definition: result_dabatase.h:213
double GetValue(const double Time, const SizeType ComponentIndex=0, const SizeType GPIndex=0) const
This method retrieves the interpolated value from the database.
Definition: result_dabatase.cpp:32
const GPDatabaseType & GetResultaData(const SizeType GPIndex=0) const
This method retrieves the entity database.
Definition: result_dabatase.cpp:23
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: result_dabatase.h:196
void SetValues(const Vector &rValuesX, const Vector &rValuesY, const SizeType ComponentIndex=0, const SizeType GPIndex=0)
This method set the values into the tables.
Definition: result_dabatase.cpp:45
DataType::iterator begin()
The begin iterator.
Definition: result_dabatase.h:119
std::vector< Table< double, double > * > GPDatabaseType
GP database definition.
Definition: result_dabatase.h:62
EntityDatabase(EntityDatabase const &rOther)
Copy constructor.
Definition: result_dabatase.h:94
GPDatabaseType & operator[](const std::size_t i)
The [] operator.
Definition: result_dabatase.h:107
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: result_dabatase.h:202
std::vector< GPDatabaseType > DataType
Base type definition.
Definition: result_dabatase.h:65
EntityDatabase(const SizeType SizeVector, const GPDatabaseType &rBaseData)
Default constructor.
Definition: result_dabatase.h:80
virtual std::string Info() const
Turn back information as a string.
Definition: result_dabatase.h:190
KRATOS_CLASS_POINTER_DEFINITION(EntityDatabase)
Pointer definition of ResultDatabase.
void Clear()
This function is designed for clear all the databases.
Definition: result_dabatase.cpp:71
DataType::const_iterator end() const
The const end iterator.
Definition: result_dabatase.h:143
This class stores the results of a simulation for a later comparison.
Definition: result_dabatase.h:403
std::unordered_map< IndexType, VariableDatabase > mData
Definition: result_dabatase.h:585
void Clear()
This function is designed for clear all the databases.
Definition: result_dabatase.cpp:177
virtual ~ResultDatabase()
Destructor.
Definition: result_dabatase.h:427
const VariableDatabase & GetVariableData(const TVariableType &rVariable) const
This method retrieves the variable database.
Definition: result_dabatase.h:481
Vector mCommonColumn
Definition: result_dabatase.h:587
ResultDatabase(ResultDatabase const &rOther)
Copy constructor.
Definition: result_dabatase.h:433
virtual std::string Info() const
Turn back information as a string.
Definition: result_dabatase.h:561
Vector & GetCommonColumn()
This method returns the common column vector.
Definition: result_dabatase.h:538
ResultDatabase()
Default constructor.
Definition: result_dabatase.h:424
void Initialize(const std::vector< IndexType > &rVariablesIndexes, const std::vector< IndexType > &rValuesSizes, const SizeType NumberOfEntites, const SizeType NumberOfGP=1)
This method initializes the database.
Definition: result_dabatase.cpp:137
int Check()
This function is designed for being called after ExecuteInitialize ONCE to verify that the input is c...
Definition: result_dabatase.cpp:198
KRATOS_CLASS_POINTER_DEFINITION(ResultDatabase)
Pointer definition of ResultDatabase.
void SetCommonColumn(const Vector &rCommonColumn)
This method sets the common column.
Definition: result_dabatase.h:547
void SetValues(const Vector &rValuesX, const Vector &rValuesY, const TVariableType &rVariable, const IndexType EntityIndex, const SizeType ComponentIndex=0, const SizeType GPIndex=0)
This method set the values into the tables.
Definition: result_dabatase.h:502
std::size_t SizeType
The definition of the sizetype.
Definition: result_dabatase.h:415
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: result_dabatase.h:573
VariableDatabase & GetVariableData(const TVariableType &rVariable)
This method retrieves the variable database.
Definition: result_dabatase.h:465
std::size_t IndexType
The definition of the index type.
Definition: result_dabatase.h:412
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: result_dabatase.h:567
This class stores the results of a variable.
Definition: result_dabatase.h:226
std::size_t SizeType
The definition of the sizetype.
Definition: result_dabatase.h:241
DataType::const_iterator end() const
The const end iterator.
Definition: result_dabatase.h:313
virtual ~VariableDatabase()
Destructor.
Definition: result_dabatase.h:258
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: result_dabatase.h:376
EntityDatabase & operator[](const std::size_t i)
The [] operator.
Definition: result_dabatase.h:277
double GetValue(const IndexType EntityIndex, const double Time, const SizeType ComponentIndex=0, const SizeType GPIndex=0) const
This method retrieves the interpolated value from the database.
Definition: result_dabatase.cpp:94
void SetValues(const Vector &rValuesX, const Vector &rValuesY, const IndexType EntityIndex, const SizeType ComponentIndex=0, const SizeType GPIndex=0)
This method set the values into the tables.
Definition: result_dabatase.cpp:108
DataType::iterator begin()
The begin iterator.
Definition: result_dabatase.h:289
std::vector< EntityDatabase > DataType
Base type definition.
Definition: result_dabatase.h:235
std::size_t IndexType
The definition of the index type.
Definition: result_dabatase.h:238
const EntityDatabase & GetEntityData(const IndexType EntityIndex) const
This method retrieves the entity database.
Definition: result_dabatase.cpp:85
void Clear()
This function is designed for clear all the databases.
Definition: result_dabatase.cpp:123
virtual std::string Info() const
Turn back information as a string.
Definition: result_dabatase.h:364
VariableDatabase(VariableDatabase const &rOther)
Copy constructor.
Definition: result_dabatase.h:264
DataType mData
Definition: result_dabatase.h:387
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: result_dabatase.h:370
DataType::const_iterator begin() const
The const begin iterator.
Definition: result_dabatase.h:297
DataType::iterator end()
The end iterator.
Definition: result_dabatase.h:305
KRATOS_CLASS_POINTER_DEFINITION(VariableDatabase)
Pointer definition of ResultDatabase.
VariableDatabase(const SizeType SizeVector, const EntityDatabase &rBaseData)
Default constructor.
Definition: result_dabatase.h:250
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
integer i
Definition: TensorModule.f:17