Back to index

salome-paravis  6.5.0
vtkMedLocalization.h
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __vtkMedLocalization_h_
00021 #define __vtkMedLocalization_h_
00022 
00023 #include "vtkObject.h"
00024 #include "vtkMed.h"
00025 #include "vtkSmartPointer.h"
00026 
00027 class vtkMedString;
00028 class vtkMedFile;
00029 class vtkDoubleArray;
00030 class vtkMedInterpolation;
00031 
00032 class VTK_EXPORT vtkMedLocalization : public vtkObject
00033 {
00034 public:
00035   static vtkMedLocalization* New();
00036   vtkTypeRevisionMacro(vtkMedLocalization, vtkObject);
00037   void PrintSelf(ostream& os, vtkIndent indent);
00038 
00039   // Description:
00040   // This is the name of this definition
00041   vtkSetStringMacro(Name);
00042   vtkGetStringMacro(Name);
00043 
00044   // Description:
00045   // This is the name of this definition
00046   vtkSetStringMacro(SectionName);
00047   vtkGetStringMacro(SectionName);
00048 
00049   // Description:
00050   // This is the name of this definition
00051   vtkSetStringMacro(InterpolationName);
00052   vtkGetStringMacro(InterpolationName);
00053 
00054   // Description:
00055   // This is the type of cell geometry this definition is for.
00056   vtkSetMacro(GeometryType, med_geometry_type);
00057   vtkGetMacro(GeometryType, med_geometry_type);
00058 
00059   // Description:
00060   // This is the number of quadrature points in this definition.
00061   vtkSetMacro(NumberOfQuadraturePoint, int);
00062   vtkGetMacro(NumberOfQuadraturePoint, int);
00063 
00064   // Description:
00065   // The index of this field in the med file
00066   vtkSetMacro(MedIterator, med_int);
00067   vtkGetMacro(MedIterator, med_int);
00068 
00069   // Description:
00070   // The dimension of the space in which integration points are defined.
00071   vtkSetMacro(SpaceDimension, med_int);
00072   vtkGetMacro(SpaceDimension, med_int);
00073 
00074   // Description:
00075   // The number of cell in a section for structural elements
00076   vtkGetMacro(NumberOfCellInSection, med_int);
00077   vtkSetMacro(NumberOfCellInSection, med_int);
00078 
00079   // Description:
00080   // Type of cells that define the section, for structural elements.
00081   vtkSetMacro(SectionGeometryType, med_geometry_type);
00082   vtkGetMacro(SectionGeometryType, med_geometry_type);
00083 
00084   // Description:
00085   // get the raw pointers to the internal arrays.
00086   // Those arrays are allocated in SecureResources,
00087   // and cleared in ClearResources
00088   vtkGetObjectMacro(Weights, vtkDoubleArray);
00089   vtkGetObjectMacro(PointLocalCoordinates, vtkDoubleArray);
00090   vtkGetObjectMacro(QuadraturePointLocalCoordinates, vtkDoubleArray);
00091   vtkGetObjectMacro(ShapeFunction, vtkDoubleArray);
00092 
00093   virtual int GetSizeOfWeights();
00094   virtual int GetSizeOfPointLocalCoordinates();
00095   virtual int GetSizeOfQuadraturePointLocalCoordinates();
00096   virtual int GetSizeOfShapeFunction();
00097 
00098   virtual void BuildShapeFunction();
00099   virtual void  BuildELNO(med_geometry_type geometry);
00100   virtual void  BuildCenter(med_geometry_type geometry);
00101 
00102   virtual void  SetParentFile(vtkMedFile*);
00103   vtkGetObjectMacro(ParentFile, vtkMedFile);
00104 
00105   // Description:
00106   // The interpolation is the function that define how the interpolate
00107   // value at integration points from values at reference points (usually nodes)
00108   virtual void  SetInterpolation(vtkMedInterpolation*);
00109   vtkGetObjectMacro(Interpolation, vtkMedInterpolation);
00110 
00111 protected:
00112   vtkMedLocalization();
00113   virtual ~vtkMedLocalization();
00114 
00115   med_int MedIterator;
00116   med_geometry_type GeometryType;
00117   int NumberOfQuadraturePoint;
00118   med_int SpaceDimension;
00119   med_int NumberOfCellInSection;
00120   med_geometry_type SectionGeometryType;
00121 
00122   vtkDoubleArray* Weights;
00123   vtkDoubleArray* PointLocalCoordinates;
00124   vtkDoubleArray* QuadraturePointLocalCoordinates;
00125   vtkDoubleArray* ShapeFunction;
00126 
00127   char* Name;
00128   char* SectionName;
00129   char* InterpolationName;
00130 
00131   vtkMedFile* ParentFile;
00132 
00133   vtkMedInterpolation* Interpolation;
00134 
00135   int ShapeFunctionIsBuilt;
00136 
00137   virtual void  BuildAsterShapeFunction(int dim,
00138                                    int nnodes,
00139                                    const int* med2aster,
00140                                    const char** varnames,
00141                                    const char** functions);
00142 
00143   virtual void BuildPoint1();
00144 
00145   virtual void  BuildShapeFunctionFromInterpolation();
00146 
00147 private:
00148   vtkMedLocalization(const vtkMedLocalization&);
00149      // Not implemented.
00150   void operator=(const vtkMedLocalization&);
00151      // Not implemented.
00152 };
00153 
00154 #endif //__vtkMedQuadratureDefinition_h_