v0.9.0
CoordSystemsManager.hpp
Go to the documentation of this file.
1 /** \file CoordSystemsManager.hpp
2  * \brief Interface managing coordinate systems set to fields
3  *
4  * Managing coordinate systems. Each field have attached coordinate system, this
5  * allow to pass information about base between independent module
6  * implementations.
7  *
8  */
9 
10 /*
11  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
18  */
19 
20 #ifndef __COORDSTEMSMANAGER_HPP__
21 #define __COORDSTEMSMANAGER_HPP__
22 
23 #include "UnknownInterface.hpp"
24 
25 namespace MoFEM {
26 
29 
30 struct Core;
31 
33 
35  UnknownInterface **iface) const;
36 
38  CoordSystemsManager(const MoFEM::Core &core);
39 
40  /**
41  * \brief Destructor
42  */
44 
45  /**
46  * \brief get tags handlers used on meshsets conating information about
47  coordinate systems
48 
49  */
50  MoFEMErrorCode getTags(int verb = -1);
51 
52  /**
53  * \brief clear multi-index container
54  * @return error code
55  */
57 
58  /**
59  * \brier initialize container form data on mesh
60  * @return error code
61  */
63 
65  return coordinateSystems;
66  }
67 
68  /** \brief Add coordinate system
69 
70  * \param cs_id see \ref CoordSystems for options
71  * \param name unique name of coordinate system
72  */
73  MoFEMErrorCode addCoordinateSystem(const int cs_dim[], const std::string name,
74  const enum MoFEMTypes bh = MF_EXCL);
75 
76  /** \brief Set coordinate system to field
77 
78  * \param name of field
79  * \param name unique name of coordinate system
80  *
81  */
82  MoFEMErrorCode setFieldCoordinateSystem(const std::string field_name,
83  const std::string cs_name);
84 
85  /**
86  * @brief Get the Coord Sys Ptr object
87  *
88  * @param id
89  * @param cs_ptr
90  * @return MoFEMErrorCode
91  */
93  boost::shared_ptr<CoordSys> &cs_ptr);
94 
95  /**
96  * @brief Get the Coord Sys Ptr object
97  *
98  * @param name
99  * @param cs_ptr
100  * @return MoFEMErrorCode
101  */
102  MoFEMErrorCode getCoordSysPtr(const string name,
103  boost::shared_ptr<CoordSys> &cs_ptr);
104 
105  /**
106  * @brief Get the Coord Sys Ptr object
107  *
108  * @param name
109  * @return boost::shared_ptr<CoordSys>
110  */
111  boost::shared_ptr<CoordSys> getCoordSysPtr(const string name);
112 
113  inline Tag get_th_CoordSysName() const { return th_CoordSysName; }
114 
115 protected:
116  Tag th_CoordSysName; ///< Name of coordinate system
117  Tag th_CoordSysDim; ///< Tag on cordinate sys meshset for dimension of
118  ///< coordinate system associated to fields
119 
120  /// Coordinate systems multi-index
122 };
123 
124 } // namespace MoFEM
125 
126 #endif //__COORDYSTEMSINTERFACE_HPP__
MoFEMErrorCode setFieldCoordinateSystem(const std::string field_name, const std::string cs_name)
Set coordinate system to field.
MoFEM interface unique ID.
base class for all interface classes
Core (interface) class.
Definition: Core.hpp:50
MoFEM interface.
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
multi_index_container< boost::shared_ptr< CoordSys >, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< CoordSys, EntityHandle, &CoordSys::meshSet > >, ordered_unique< tag< CoordSysName_mi_tag >, const_mem_fun< CoordSys, boost::string_ref, &CoordSys::getNameRef > > > > CoordSys_multiIndex
MoFEMErrorCode getCoordSysPtr(const EntityHandle id, boost::shared_ptr< CoordSys > &cs_ptr)
Get the Coord Sys Ptr object.
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, UnknownInterface **iface) const
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets conating information about coordinate systems
CoordSys_multiIndex coordinateSystems
Coordinate systems multi-index.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
MoFEMErrorCode addCoordinateSystem(const int cs_dim[], const std::string name, const enum MoFEMTypes bh=MF_EXCL)
Add coordinate system.
CoordSys_multiIndex & getCoordinateSystemsMultindex()
static const MOFEMuuid IDD_MOFEMCoordsSystemsManager
Tag th_CoordSysName
Name of coordinate system.
MoFEMErrorCode clearMap()
clear multi-index container
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
CoordSystemsManager(const MoFEM::Core &core)
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:183