Salome HOME
[EDF26877] : management of computation of measure field on field on Gauss Point in...
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingFieldDiscretizationOnNodesFE.hxx
1 // Copyright (C) 2022  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (EDF R&D)
20
21 #pragma once
22
23 #include "MEDCouplingFieldDiscretization.hxx"
24
25 #include <functional>
26
27 namespace MEDCoupling
28 {
29   /*!
30    * Class in charge to implement FE functions with shape functions
31    */
32   class MEDCouplingFieldDiscretizationOnNodesFE : public MEDCouplingFieldDiscretizationOnNodes
33   {
34     public:
35       MEDCOUPLING_EXPORT TypeOfField getEnum() const override { return TYPE; }
36       MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDiscretizationOnNodesFE"); }
37       MEDCOUPLING_EXPORT const char *getRepr() const override { return REPR; }
38       MEDCOUPLING_EXPORT std::string getStringRepr() const override;
39       MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const override;
40       MEDCOUPLING_EXPORT MCAuto<MEDCouplingFieldDiscretization> aggregate(std::vector<const MEDCouplingFieldDiscretization *>& fds) const override;
41       MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const override;
42       MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization *clone() const override;
43       MEDCOUPLING_EXPORT void checkCompatibilityWithNature(NatureOfField nat) const override;
44       MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const override;
45       MEDCOUPLING_EXPORT void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const override;
46       MEDCOUPLING_EXPORT DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, mcIdType nbOfPoints) const override;
47     public:
48       MEDCOUPLING_EXPORT MCAuto<DataArrayDouble> getCooInRefElement(const MEDCouplingMesh *mesh, const double *loc, mcIdType nbOfPoints) const;
49     public:
50       MEDCOUPLING_EXPORT static void GetRefCoordOfListOf3DPtsIn3D(const MEDCouplingUMesh *umesh, const double *ptsCoo, mcIdType nbOfPts,
51   std::function<void(const MEDCouplingGaussLocalization&, const std::vector<mcIdType>&)> customFunc);
52     private:
53       const MEDCouplingUMesh *checkConfig3D(const MEDCouplingMesh *mesh) const;
54     public:
55       static const char REPR[];
56       static constexpr TypeOfField TYPE = ON_NODES_FE;
57   };
58 }