30 #ifndef ModelComponentContainer_H 31 #define ModelComponentContainer_H 33 #include "preprocessor/multi_block_topology/ModelComponentContainerBase.h" 35 #include "boost/python/list.hpp" 47 int receiveObjects(
const size_t &sz,
const Communicator &);
52 typedef typename std::map<Indice,T *> map_base;
53 typedef typename std::pair<Indice,T *> pair;
54 typedef typename map_base::iterator iterator;
55 typedef typename map_base::const_iterator const_iterator;
60 T *
busca(
const Indice &);
61 const T *
busca(
const Indice &)
const;
62 bool exists(
const Indice &)
const;
63 T *
get(
const Indice &);
64 boost::python::list
getKeys(
void)
const;
81 iterator i= this->find(
id);
91 const T * retval=
nullptr;
92 const_iterator i= this->find(
id);
101 {
return (busca(
id)!=
nullptr); }
108 T *retval= busca(iEnt);
110 std::cerr << getClassName() <<
"::" << __FUNCTION__
112 << iEnt <<
"' not found.\n";
120 for(iterator i=this->begin();i!=this->end();i++)
122 T * tmp= (*i).second;
134 boost::python::list retval;
135 for(const_iterator i=this->begin();i!=this->end();i++)
136 retval.append((*i).first);
149 const int size= this->size();
153 for(const_iterator i=this->begin();i!=this->end();i++)
163 std::cerr << getClassName() <<
"::" << __FUNCTION__
164 <<
"; object failed in sendSelf.\n";
169 std::cerr << getClassName() <<
"::" << __FUNCTION__
170 <<
"; the object is not movable." << std::endl;
199 int res= ModelComponentContainerBase::sendData(comm);
200 const size_t sz= this->size();
203 { res+= sendObjects(comm); }
211 int res= ModelComponentContainerBase::recvData(comm);
215 { res+= receiveObjects(sz, comm); }
virtual ~ModelComponentContainer(void)
Destructor.
Definition: ModelComponentContainer.h:142
Communication parameters between processes.
Definition: Communicator.h:66
void setDbTag(int dbTag)
Sets the object identifier in the database.
Definition: MovableObject.cpp:111
Object that can move between processes.
Definition: MovableObject.h:100
Model geometry manager.
Definition: MultiBlockTopology.h:68
size_t sendSzt(const size_t &, DbTagData &, const CommMetaData &)
Sends entero through the communicator argument.
Definition: Communicator.cc:1014
virtual int sendSelf(Communicator &comm)=0
Send the object.
boost::python::list getKeys(void) const
Return the container's keys.
Definition: ModelComponentContainer.h:132
void clearAll(void)
Erase all the entities.
Definition: ModelComponentContainer.h:118
Base class for model component containers.
Definition: ModelComponentContainerBase.h:44
bool exists(const Indice &) const
Return true if the entity already exists.
Definition: ModelComponentContainer.h:100
size_t receiveSzt(size_t &, DbTagData &, const CommMetaData &) const
Receives the integers through the communicator argument.
Definition: Communicator.cc:1070
ModelComponentContainer(MultiBlockTopology *mbt=nullptr)
Constructor.
Definition: ModelComponentContainer.h:72
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual int recvData(const Communicator &)
Receive data through the communicator argument.
Definition: ModelComponentContainer.h:209
Container for model entities.
Definition: ModelComponentContainer.h:43
virtual int sendData(Communicator &)
Send members through the communicator argument.
Definition: ModelComponentContainer.h:197
T * busca(const Indice &)
Return a pointer to the geometry entity whose identifier is passed as parameter.
Definition: ModelComponentContainer.h:78