13 #if !defined(KRATOS_MAPPING_VARIABLES_H_INCLUDED)
14 #define KRATOS_MAPPING_VARIABLES_H_INCLUDED
17 #include <unordered_set>
18 #include <unordered_map>
28 #undef KRATOS_EXPORT_MACRO
29 #define KRATOS_EXPORT_MACRO KRATOS_API
129 virtual std::string
Info()
const {
return "IndexDatabase";}
180 return *ThisIterator;
200 BaseType::iterator set = find(IndexOrigin);
217 insert({IndexOrigin});
226 BaseType::iterator set = find(IndexOrigin);
234 std::string
Info()
const override
236 std::stringstream buffer;
237 for (
auto it = begin(); it !=
end(); ++it )
238 buffer <<
"The condition " << *it << std::endl;
261 :
public std::unordered_map<IndexType, IndexType>,
public IndexDatabase
269 typedef std::unordered_map<IndexType, IndexType>
BaseType;
297 return ThisIterator->first;
307 return ThisIterator->second;
317 BaseType::iterator map = find(IndexOrigin);
334 insert({IndexOrigin, IndexNewEntity});
343 BaseType::iterator map = find(IndexOrigin);
355 BaseType::iterator map = find(IndexOrigin);
372 BaseType::iterator map = find(IndexOrigin);
374 map->second = IndexNewEntity;
380 std::string
Info()
const override
382 std::stringstream buffer;
383 for (
auto it = begin(); it !=
end(); ++it )
384 buffer <<
"The condition " << it->first <<
" related with the new condition " << it->second << std::endl;
405 #undef KRATOS_EXPORT_MACRO
406 #define KRATOS_EXPORT_MACRO KRATOS_NO_EXPORT
Base class to derive common methods.
Definition: mapping_variables.h:61
virtual std::string Info() const
Turn back information as a string.
Definition: mapping_variables.h:129
KRATOS_CLASS_POINTER_DEFINITION(IndexDatabase)
IndexDatabase()
Default constructors.
Definition: mapping_variables.h:73
virtual void load(Serializer &rSerializer)
Definition: mapping_variables.h:133
virtual void SetNewEntityId(const IndexType IndexOrigin, const IndexType IndexNewEntity=0)
It sets the new created entity ID.
Definition: mapping_variables.h:121
virtual ~IndexDatabase()
Destructor.
Definition: mapping_variables.h:76
virtual IndexType GetNewEntityId(const IndexType IndexOrigin)
It returns the new created entity ID.
Definition: mapping_variables.h:114
virtual void AddId(const IndexType IndexOrigin, const IndexType IndexNewEntity=0)
It adds a new ID to the map.
Definition: mapping_variables.h:98
virtual void RemoveId(const IndexType IndexOrigin)
It removes one particular pair from the map.
Definition: mapping_variables.h:107
virtual bool Has(const IndexType IndexOrigin)
It checks if an ID exists in the map.
Definition: mapping_variables.h:91
virtual void save(Serializer &rSerializer) const
Definition: mapping_variables.h:131
Custom unordered map container to be used by the mapper.
Definition: mapping_variables.h:262
virtual ~IndexMap()
Destructor.
Definition: mapping_variables.h:280
void save(Serializer &rSerializer) const override
Definition: mapping_variables.h:388
void RemoveId(const IndexType IndexOrigin) override
It removes one particular pair from the map.
Definition: mapping_variables.h:341
IndexType GetOtherId(IteratorType ThisIterator)
Returns the new entity id corresponding a iterator.
Definition: mapping_variables.h:305
bool Has(const IndexType IndexOrigin) override
It checks if an ID exists in the map.
Definition: mapping_variables.h:315
IndexType GetId(IteratorType ThisIterator)
Returns the id corresponding a iterator.
Definition: mapping_variables.h:295
std::string Info() const override
Turn back information as a string.
Definition: mapping_variables.h:380
KRATOS_CLASS_POINTER_DEFINITION(IndexMap)
iterator IteratorType
Definition: mapping_variables.h:270
IndexMap()
Default constructors.
Definition: mapping_variables.h:277
void AddId(const IndexType IndexOrigin, const IndexType IndexNewEntity=0) override
It adds a new ID to the map.
Definition: mapping_variables.h:329
void load(Serializer &rSerializer) override
Definition: mapping_variables.h:393
std::unordered_map< IndexType, IndexType > BaseType
Definition: mapping_variables.h:269
void SetNewEntityId(const IndexType IndexOrigin, const IndexType IndexNewEntity) override
It sets the new created entity ID.
Definition: mapping_variables.h:367
IndexType GetNewEntityId(const IndexType IndexOrigin) override
It returns the new created entity ID.
Definition: mapping_variables.h:353
Custom unordered set container to be used by the mapper.
Definition: mapping_variables.h:145
bool Has(const IndexType IndexOrigin) override
It checks if an ID exists in the map.
Definition: mapping_variables.h:198
void load(Serializer &rSerializer) override
Definition: mapping_variables.h:247
std::string Info() const override
Turn back information as a string.
Definition: mapping_variables.h:234
virtual ~IndexSet()
Destructor.
Definition: mapping_variables.h:163
IndexType GetId(IteratorType ThisIterator)
Returns the id corresponding a iterator.
Definition: mapping_variables.h:178
KRATOS_CLASS_POINTER_DEFINITION(IndexSet)
IndexSet()
Default constructors.
Definition: mapping_variables.h:160
iterator IteratorType
Definition: mapping_variables.h:153
void AddId(const IndexType IndexOrigin, const IndexType IndexNewEntity=0) override
It adds a new ID to the map.
Definition: mapping_variables.h:212
void RemoveId(const IndexType IndexOrigin) override
It removes one particular pair from the map.
Definition: mapping_variables.h:224
IndexType GetOtherId(IteratorType ThisIterator)
Returns the new entity id corresponding a iterator.
Definition: mapping_variables.h:188
std::unordered_set< IndexType > BaseType
Definition: mapping_variables.h:152
void save(Serializer &rSerializer) const override
Definition: mapping_variables.h:242
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
end
Definition: DEM_benchmarks.py:180
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KRATOS_DEFINE_VARIABLE(Vector, BIOT_STRAIN_VECTOR)