#ifndef __XMLIO_CGrid__ #define __XMLIO_CGrid__ /// xmlioserver headers /// #include "xmlioserver_spl.hpp" #include "group_factory.hpp" #include "declare_group.hpp" #include "domain.hpp" #include "axis.hpp" namespace xmlioserver { namespace tree { /// ////////////////////// Déclarations ////////////////////// /// class CGridGroup; class CGridAttributes; class CGrid; ///-------------------------------------------------------------- // Declare/Define CGridAttribute BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid) # include "grid_attribute.conf" END_DECLARE_ATTRIBUTE_MAP(CGrid) ///-------------------------------------------------------------- class CGrid : public CObjectTemplate , public CGridAttributes { /// typedef /// typedef CObjectTemplate SuperClass; typedef CGridAttributes SuperClassAttribute; public : typedef CGridAttributes RelAttributes; typedef CGridGroup RelGroup; /// Constructeurs /// CGrid(void); explicit CGrid(const StdString & id); CGrid(const CGrid & grid); // Not implemented yet. CGrid(const CGrid * const grid); // Not implemented yet. /// Traitements /// void solveReference(void); virtual void toBinary (StdOStream & os) const; virtual void fromBinary(StdIStream & is); /// Tests /// bool hasAxis(void) const; public : /// Accesseurs /// const std::deque & getStoreIndex(void) const; const std::deque & getOutIIndex(void) const; const std::deque & getOutJIndex(void) const; const std::deque & getOutLIndex(void) const; const boost::shared_ptr getRelAxis (void) const; const boost::shared_ptr getRelDomain(void) const; StdSize getDimension(void) const; StdSize getLocalSize(void) const; StdSize getGlobalSize(void) const; std::vector getLocalShape(void) const; std::vector getGlobalShape(void) const; /// Entrées-sorties de champs /// template void inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const; void inputFieldServer(const std::deque storedClient, ARRAY(double, 1) storedServer) const; template void outputField(const ARRAY(double, 1) stored, ARRAY(double, n) field) const; /// Destructeur /// virtual ~CGrid(void); public : /// Accesseurs statiques /// static StdString GetName(void); static StdString GetDefName(void); static ENodeType GetType(void); /// Instanciateurs Statiques /// static boost::shared_ptr CreateGrid(boost::shared_ptr domain); static boost::shared_ptr CreateGrid(boost::shared_ptr domain, boost::shared_ptr axis); protected : /// Entrées-sorties de champs (interne) /// void storeField_arr(const double * const data, ARRAY(double, 1) stored) const; /// Traitements protégés /// void computeIndexServer(void); void computeIndex(void); void solveDomainRef(void); void solveAxisRef(void); public: /// Propriétés privées /// bool withAxis ; bool isChecked; boost::shared_ptr axis ; boost::shared_ptr domain ; std::deque storeIndex ; std::deque out_i_index ; std::deque out_j_index ; std::deque out_l_index ; }; // class CGrid ///-------------------------------------------------------------- template void CGrid::inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const { if (this->getGlobalSize() != field->num_elements()) ERROR("CGrid::inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored)", << "[ Taille des données attendue = " << this->getGlobalSize() << ", " << "Taille des données reçue = " << field->num_elements() << " ] " << "Le tableau de données n'a pas la bonne taille !") ; this->storeField_arr(field->data(), stored) ; } ///-------------------------------------------------------------- // Declare/Define CGridGroup and CGridDefinition DECLARE_GROUP(CGrid); ///-------------------------------------------------------------- } // namespace tree } // namespace xmlioserver #endif // __XMLIO_CGrid__