Salome HOME
1f7eb8a6894dfb23c93a033a517cd25f039a47a6
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedLocalization.h
1 // Copyright (C) 2010-2011  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.
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
20 #ifndef __vtkMedLocalization_h_
21 #define __vtkMedLocalization_h_
22
23 #include "vtkObject.h"
24 #include "vtkMed.h"
25 #include "vtkSmartPointer.h"
26
27 class vtkMedString;
28 class vtkMedFile;
29 class vtkDoubleArray;
30 class vtkMedInterpolation;
31
32 class VTK_EXPORT vtkMedLocalization : public vtkObject
33 {
34 public:
35   static vtkMedLocalization* New();
36   vtkTypeMacro(vtkMedLocalization, vtkObject);
37   void PrintSelf(ostream& os, vtkIndent indent);
38
39   // Description:
40   // This is the name of this definition
41   vtkSetStringMacro(Name);
42   vtkGetStringMacro(Name);
43
44   // Description:
45   // This is the name of this definition
46   vtkSetStringMacro(SectionName);
47   vtkGetStringMacro(SectionName);
48
49   // Description:
50   // This is the name of this definition
51   vtkSetStringMacro(InterpolationName);
52   vtkGetStringMacro(InterpolationName);
53
54   // Description:
55   // This is the type of cell geometry this definition is for.
56   vtkSetMacro(GeometryType, med_geometry_type);
57   vtkGetMacro(GeometryType, med_geometry_type);
58
59   // Description:
60   // This is the number of quadrature points in this definition.
61   vtkSetMacro(NumberOfQuadraturePoint, int);
62   vtkGetMacro(NumberOfQuadraturePoint, int);
63
64   // Description:
65   // The index of this field in the med file
66   vtkSetMacro(MedIterator, med_int);
67   vtkGetMacro(MedIterator, med_int);
68
69   // Description:
70   // The dimension of the space in which integration points are defined.
71   vtkSetMacro(SpaceDimension, med_int);
72   vtkGetMacro(SpaceDimension, med_int);
73
74   // Description:
75   // The number of cell in a section for structural elements
76   vtkGetMacro(NumberOfCellInSection, med_int);
77   vtkSetMacro(NumberOfCellInSection, med_int);
78
79   // Description:
80   // Type of cells that define the section, for structural elements.
81   vtkSetMacro(SectionGeometryType, med_geometry_type);
82   vtkGetMacro(SectionGeometryType, med_geometry_type);
83
84   // Description:
85   // get the raw pointers to the internal arrays.
86   // Those arrays are allocated in SecureResources,
87   // and cleared in ClearResources
88   vtkGetObjectMacro(Weights, vtkDoubleArray);
89   vtkGetObjectMacro(PointLocalCoordinates, vtkDoubleArray);
90   vtkGetObjectMacro(QuadraturePointLocalCoordinates, vtkDoubleArray);
91   vtkGetObjectMacro(ShapeFunction, vtkDoubleArray);
92
93   virtual int GetSizeOfWeights();
94   virtual int GetSizeOfPointLocalCoordinates();
95   virtual int GetSizeOfQuadraturePointLocalCoordinates();
96   virtual int GetSizeOfShapeFunction();
97
98   virtual void BuildShapeFunction();
99   virtual void  BuildELNO(med_geometry_type geometry);
100   virtual void  BuildCenter(med_geometry_type geometry);
101
102   virtual void  SetParentFile(vtkMedFile*);
103   vtkGetObjectMacro(ParentFile, vtkMedFile);
104
105   // Description:
106   // The interpolation is the function that define how the interpolate
107   // value at integration points from values at reference points (usually nodes)
108   virtual void  SetInterpolation(vtkMedInterpolation*);
109   vtkGetObjectMacro(Interpolation, vtkMedInterpolation);
110
111 protected:
112   vtkMedLocalization();
113   virtual ~vtkMedLocalization();
114
115   med_int MedIterator;
116   med_geometry_type GeometryType;
117   int NumberOfQuadraturePoint;
118   med_int SpaceDimension;
119   med_int NumberOfCellInSection;
120   med_geometry_type SectionGeometryType;
121
122   vtkDoubleArray* Weights;
123   vtkDoubleArray* PointLocalCoordinates;
124   vtkDoubleArray* QuadraturePointLocalCoordinates;
125   vtkDoubleArray* ShapeFunction;
126
127   char* Name;
128   char* SectionName;
129   char* InterpolationName;
130
131   vtkMedFile* ParentFile;
132
133   vtkMedInterpolation* Interpolation;
134
135   int ShapeFunctionIsBuilt;
136
137   virtual void  BuildAsterShapeFunction(int dim,
138                                    int nnodes,
139                                    const int* med2aster,
140                                    const char** varnames,
141                                    const char** functions);
142
143   virtual void BuildPoint1();
144
145   virtual void  BuildShapeFunctionFromInterpolation();
146
147 private:
148   vtkMedLocalization(const vtkMedLocalization&);
149      // Not implemented.
150   void operator=(const vtkMedLocalization&);
151      // Not implemented.
152 };
153
154 #endif //__vtkMedQuadratureDefinition_h_