30 template<
class TGeometryType>
36 std::size_t
const& operator()(
const TGeometryType& rGeometry)
const
38 return rGeometry.Id();
59 std::hash<std::size_t>,
81 : mGeometries(rOther.mGeometries)
87 : mGeometries(NewGeometries)
99 typename GeometriesMapType::Pointer p_geometries(
new GeometriesMapType(*mGeometries));
116 return mGeometries.
size();
126 auto i = mGeometries.
find(pNewGeometry->Id());
127 if (
i == mGeometries.
end()) {
128 return mGeometries.
insert(pNewGeometry);
129 }
else if (&(*
i) == pNewGeometry.get()) {
132 KRATOS_ERROR <<
"Attempting to add Geometry with Id: " << pNewGeometry->Id() <<
", unfortunately a (different) geometry with the same Id already exists!" << std::endl;
143 auto i = mGeometries.
find(GeometryId);
145 <<
" geometry index not found: " << GeometryId <<
".";
146 return (
i.base()->second);
152 auto i = mGeometries.
find(GeometryId);
154 <<
" geometry index not found: " << GeometryId <<
".";
155 return (
i.base()->second);
161 auto hash_index = TGeometryType::GenerateId(GeometryName);
162 auto i = mGeometries.
find(hash_index);
164 <<
" geometry index not found: " << GeometryName <<
".";
165 return (
i.base()->second);
171 auto hash_index = TGeometryType::GenerateId(GeometryName);
172 auto i = mGeometries.
find(hash_index);
174 <<
" geometry index not found: " << GeometryName <<
".";
175 return (
i.base()->second);
209 mGeometries.
erase(GeometryId);
215 auto index = TGeometryType::GenerateId(GeometryName);
217 mGeometries.
erase(index);
226 return (mGeometries.
find(GeometryId) != mGeometries.
end());
231 auto hash_index = TGeometryType::GenerateId(GeometryName);
233 return (mGeometries.
find(hash_index) != mGeometries.
end());
242 return mGeometries.
begin();
247 return mGeometries.
begin();
252 return mGeometries.
end();
257 return mGeometries.
end();
281 return "GeometryContainer";
293 rOStream <<
"Number of Geometries: " << mGeometries.
size() << std::endl;
297 virtual void PrintInfo(std::ostream& rOStream, std::string
const& PrefixString)
const
299 rOStream << PrefixString <<
Info();
303 virtual void PrintData(std::ostream& rOStream, std::string
const& PrefixString )
const
305 rOStream << PrefixString <<
"Number of Geometries: " << mGeometries.
size() << std::endl;
325 rSerializer.
save(
"Geometries", mGeometries);
330 rSerializer.
load(
"Geometries", mGeometries);
340 mGeometries = rOther.mGeometries;
353 template<
class TGeometryType>
358 template<
class TGeometryType>
363 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: geometry_container.h:32
GeometryContainer(GeometriesMapType &NewGeometries)
Components Constructor.
Definition: geometry_container.h:85
void Clear()
Definition: geometry_container.h:104
GeometryIterator GeometriesBegin()
Definition: geometry_container.h:240
const TGeometryType & GetGeometry(IndexType GeometryId) const
Returns a const reference geometry corresponding to the id.
Definition: geometry_container.h:185
virtual void PrintData(std::ostream &rOStream, std::string const &PrefixString) const
Print object's data.
Definition: geometry_container.h:303
TGeometryType & GetGeometry(std::string GeometryName)
Returns a reference geometry corresponding to the name.
Definition: geometry_container.h:191
const GeometryPointerType pGetGeometry(IndexType GeometryId) const
Returns the const Geometry::Pointer corresponding to its Id.
Definition: geometry_container.h:150
GeometryPointerType pGetGeometry(std::string GeometryName)
Returns the Geometry::Pointer corresponding to its name.
Definition: geometry_container.h:159
bool HasGeometry(std::string GeometryName) const
Definition: geometry_container.h:229
const TGeometryType & GetGeometry(std::string GeometryName) const
Returns a const reference geometry corresponding to the name.
Definition: geometry_container.h:197
GeometryIterator GeometriesEnd()
Definition: geometry_container.h:250
std::size_t SizeType
Definition: geometry_container.h:50
PointerHashMapSet< TGeometryType, std::hash< std::size_t >, GetGeometryId, GeometryPointerType > GeometriesMapType
Geometry Hash Map Container.
Definition: geometry_container.h:62
TGeometryType & GetGeometry(IndexType GeometryId)
Returns a reference geometry corresponding to the id.
Definition: geometry_container.h:179
const GeometriesMapType & Geometries() const
Definition: geometry_container.h:269
GeometriesMapType::const_iterator GeometryConstantIterator
Const Geometry Iterator.
Definition: geometry_container.h:68
GeometriesMapType & Geometries()
Definition: geometry_container.h:264
GeometryContainer(GeometryContainer const &rOther)
Copy Constructor.
Definition: geometry_container.h:80
virtual void PrintInfo(std::ostream &rOStream, std::string const &PrefixString) const
Print information about this object.
Definition: geometry_container.h:297
GeometriesMapType::iterator GeometryIterator
Geometry Iterator.
Definition: geometry_container.h:65
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: geometry_container.h:291
GeometryIterator AddGeometry(GeometryPointerType pNewGeometry)
Adds a geometry to the geometry container.
Definition: geometry_container.h:124
KRATOS_CLASS_POINTER_DEFINITION(GeometryContainer)
Pointer definition of GeometryContainer.
GeometryConstantIterator GeometriesEnd() const
Definition: geometry_container.h:255
bool HasGeometry(IndexType GeometryId) const
Definition: geometry_container.h:224
void RemoveGeometry(IndexType GeometryId)
Remove the geometry with given Id from geometry container.
Definition: geometry_container.h:207
GeometryPointerType pGetGeometry(IndexType GeometryId)
Returns the Geometry::Pointer corresponding to its Id.
Definition: geometry_container.h:141
TGeometryType::Pointer GeometryPointerType
Definition: geometry_container.h:52
GeometryConstantIterator GeometriesBegin() const
Definition: geometry_container.h:245
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: geometry_container.h:285
GeometryContainer()
Default Constructor.
Definition: geometry_container.h:75
GeometryContainer Clone()
Definition: geometry_container.h:97
const GeometryPointerType pGetGeometry(std::string GeometryName) const
Returns the Geometry::Pointer corresponding to its name.
Definition: geometry_container.h:169
void RemoveGeometry(std::string GeometryName)
Remove the geometry with given name from geometry container.
Definition: geometry_container.h:213
~GeometryContainer()=default
Destructor.
std::string Info() const
Return information.
Definition: geometry_container.h:279
std::size_t IndexType
Definition: geometry_container.h:49
SizeType NumberOfGeometries() const
Return number of geometries stored inside this geometry container.
Definition: geometry_container.h:114
PointerHashMapSet is a hash implemenetation of the PointerVectorSet.
Definition: pointer_hash_map_set.h:70
void clear()
Definition: pointer_hash_map_set.h:335
iterator end()
Definition: pointer_hash_map_set.h:228
iterator_adaptor iterator
Definition: pointer_hash_map_set.h:153
iterator begin()
Definition: pointer_hash_map_set.h:220
iterator find(const key_type &Key)
Definition: pointer_hash_map_set.h:340
const_iterator_adaptor const_iterator
Definition: pointer_hash_map_set.h:154
iterator insert(const TOtherDataType &rData)
Definition: pointer_hash_map_set.h:295
size_type size() const
Definition: pointer_hash_map_set.h:274
iterator erase(iterator pos)
Definition: pointer_hash_map_set.h:320
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
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
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
integer i
Definition: TensorModule.f:17