1 // Project MULTIPR, IOLS WP1.2.1 - EDF/CS
2 // Partitioning/decimation module for the SALOME v3.2 platform
5 * \file MULTIPR_GaussLoc.hxx
7 * \brief Class GaussLoc. Allow to locate all the Gauss points in an element of reference (e.g. a TETRA10).
9 * \author Olivier LE ROUX - CS, Virtual Reality Dpt
14 #ifndef MULTIPR_GAUSSLOC_HXX
15 #define MULTIPR_GAUSSLOC_HXX
17 //*****************************************************************************
19 //*****************************************************************************
33 //*****************************************************************************
35 //*****************************************************************************
42 * Builds an empty Gauss reference (default constructor).
47 * Copy constructor (deep copy).
48 * \param pGaussLoc the GaussLoc to copy.
50 GaussLoc(const GaussLoc& pGaussLoc);
53 * Destructor. Removes everything.
58 * Resets this object in its state by default (empty). Cleans memory.
62 //---------------------------------------------------------------------
63 // Basic accessors/mutators
64 //--------------------------------------------------------------------
67 * Returns the name of this GaussLoc.
68 * \return the name of this GaussLoc.
70 std::string getName() const { return mName; }
73 * Returns dimension of Gauss points which is also the dimension of reference nodes.
74 * \return dimension of Gauss points.
76 int getDim() const { return mDim; }
79 * Returns number of Gauss points.
80 * \return number of Gauss points.
82 int getNumGaussPoints() const { return mNumGauss; }
84 //---------------------------------------------------------------------
86 //--------------------------------------------------------------------
89 * Returns the coordinates of all the Gauss points for a given element.
90 * \param pCooElt (in) coordinates of nodes of an element.
91 * \param pCoo (out) coordinates of all the Gauss points (interlaced); memory must have been allocated.
93 void getCoordGaussPoints(const med_float* pCooElt, med_float* pCooGaussPoints) const;
95 //---------------------------------------------------------------------
97 //---------------------------------------------------------------------
100 * Reads a GaussLoc object from a MED file.
101 * \param pMEDfile any valid MED file opened for reading.
102 * \param pIndex index of the gauss localization to be read; must be >= 1.
103 * \throw IOException if any i/o error occurs.
105 void readMED(med_idt pMEDfile, med_int pIndex);
108 * Writes this GaussLoc object to the given MED file.
109 * \param pMEDfile any valid MED file opened for writing.
110 * \throw IOException if any i/o error occurs.
112 void writeMED(med_idt pMEDfile);
115 * Dumps any GaussLoc to the given output stream.
116 * \param pOs any output stream.
117 * \param pF any Field.
118 * \return the output stream pOs.
120 friend std::ostream& operator<<(std::ostream& pOs, GaussLoc& pG);
124 char mName[MED_TAILLE_NOM + 1]; /**< Name of the Gauss info. */
125 med_geometrie_element mGeom; /**< Type of elements, e.g. TETRA10 (code is 310). */
126 int mDim; /**< Dimension of nodes, e.g. 3 for a TETRA10. */
127 int mNumNodes; /**< Number of nodes in the reference element, e.g. 10 for a TETRA10. */
128 med_int mNumGauss; /**< Number of Gauss points. */
129 med_float* mRefCoo; /**< Table of coordinates of nodes.
130 Example: for a TETRA10: 10 nodes, 3 components => 30 med_float. */
131 med_float* mGaussCoo; /**< Table of coordinates of Gauss points. */
132 med_float* mWeight; /**< Table of weights of Gauss points. */
137 GaussLoc& operator=(const GaussLoc&);
139 // do not allow operator ==
140 bool operator==(const GaussLoc&);
145 } // namespace MULTIPR
148 #endif // MULTIPR_GAUSSLOC_HXX