1 // Copyright (C) 2010-2012 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __vtkMedLocalization_h_
21 #define __vtkMedLocalization_h_
23 #include "vtkObject.h"
25 #include "vtkSmartPointer.h"
30 class vtkMedInterpolation;
32 class VTK_EXPORT vtkMedLocalization : public vtkObject
35 static vtkMedLocalization* New();
36 vtkTypeRevisionMacro(vtkMedLocalization, vtkObject);
37 void PrintSelf(ostream& os, vtkIndent indent);
40 // This is the name of this definition
41 vtkSetStringMacro(Name);
42 vtkGetStringMacro(Name);
45 // This is the name of this definition
46 vtkSetStringMacro(SectionName);
47 vtkGetStringMacro(SectionName);
50 // This is the name of this definition
51 vtkSetStringMacro(InterpolationName);
52 vtkGetStringMacro(InterpolationName);
55 // This is the type of cell geometry this definition is for.
56 vtkSetMacro(GeometryType, med_geometry_type);
57 vtkGetMacro(GeometryType, med_geometry_type);
60 // This is the number of quadrature points in this definition.
61 vtkSetMacro(NumberOfQuadraturePoint, int);
62 vtkGetMacro(NumberOfQuadraturePoint, int);
65 // The index of this field in the med file
66 vtkSetMacro(MedIterator, med_int);
67 vtkGetMacro(MedIterator, med_int);
70 // The dimension of the space in which integration points are defined.
71 vtkSetMacro(SpaceDimension, med_int);
72 vtkGetMacro(SpaceDimension, med_int);
75 // The number of cell in a section for structural elements
76 vtkGetMacro(NumberOfCellInSection, med_int);
77 vtkSetMacro(NumberOfCellInSection, med_int);
80 // Type of cells that define the section, for structural elements.
81 vtkSetMacro(SectionGeometryType, med_geometry_type);
82 vtkGetMacro(SectionGeometryType, med_geometry_type);
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);
93 virtual int GetSizeOfWeights();
94 virtual int GetSizeOfPointLocalCoordinates();
95 virtual int GetSizeOfQuadraturePointLocalCoordinates();
96 virtual int GetSizeOfShapeFunction();
98 virtual void BuildShapeFunction();
99 virtual void BuildELNO(med_geometry_type geometry);
100 virtual void BuildCenter(med_geometry_type geometry);
102 virtual void SetParentFile(vtkMedFile*);
103 vtkGetObjectMacro(ParentFile, vtkMedFile);
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);
112 vtkMedLocalization();
113 virtual ~vtkMedLocalization();
116 med_geometry_type GeometryType;
117 int NumberOfQuadraturePoint;
118 med_int SpaceDimension;
119 med_int NumberOfCellInSection;
120 med_geometry_type SectionGeometryType;
122 vtkDoubleArray* Weights;
123 vtkDoubleArray* PointLocalCoordinates;
124 vtkDoubleArray* QuadraturePointLocalCoordinates;
125 vtkDoubleArray* ShapeFunction;
129 char* InterpolationName;
131 vtkMedFile* ParentFile;
133 vtkMedInterpolation* Interpolation;
135 int ShapeFunctionIsBuilt;
137 virtual void BuildAsterShapeFunction(int dim,
139 const int* med2aster,
140 const char** varnames,
141 const char** functions);
143 virtual void BuildPoint1();
145 virtual void BuildShapeFunctionFromInterpolation();
148 vtkMedLocalization(const vtkMedLocalization&);
150 void operator=(const vtkMedLocalization&);
154 #endif //__vtkMedQuadratureDefinition_h_