Back to index

salome-med  6.5.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
MEDMEM::FIELDINTClient Class Reference

#include <FIELDINTClient.hxx>

Inheritance diagram for MEDMEM::FIELDINTClient:
Inheritance graph
[legend]
Collaboration diagram for MEDMEM::FIELDINTClient:
Collaboration graph
[legend]

List of all members.

Public Types

typedef void(* myFuncType )(const double *, T *)
typedef void(* myFuncType2 )(const T *, T *)

Public Member Functions

 FIELDINTClient (SALOME_MED::FIELDINT_ptr ptrCorba, MEDMEM::SUPPORT *S=NULL)
 Constructor with arguments.
 ~FIELDINTClient ()
 Destructor.
FIELDoperator+ (const FIELD &m) const
 Overload addition operator.
FIELDoperator- (const FIELD &m) const
 Overload substraction operator.
FIELDoperator- () const
FIELDoperator* (const FIELD &m) const
 Overload multiplication operator.
FIELDoperator/ (const FIELD &m) const
 Overload division operator.
FIELDoperator+= (const FIELD &m)
 Overloaded Operator += Operations are directly performed in the first field's array.
FIELDoperator-= (const FIELD &m)
 Overloaded Operator -= Operations are directly performed in the first field's array.
FIELDoperator*= (const FIELD &m)
 Overloaded Operator *= Operations are directly performed in the first field's array.
FIELDoperator/= (const FIELD &m)
 Overloaded Operator /= Operations are directly performed in the first field's array.
void applyLin (T a, T b, int icomp)
 Apply to a given field component the linear function x -> ax+b.
void applyLin (T a, T b)
 Apply to each (scalar) field component the linear function x -> ax+b.
double normMax () const throw (MEDEXCEPTION)
 Return maximum of all absolute values contained in the array (all elements and all components are browsed).
void getMinMax (T &vmin, T &vmax) throw (MEDEXCEPTION)
 Return Extrema of field.
vector< int > getHistogram (int &nbint) throw (MEDEXCEPTION)
 Return Histogram of field.
FIELD< double > * buildGradient () const throw (MEDEXCEPTION)
 Return vectorial gradient field.
FIELD< double > * buildNorm2Field () const throw (MEDEXCEPTION)
 Return scalar norm2 field.
double norm2 () const throw (MEDEXCEPTION)
 Return Euclidian norm for all elements of the array.
template<T T_function>
void applyFunc ()
 Apply to each (scalar) field component the template parameter T_function, which is a pointer to function.
void applyPow (T scalar)
 Apply to each (scalar) field component the math function pow.
double normL2 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
 Return L2 Norm of the field's component.
double normL2 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
 Return L2 Norm of the field.
double normL1 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
 Return L1 Norm of the field's component.
double normL1 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
 Return L1 Norm of the field.
double integral (const SUPPORT *subSupport=NULL) const throw (MEDEXCEPTION)
 Return integral of the field.
FIELDextract (const SUPPORT *subSupport) const throw (MEDEXCEPTION)
 Return a new field (to deallocate with delete) lying on subSupport that is included by this->_support with corresponding values extracting from this->_value.
void init ()
 
     

void rmDriver (int index=0)
 Remove the driver referenced by its index.
int addDriver (driverTypes driverType, const string &fileName="Default File Name.med", const string &driverFieldName="Default Field Name", MED_EN::med_mode_acces access=MED_EN::RDWR)
 Creates the specified driver and return its index reference to path to read or write methods.
int addDriver (GENDRIVER &driver)
 Duplicates the given driver and return its index reference to path to read or write methods.
void allocValue (const int NumberOfComponents)
void allocValue (const int NumberOfComponents, const int LengthValue)
void deallocValue ()
void read (int index=0)
 Read FIELD in the file specified in the driver given by its index.
void read (const GENDRIVER &genDriver)
 Read FIELD with the driver.
void read (driverTypes driverType, const std::string &filename)
 Read FIELD with driver of the given type.
void write (int index=0)
 Writes FIELD in the file specified by the driver handle index.
void write (const GENDRIVER &, MED_EN::med_mode_acces medMode=MED_EN::RDWR)
 Write FIELD with the given driver.
void write (driverTypes driverType, const std::string &filename, MED_EN::med_mode_acces medMode=MED_EN::RDWR)
 Write FIELD with driver of the given type.
void writeAppend (int index=0, const string &driverName="")
 Write FIELD in the file specified in the driver given by its index.
void writeAppend (const GENDRIVER &)
MEDMEM_Array_ * getArray () const throw (MEDEXCEPTION)
ArrayGaussgetArrayGauss () const throw (MEDEXCEPTION)
ArrayNoGaussgetArrayNoGauss () const throw (MEDEXCEPTION)
bool getGaussPresence () const throw (MEDEXCEPTION)
int getValueLength () const throw (MEDEXCEPTION)
 Return the actual length of the reference to values array returned by getValue.
const T * getValue () const throw (MEDEXCEPTION)
 Returns a pointer to the value array.
const T * getRow (int i) const throw (MEDEXCEPTION)
 Returns a reference to $ i^{th} $ row of FIELD values array.
const T * getColumn (int j) const throw (MEDEXCEPTION)
 Returns a reference to $j^{th}$ column of FIELD values array.
getValueIJ (int i, int j) const throw (MEDEXCEPTION)
 Returns the value of $ i^{th} $ element and $ j^{th}$ component.
getValueIJK (int i, int j, int k) const throw (MEDEXCEPTION)
 Returns the $ j^{th}$ component of $ k^{th}$ Gauss points of $ i^{th}$ value.
int getValueByTypeLength (int t) const throw (MEDEXCEPTION)
 Return number of values of a geomertic type in NoInterlaceByType mode.
const T * getValueByType (int t) const throw (MEDEXCEPTION)
 Return a reference to values array to read them.
getValueIJByType (int i, int j, int t) const throw (MEDEXCEPTION)
 Return the value of i^{th} element in indicated type t and j^{th} component.
getValueIJKByType (int i, int j, int k, int t) const throw (MEDEXCEPTION)
 Return the j^{th} component of k^{th} gauss points of i^{th} value with type t.
bool getValueOnElement (int eltIdInSup, T *retValues) const throw (MEDEXCEPTION)
 Fills in already allocated retValues array the values related to eltIdInSup.
void getValueOnPoint (const double *coords, double *output) const throw (MEDEXCEPTION)
 Retrieve value in a given point.
void getValueOnPoints (int nb_points, const double *coords, double *output) const throw (MEDEXCEPTION)
 Retrieve values in given points.
const int getNumberOfGeometricTypes () const throw (MEDEXCEPTION)
const GAUSS_LOCALIZATION
< INTERLACING_TAG > & 
getGaussLocalization (MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION)
const GAUSS_LOCALIZATION
< INTERLACING_TAG > * 
getGaussLocalizationPtr (MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION)
const GAUSS_LOCALIZATION_ * getGaussLocalizationRoot (MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION)
 Return GAUSS_LOCALIZATION_* whose interlacing type may differ from one of the field.
void setGaussLocalization (MED_EN::medGeometryElement geomElement, const GAUSS_LOCALIZATION< INTERLACING_TAG > &gaussloc)
void setGaussLocalization (MED_EN::medGeometryElement geomElement, GAUSS_LOCALIZATION_ *gaussloc)
 Take onership of GAUSS_LOCALIZATION_* whose interlacing type may differ from one of the field.
const int * getNumberOfGaussPoints () const throw (MEDEXCEPTION)
 Returns number of Gauss points for each geometric type.
const int getNumberOfGaussPoints (MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION)
 Returns number of Gauss points for this medGeometryElement.
const int getNbGaussI (int i) const throw (MEDEXCEPTION)
 Returns number of Gauss points for element n°i.
const int * getNumberOfElements () const throw (MEDEXCEPTION)
const MED_EN::medGeometryElementgetGeometricTypes () const throw (MEDEXCEPTION)
bool isOnAllElements () const throw (MEDEXCEPTION)
void setArray (MEDMEM_Array_ *value) throw (MEDEXCEPTION)
FIELD< double, FullInterlace > * getGaussPointsCoordinates () const throw (MEDEXCEPTION)
 Return the coordinates of the gauss points The returned field has SPACEDIM components.
void setValue (T *value) throw (MEDEXCEPTION)
 This method makes it possible to have the field pointing to an existing value array.
void setRow (int i, T *value) throw (MEDEXCEPTION)
 Update values array in the j^{th} row of FIELD values array with the given ones and according to specified mode.
void setColumn (int i, T *value) throw (MEDEXCEPTION)
 Update values array in the $j^{th}$ column of FIELD values array with the given ones and according to specified mode.
void setValueIJ (int i, int j, T value) throw (MEDEXCEPTION)
 Sets the value of $ i^{th} $ element and $ j^{th}$ component with value.
void setValueIJK (int i, int j, int k, T value) throw (MEDEXCEPTION)
 Set the value of i^{th} element, j^{th} component and k^{th} gauss point with the given one.
void setValueIJByType (int i, int j, int t, T value) throw (MEDEXCEPTION)
 Set the value of i^{th} element and j^{th} component with the given one.
void setValueIJKByType (int i, int j, int k, int t, T value) throw (MEDEXCEPTION)
 Set the value of component of k^{th} gauss points of i^{th} element and j^{th} component with the given one.
void fillFromAnalytic (myFuncType f) throw (MEDEXCEPTION)
 Fill array by using T_Analytic.
FIELD< T, INTERLACING_TAG > * execFunc (int nbOfComponents, myFuncType2 f) throw (MEDEXCEPTION)
 Execute a function on _values on 'this' and put the result on a newly created field that has to be deallocated.

Static Public Member Functions

static FIELDadd (const FIELD &m, const FIELD &n)
 Addition of fields.
static FIELDaddDeep (const FIELD &m, const FIELD &n)
 Same as add method except that field check is deeper.
static FIELDsub (const FIELD &m, const FIELD &n)
 Substraction of fields.
static FIELDsubDeep (const FIELD &m, const FIELD &n)
 Same as sub method except that field check is deeper.
static FIELDmul (const FIELD &m, const FIELD &n)
 Multiplication of fields.
static FIELDmulDeep (const FIELD &m, const FIELD &n)
 Same as mul method except that field check is deeper.
static FIELDdiv (const FIELD &m, const FIELD &n)
 Division of fields.
static FIELDdivDeep (const FIELD &m, const FIELD &n)
 Same as div method except that field check is deeper.
static FIELDscalarProduct (const FIELD &m, const FIELD &n, bool deepCheck=false)
 Return a pointer to a new field that holds the scalar product.

Protected Types

typedef MEDMEM_ArrayInterface
< T, INTERLACING_TAG, NoGauss >
::Array 
ArrayNoGauss
typedef MEDMEM_ArrayInterface
< T, INTERLACING_TAG, Gauss >
::Array 
ArrayGauss
typedef MEDMEM_ArrayInterface
< T, NoInterlace, NoGauss >
::Array 
ArrayNo
typedef MEDMEM_ArrayInterface
< T, FullInterlace, NoGauss >
::Array 
ArrayFull
typedef MEDMEM_ArrayInterface
< T, NoInterlaceByType,
NoGauss >::Array 
ArrayNoByType
typedef MEDMEM_ArrayInterface
< T, NoInterlaceByType, Gauss >
::Array 
ArrayNoByTypeGauss
typedef MEDMEM_Array_ Array
typedef T ElementType
typedef INTERLACING_TAG InterlacingTag
typedef map
< MED_EN::medGeometryElement,
GAUSS_LOCALIZATION_ * > 
locMap

Static Protected Member Functions

static T pow (T x)

Protected Attributes

Array_value
GMESH * _mesh
_vmin
_vmax
map
< MED_EN::medGeometryElement,
GAUSS_LOCALIZATION_ * > 
_gaussModel

Static Protected Attributes

static T _scalarForPow = 1

Friends

class MED_FIELD_RDONLY_DRIVER< T >
class MED_FIELD_WRONLY_DRIVER< T >
class VTK_FIELD_DRIVER< T >

Detailed Description

Definition at line 29 of file FIELDINTClient.hxx.


Member Typedef Documentation

template<class T, class INTERLACING_TAG>
typedef MEDMEM_Array_ MEDMEM::FIELD< T, INTERLACING_TAG >::Array [protected, inherited]

Definition at line 842 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef MEDMEM_ArrayInterface<T,FullInterlace,NoGauss>::Array MEDMEM::FIELD< T, INTERLACING_TAG >::ArrayFull [protected, inherited]

Definition at line 839 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef MEDMEM_ArrayInterface<T,INTERLACING_TAG,Gauss>::Array MEDMEM::FIELD< T, INTERLACING_TAG >::ArrayGauss [protected, inherited]

Definition at line 837 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef MEDMEM_ArrayInterface<T,NoInterlace,NoGauss>::Array MEDMEM::FIELD< T, INTERLACING_TAG >::ArrayNo [protected, inherited]

Definition at line 838 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef MEDMEM_ArrayInterface<T,NoInterlaceByType,NoGauss>::Array MEDMEM::FIELD< T, INTERLACING_TAG >::ArrayNoByType [protected, inherited]

Definition at line 840 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef MEDMEM_ArrayInterface<T,NoInterlaceByType,Gauss>::Array MEDMEM::FIELD< T, INTERLACING_TAG >::ArrayNoByTypeGauss [protected, inherited]

Definition at line 841 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef MEDMEM_ArrayInterface<T,INTERLACING_TAG,NoGauss>::Array MEDMEM::FIELD< T, INTERLACING_TAG >::ArrayNoGauss [protected, inherited]

Definition at line 836 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef T MEDMEM::FIELD< T, INTERLACING_TAG >::ElementType [protected, inherited]

Definition at line 843 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef INTERLACING_TAG MEDMEM::FIELD< T, INTERLACING_TAG >::InterlacingTag [protected, inherited]

Definition at line 844 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef map<MED_EN::medGeometryElement,GAUSS_LOCALIZATION_*> MEDMEM::FIELD< T, INTERLACING_TAG >::locMap [protected, inherited]

Definition at line 845 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef void(* MEDMEM::FIELD< T, INTERLACING_TAG >::myFuncType)(const double *, T *) [inherited]

Definition at line 1052 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
typedef void(* MEDMEM::FIELD< T, INTERLACING_TAG >::myFuncType2)(const T *, T *) [inherited]

Definition at line 1054 of file MEDMEM_Field.hxx.


Constructor & Destructor Documentation

MEDMEM::FIELDINTClient::FIELDINTClient ( SALOME_MED::FIELDINT_ptr  ptrCorba,
MEDMEM::SUPPORT *  S = NULL 
)

Constructor with arguments.

Definition at line 31 of file FIELDINTClient.cxx.

                                                        :
  FIELDClient<int>(ptrCorba,S)
{
  const char* LOC = "Constructor with arguments (for Python API) FIELDINTClient";
  BEGIN_OF(LOC);

  END_OF(LOC);
}

Destructor.

Definition at line 45 of file FIELDINTClient.cxx.

{
  const char* LOC = "Default Destructor (for Python API) FIELDINTClient";
  BEGIN_OF(LOC);

  END_OF(LOC);
}

Member Function Documentation

template<class T , class INTERLACING_TAG >
int MEDMEM::FIELD< T, INTERLACING_TAG >::addDriver ( driverTypes  driverType,
const string &  fileName = "Default File Name.med",
const string &  driverName = "Default Field Name",
MED_EN::med_mode_acces  access = MED_EN::RDWR 
) [inherited]

Creates the specified driver and return its index reference to path to read or write methods.

Parameters:
driverTypespecifies the file type (MED_DRIVER or VTK_DRIVER)
fileNamename of the output file
driverNamename of the field
accessaccess type (read, write or both)

Definition at line 3095 of file MEDMEM_Field.hxx.

{
  //jfa tmp (as last argument has no default value):const char * LOC = "FIELD<T>::addDriver(driverTypes driverType, const string & fileName=\"Default File Name.med\",const string & driverName=\"Default Field Name\",MED_EN::med_mode_acces access) : ";

  GENDRIVER * driver;

  const char* LOC = "FIELD<T>::addDriver(driverTypes driverType, const string & fileName,const string & driverName,MED_EN::med_mode_acces access) :";
  BEGIN_OF_MED(LOC);

  SCRUTE_MED(driverType);

  driver = DRIVERFACTORY::buildDriverForField(driverType,fileName,this,access);

  _drivers.push_back(driver);

  int current = _drivers.size()-1;

  _drivers[current]->setFieldName(driverName);

  END_OF_MED(LOC);

  return current;
}

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
int MEDMEM::FIELD< T, INTERLACING_TAG >::addDriver ( GENDRIVER &  driver) [inline, inherited]

Duplicates the given driver and return its index reference to path to read or write methods.

Definition at line 3217 of file MEDMEM_Field.hxx.

{
  int current;

  const char* LOC = "FIELD<T, INTERLACING_TAG>::addDriver(GENDRIVER &) : ";
  BEGIN_OF_MED(LOC);

  GENDRIVER * newDriver = 
    DRIVERFACTORY::buildDriverForField(driver.getDriverType(),
                                       driver.getFileName(), this,
                                       driver.getAccessMode());
  _drivers.push_back(newDriver);

  current = _drivers.size()-1;
  SCRUTE_MED(current);
  driver.setId(current);

  newDriver->merge( driver );
  newDriver->setId(current);

  return current ;
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::allocValue ( const int  NumberOfComponents) [inherited]

Definition at line 2983 of file MEDMEM_Field.hxx.

{
  const char* LOC = "FIELD<T, INTERLACING_TAG>::allocValue(const int NumberOfComponents)";
  BEGIN_OF_MED(LOC);

  _numberOfComponents = NumberOfComponents ;
  _componentsTypes.resize(NumberOfComponents);
  _componentsNames.resize(NumberOfComponents);
  _componentsDescriptions.resize(NumberOfComponents);
  _componentsUnits.resize(NumberOfComponents);
  _MEDComponentsUnits.resize(NumberOfComponents);
  for (int i=0;i<NumberOfComponents;i++) {
    _componentsTypes[i] = 0 ;
  }
  delete _value;
  try {
    // becarefull about the number of gauss point
    _numberOfValues = _support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS);
    MESSAGE_MED(PREFIX_MED <<" : "<<_numberOfValues <<" et "<< NumberOfComponents);

    //EF : A modifier lors de l'intégration de la classe de localisation des points de gauss
    _value = new ArrayNoGauss(_numberOfComponents,_numberOfValues);

    _isRead = true ;
  }
  catch (MEDEXCEPTION &ex) {
    MESSAGE_MED("No value defined, problem with NumberOfComponents (and may be _support) size of MEDARRAY<T>::_value !");
    // OCC 10/03/2006 -- According to the rules defined with help of 
    // MEDMEM_IntrelacingTraits class, it is not allowed to instantiate
    // MEDMEM_Array<> template using INTERLACING_TAG parameter of 
    // FIELD template - MSVC++ 2003 compiler generated an error here.
    // _value = (MEDMEM_Array<T, INTERLACING_TAG> *) NULL;
    _value = NULL;
  }

  SCRUTE_MED(_value);
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::allocValue ( const int  NumberOfComponents,
const int  LengthValue 
) [inherited]

Definition at line 3026 of file MEDMEM_Field.hxx.

{
  const char* LOC = "void FIELD<T>::allocValue(const int NumberOfComponents,const int LengthValue)";
  BEGIN_OF_MED(LOC);

  _numberOfComponents = NumberOfComponents ;
  _componentsTypes.resize(NumberOfComponents);
  _componentsNames.resize(NumberOfComponents);
  _componentsDescriptions.resize(NumberOfComponents);
  _componentsUnits.resize(NumberOfComponents);
  _MEDComponentsUnits.resize(NumberOfComponents);
  for (int i=0;i<NumberOfComponents;i++) {
    _componentsTypes[i] = 0 ;
  }

  MESSAGE_MED("FIELD : constructeur : "<<LengthValue <<" et "<< NumberOfComponents);
  _numberOfValues = LengthValue ;
  delete _value;
  //EF : A modifier lors de l'intégration de la classe de localisation des points de gauss
  _value = new ArrayNoGauss(_numberOfComponents,_numberOfValues);

  _isRead = true ;

  SCRUTE_MED(_value);
  END_OF_MED(LOC);
}
template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::deallocValue ( ) [inherited]

Definition at line 3058 of file MEDMEM_Field.hxx.

{
  const char* LOC = "void FIELD<T, INTERLACING_TAG>::deallocValue()";
  BEGIN_OF_MED(LOC);
  _numberOfValues = 0 ;
  _numberOfComponents = 0 ;
  if (_value != NULL) {
    delete _value;
    _value = NULL;
  }

  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::execFunc ( int  nbOfComponents,
myFuncType2  f 
) throw (MEDEXCEPTION) [inherited]

Execute a function on _values on 'this' and put the result on a newly created field that has to be deallocated.

WARNING : "this" must have allocated its array by setting this->_support and this->_numberOfComponents properly. Typically you should use it on a field built with constructor FIELD<T>::FIELD<T>(SUPPORT *,int nbOfComponents)

Definition at line 4469 of file MEDMEM_Field.hxx.

{
  FIELD<T,INTERLACING_TAG> *ret=new FIELD<T,INTERLACING_TAG>(_support,nbOfComponents);
  const T* valsInput=getValue();
  T* valsOutPut=(T*)ret->getValue();
  int i;
  for(i=0;i<_numberOfValues;i++)
    f(valsInput+i*_numberOfComponents,valsOutPut+i*nbOfComponents);
  return ret;
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::fillFromAnalytic ( myFuncType  f) throw (MEDEXCEPTION) [inherited]

Fill array by using T_Analytic.

WARNING : "this" must have allocated its array by setting this->_support and this->_numberOfComponents properly. Typically you should use it on a field built with constructor FIELD<T>::FIELD<T>(SUPPORT *,int nbOfComponents)

Definition at line 4394 of file MEDMEM_Field.hxx.

{
  const char * LOC = "void FIELD<T, INTERLACING_TAG>::fillFromAnalytic(myFuncType f) : ";
  int i,j;
  if (_support == (SUPPORT *) NULL)
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"No Support defined."));

  const GMESH * mesh = _support->getMesh();
  int spaceDim = mesh->getSpaceDimension();
  const double * coord;

  const double * bary;
  FIELD<double,FullInterlace> * barycenterField=0;

  double ** xyz=new double* [spaceDim];
  bool deallocateXyz=false;
  if(_support->getEntity()==MED_EN::MED_NODE)
    {
      const MESH * unstructured = _support->getMesh()->convertInMESH();
      if (_support->isOnAllElements())
        {
          coord=unstructured->getCoordinates(MED_EN::MED_NO_INTERLACE);
          for(i=0; i<spaceDim; i++)
            xyz[i]=(double *)coord+i*_numberOfValues;
        }
      else
        {
          coord = unstructured->getCoordinates(MED_EN::MED_FULL_INTERLACE);
          const int * nodesNumber=_support->getNumber(MED_EN::MED_ALL_ELEMENTS);
          for(i=0; i<spaceDim; i++)
            xyz[i]=new double[_numberOfValues];
          deallocateXyz=true;
          for(i=0;i<_numberOfValues;i++)
            {
              for(j=0;j<spaceDim;j++)
                xyz[j][i]=coord[(nodesNumber[i]-1)*spaceDim+j];
            }
        }
      unstructured->removeReference();
    }
  else
    {
      barycenterField = mesh->getBarycenter(_support);
      bary = barycenterField->getValue();
      for(i=0; i<spaceDim; i++)
        xyz[i]=new double[_numberOfValues];
      deallocateXyz=true;
      for(i=0;i<_numberOfValues;i++) {
        for(j=0;j<spaceDim;j++)
          xyz[j][i]=bary[i*spaceDim+j];
      }
    }
  T* valsToSet=(T*)getValue();
  double *temp=new double[spaceDim];
  for(i=0;i<_numberOfValues;i++)
  {
    for(j=0;j<spaceDim;j++)
      temp[j]=xyz[j][i];
    f(temp,valsToSet+i*_numberOfComponents);
  }
  delete [] temp;
  if(barycenterField)
    delete barycenterField;
  if(deallocateXyz)
    for(j=0;j<spaceDim;j++)
      delete [] xyz[j];
  delete [] xyz;
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
MEDMEM_Array_ * MEDMEM::FIELD< T, INTERLACING_TAG >::getArray ( ) const throw (MEDEXCEPTION) [inline, inherited]

Definition at line 3791 of file MEDMEM_Field.hxx.

{
  const char* LOC = "MEDMEM_Array_ * FIELD<T, INTERLACING_TAG>::getArray() : ";
  BEGIN_OF_MED(LOC);
  END_OF_MED(LOC);
  return _value ;
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
MEDMEM_ArrayInterface< T, INTERLACING_TAG, Gauss >::Array * MEDMEM::FIELD< T, INTERLACING_TAG >::getArrayGauss ( ) const throw (MEDEXCEPTION) [inline, inherited]

Definition at line 3800 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T, INTERLACING_TAG>::getArrayGauss() : ";
  BEGIN_OF_MED(LOC);

  if ( getGaussPresence() )
    return static_cast<ArrayGauss *> (_value);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<
                                 "The field has no Gauss Point"));

  END_OF_MED(LOC);

}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
MEDMEM_ArrayInterface< T, INTERLACING_TAG, NoGauss >::Array * MEDMEM::FIELD< T, INTERLACING_TAG >::getArrayNoGauss ( ) const throw (MEDEXCEPTION) [inline, inherited]

Definition at line 3817 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T, INTERLACING_TAG>::getArrayNoGauss() : ";
  BEGIN_OF_MED(LOC);

  if ( ! getGaussPresence() )
    return static_cast < ArrayNoGauss * > (_value);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<
                                 "The field has Gauss Point"));

  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const T * MEDMEM::FIELD< T, INTERLACING_TAG >::getColumn ( int  j) const throw (MEDEXCEPTION) [inline, inherited]

Returns a reference to $j^{th}$ column of FIELD values array.

Definition at line 3924 of file MEDMEM_Field.hxx.

{
  if ( getGaussPresence() )
    return static_cast<ArrayGauss *>(_value)->getColumn(j) ;
  else
    return static_cast<ArrayNoGauss *>(_value)->getColumn(j) ;
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const GAUSS_LOCALIZATION< INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::getGaussLocalization ( MED_EN::medGeometryElement  geomElement) const throw (MEDEXCEPTION) [inherited]

Definition at line 4070 of file MEDMEM_Field.hxx.

{
  const char * LOC ="getGaussLocalization(MED_EN::medGeometryElement geomElement) : ";
  const GAUSS_LOCALIZATION_ * locPtr=0;

  locMap::const_iterator it;
  if ( ( it = _gaussModel.find(geomElement)) != _gaussModel.end() ) {
        locPtr = (*it).second;
        return  *static_cast<const GAUSS_LOCALIZATION<INTERLACING_TAG> *>(locPtr);
  }
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Can't find any GaussLocalization on this geometric type" ));

}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const GAUSS_LOCALIZATION< INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::getGaussLocalizationPtr ( MED_EN::medGeometryElement  geomElement) const throw (MEDEXCEPTION) [inherited]

Definition at line 4086 of file MEDMEM_Field.hxx.

{
  const char * LOC ="getGaussLocalizationPtr(MED_EN::medGeometryElement geomElement) : ";
  const GAUSS_LOCALIZATION_ * locPtr=0;

  locMap::const_iterator it;
  if ( ( it = _gaussModel.find(geomElement)) != _gaussModel.end() ) {
        locPtr = (*it).second;
        return  static_cast<const GAUSS_LOCALIZATION<INTERLACING_TAG> *>(locPtr);
  }
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Can't find any GaussLocalization on this geometric type" ));

}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const GAUSS_LOCALIZATION_ * MEDMEM::FIELD< T, INTERLACING_TAG >::getGaussLocalizationRoot ( MED_EN::medGeometryElement  geomElement) const throw (MEDEXCEPTION) [inherited]

Return GAUSS_LOCALIZATION_* whose interlacing type may differ from one of the field.

Definition at line 4105 of file MEDMEM_Field.hxx.

{
  const char * LOC ="getGaussLocalizationRoot(MED_EN::medGeometryElement geomElement) : ";

  locMap::const_iterator it;
  if ( ( it = _gaussModel.find(geomElement)) != _gaussModel.end() ) {
        return (*it).second;
  }
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Can't find any GaussLocalization on this geometric type: "<< geomElement ));

}
template<class T , class INTERLACING_TAG >
FIELD< double, FullInterlace > * MEDMEM::FIELD< T, INTERLACING_TAG >::getGaussPointsCoordinates ( ) const throw (MEDEXCEPTION) [inherited]

Return the coordinates of the gauss points The returned field has SPACEDIM components.

Definition at line 3578 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD::getGaussPointsCoordinates() : ";
  BEGIN_OF_MED(LOC);

  if (!getSupport())
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));

  const MEDMEM::MESH* mesh = getSupport()->getMesh()->convertInMESH();
  MEDMEM::AutoDeref derefMesh( mesh );

  const double * coord = mesh->getCoordinates(MED_FULL_INTERLACE);
  int spaceDim         = mesh->getSpaceDimension();

  //Init calculator of the gauss point coordinates
  INTERP_KERNEL::GaussCoords calculator;
  locMap::const_iterator it;

  int nb_type                     = getSupport()->getNumberOfTypes();
  int length_values               = getSupport()->getNumberOfElements(MED_ALL_ELEMENTS);
  const medGeometryElement* types = getSupport()->getTypes();
  medEntityMesh support_entity    = getSupport()->getEntity();
  bool isOnAll                    = getSupport()->isOnAllElements();

  const int* global_connectivity  = 0;
  const GAUSS_LOCALIZATION<INTERLACING_TAG>* gaussLock = NULL;

  typedef typename MEDMEM_ArrayInterface<double,INTERLACING_TAG,NoGauss>::Array ArrayCoord;
  typedef typename MEDMEM_ArrayInterface<double,INTERLACING_TAG,Gauss>::Array TArrayGauss;

  vector<int>  nbelgeoc, nbgaussgeo;

  nbelgeoc.resize(nb_type+1, 0);
  nbgaussgeo.resize(nb_type+1, 0);

  for ( int iType = 0 ; iType < nb_type ; iType++ ) {

    medGeometryElement elem_type = types[iType] ;
    if(elem_type == MED_EN::MED_POLYGON && elem_type == MED_EN::MED_POLYHEDRA ) 
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Bad cell type : "<<MED_EN::geoNames[elem_type]<<" !!! "));

    it = _gaussModel.find(elem_type);

    if(it == _gaussModel.end())
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Gauss localization not defined for "<<MED_EN::geoNames[elem_type]<<" type!!! "));
    gaussLock = static_cast<const GAUSS_LOCALIZATION<INTERLACING_TAG> * > ((*it).second);

    ArrayCoord coord = gaussLock->getGsCoo();
    double* gaussCoord = new double[coord.getNbElem()*coord.getDim()];
    int idx = 0;
    for( int i = 1 ; i <= coord.getNbElem() ; i++ ) {
      for( int j = 1 ; j <= coord.getDim() ; j++ ) {
        gaussCoord[idx++] = coord.getIJ(i,j);
      }
    }

    idx = 0;
    ArrayCoord ref = gaussLock->getRefCoo();
    double* refCoord = new double[ref.getNbElem()*ref.getDim()];
    for( int i = 1 ; i <= ref.getNbElem() ; i++ ) {
      for( int j = 1 ; j <= ref.getDim() ; j++ ) {
        refCoord[idx++] = ref.getIJ(i,j);
      }
    }
      
    INTERP_KERNEL::NormalizedCellType normType;
    switch(elem_type) {
    case MED_EN::MED_SEG2 : normType = INTERP_KERNEL::NORM_SEG2;break;
    case MED_EN::MED_SEG3 : normType = INTERP_KERNEL::NORM_SEG3;break;
    default : normType = (INTERP_KERNEL::NormalizedCellType) ((((unsigned long)elem_type/100-2)*10) + ((unsigned long)elem_type%100));
      break;
    }
      
    calculator.addGaussInfo(normType,
                            elem_type/100,
                            gaussCoord,
                            gaussLock->getNbGauss(),
                            refCoord,
                            elem_type%100
                            );
    // Preapre Info for the gauss array
    nbelgeoc   [ iType+1 ] = nbelgeoc[ iType ] + getSupport()->getNumberOfElements(elem_type);
    nbgaussgeo [ iType+1 ] = gaussLock->getNbGauss();
    
    delete [] gaussCoord;
    delete [] refCoord;
  }

  FIELD<double, FullInterlace>* gpCoord =
    new FIELD<double, FullInterlace>(getSupport(),spaceDim);
  gpCoord->setName("Gauss Points Coordinates");
  gpCoord->setDescription("Gauss Points Coordinates");
  
  for(int dimId = 1 ; dimId <= spaceDim; dimId++) {
    switch(dimId) {
    case 1:
      gpCoord->setComponentName(dimId,"X");
      gpCoord->setComponentDescription(dimId,"X coordinate of the gauss point");
      break;
    case 2:
      gpCoord->setComponentName(dimId,"Y");
      gpCoord->setComponentDescription(dimId,"Y coordinate of the gauss point");
      break;
    case 3:
      gpCoord->setComponentName(dimId,"Z");
      gpCoord->setComponentDescription(dimId,"Z coordinate of the gauss point");
      break;
    }
    
    gpCoord->setMEDComponentUnit(dimId, mesh->getCoordinatesUnits()[dimId-1]);    
  }
  
  gpCoord->setIterationNumber(getIterationNumber());
  gpCoord->setOrderNumber(getOrderNumber());
  gpCoord->setTime(getTime());

  TArrayGauss *arrayGauss = new TArrayGauss(spaceDim, length_values,
                                            nb_type, & nbelgeoc[0], & nbgaussgeo[0]);
  gpCoord->setArray(arrayGauss);


  
    
  //Calculation of the coordinates  
  int index = 1;
  for ( int i = 0 ; i < nb_type ; i++ ) {
    
    medGeometryElement type = types[i] ;
    INTERP_KERNEL::NormalizedCellType normType;
    switch(type) {
    case MED_EN::MED_SEG2 : normType = INTERP_KERNEL::NORM_SEG2;break;
    case MED_EN::MED_SEG3 : normType = INTERP_KERNEL::NORM_SEG3;break;
    default : normType = (INTERP_KERNEL::NormalizedCellType) ((((unsigned long)type/100-2)*10) + ((unsigned long)type%100));
      break;
    }
    
    it = _gaussModel.find(type);
    
    gaussLock = static_cast<const GAUSS_LOCALIZATION<INTERLACING_TAG> * > ((*it).second);
    int nb_entity_type = getSupport()->getNumberOfElements(type);
    
    
    if (isOnAll) {
      global_connectivity = mesh->getConnectivity(MED_NODAL,support_entity,type);
    }
    else {
      const int * supp_number = getSupport()->getNumber(type);
      const int * connectivity = mesh->getConnectivity(MED_NODAL,support_entity,MED_ALL_ELEMENTS);
      const int * connectivityIndex = mesh->getConnectivityIndex(MED_NODAL,support_entity);
      int * global_connectivity_tmp = new int[(type%100)*nb_entity_type];
      
      for (int k_type = 0; k_type<nb_entity_type; k_type++) {
        for (int j_ent = 0; j_ent<(type%100); j_ent++) {
          global_connectivity_tmp[k_type*(type%100)+j_ent] = connectivity[connectivityIndex[supp_number[k_type]-1]+j_ent-1];
        }
      }
      global_connectivity = global_connectivity_tmp;
    }

    int nbNodes = (type%100);
    double* gCoord = NULL;
    int* Ni = NULL; 
    
    for ( int elem = 0; elem < nb_entity_type; elem++ ) {
      int elem_index = nbNodes*elem;
      Ni = new int[nbNodes];
      for( int idx = 0 ; idx < nbNodes; idx++ ) {
        Ni[idx] = global_connectivity[ elem_index+idx ] - 1;
      }
      
      gCoord = calculator.calculateCoords(normType,
                                          coord,
                                          spaceDim,
                                          Ni);
      int resultIndex = 0;
      for( int k = 0; k < gaussLock->getNbGauss(); k++ ) {
        for( int dimId = 1; dimId <= spaceDim; dimId++ ) {
          gpCoord->setValueIJK(index,dimId,(k+1),gCoord[resultIndex]);
          resultIndex++;
        }
      }
      delete [] gCoord;
      delete [] Ni;
      index++;
    }
    if (!isOnAll && type != MED_EN::MED_POLYHEDRA && type != MED_EN::MED_POLYGON) {
      delete [] global_connectivity ;
    }
  }
  END_OF_MED(LOC);
  return gpCoord;
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
bool MEDMEM::FIELD< T, INTERLACING_TAG >::getGaussPresence ( ) const throw (MEDEXCEPTION) [inline, inherited]

Definition at line 3833 of file MEDMEM_Field.hxx.

{
  if (_value != NULL)
    return _value->getGaussPresence();
  else
    throw MEDEXCEPTION("FIELD<T, INTERLACING_TAG>::getGaussPresence() const : Can't call getGaussPresence on a null _value");
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const MED_EN::medGeometryElement * MEDMEM::FIELD< T, INTERLACING_TAG >::getGeometricTypes ( ) const throw (MEDEXCEPTION) [inherited]

Definition at line 4242 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getGeometricTypes(..)";
  BEGIN_OF_MED(LOC);
  if (_support)
    return _support->getTypes();
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const int MEDMEM::FIELD< T, INTERLACING_TAG >::getNbGaussI ( int  i) const throw (MEDEXCEPTION) [inherited]

Returns number of Gauss points for element n°i.

The i index is a global index (take care of previous element on different geometric type).

Definition at line 4208 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getNbGaussI(..)";

  int valIndex=-1;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));

  if (_value)
   if ( getGaussPresence() )
     return static_cast<ArrayGauss *>(_value)->getNbGauss(valIndex) ;
   else
     return static_cast<ArrayNoGauss *>(_value)->getNbGauss(valIndex) ;
 else
   throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"_value not defined" ));
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const int * MEDMEM::FIELD< T, INTERLACING_TAG >::getNumberOfElements ( ) const throw (MEDEXCEPTION) [inherited]

Definition at line 4231 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getNumberOfElements(..)";
  BEGIN_OF_MED(LOC);
  if (_support)
    return _support->getNumberOfElements();
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const int * MEDMEM::FIELD< T, INTERLACING_TAG >::getNumberOfGaussPoints ( ) const throw (MEDEXCEPTION) [inherited]

Returns number of Gauss points for each geometric type.

Note : if there is no gauss points whatever the geometric type is it returns an exception. (renvoyer un tableau de 1 ?)

Definition at line 4188 of file MEDMEM_Field.hxx.

{
  const char * LOC ="const int * getNumberOfGaussPoints(MED_EN::medGeometryElement geomElement) : ";

  if (_value)
    if ( getGaussPresence() ) {
      return static_cast<ArrayGauss *>(_value)->getNbGaussGeo()+1;
    } else
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"value hasn't Gauss points " ));

    else
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Value not defined" ));
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const int MEDMEM::FIELD< T, INTERLACING_TAG >::getNumberOfGaussPoints ( MED_EN::medGeometryElement  geomElement) const throw (MEDEXCEPTION) [inherited]

Returns number of Gauss points for this medGeometryElement.

Note : if there is no GAUSS_LOCALIZATION having this medGeometryElement but the medGeometryElement exist in the SUPPORT, getNumberOfGaussPoints return 1

Definition at line 4156 of file MEDMEM_Field.hxx.

{
  const char * LOC ="getNumberOfGaussPoints(MED_EN::medGeometryElement geomElement) : ";
  const GAUSS_LOCALIZATION_ * locPtr=0;

  locMap::const_iterator it;
  if ( ( it = _gaussModel.find(geomElement)) != _gaussModel.end() ) {
        locPtr = (*it).second;
        return  static_cast<const GAUSS_LOCALIZATION<INTERLACING_TAG> *>(locPtr)->getNbGauss();
  }
  else
    if (_support)
      try {
        if ( _support->getNumberOfElements(geomElement) ) return 1;
      } catch ( MEDEXCEPTION & ex) {
        throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<< "GeometricType not found !" )) ;
      }
    else
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));

  throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Should never execute this!" ));

}
template<class T , class INTERLACING_TAG >
const int MEDMEM::FIELD< T, INTERLACING_TAG >::getNumberOfGeometricTypes ( ) const throw (MEDEXCEPTION) [inherited]

Definition at line 4052 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getNumberOfGeometricTypes(..)";
  BEGIN_OF_MED(LOC);
  if (_support)
    return _support->getNumberOfTypes();
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
const T * MEDMEM::FIELD< T, INTERLACING_TAG >::getRow ( int  i) const throw (MEDEXCEPTION) [inline, inherited]

Returns a reference to $ i^{th} $ row of FIELD values array.

If a faster accessor is intended you may use getArray() once, then MEDMEM_Array accessors. Be careful if field support is not on all elements getRow use support->getValIndFromGlobalNumber(i).

Definition at line 3903 of file MEDMEM_Field.hxx.

{
  const char* LOC; LOC = "FIELD<T,INTERLACING_TAG>::getRow(int i) : ";

  int valIndex=-1;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));

  if ( getGaussPresence() )
    return static_cast<ArrayGauss *>(_value)->getRow(valIndex) ;
  else
    return static_cast<ArrayNoGauss *>(_value)->getRow(valIndex) ;
}

Here is the caller graph for this function:

template<class T , class INTERLACIN_TAG >
const T * MEDMEM::FIELD< T, INTERLACIN_TAG >::getValue ( ) const throw (MEDEXCEPTION) [inline, inherited]

Returns a pointer to the value array.

Returns a reference to values array to read them.

Definition at line 3884 of file MEDMEM_Field.hxx.

{
  const char* LOC = "FIELD<T, INTERLACING_TAG>::getValue() : ";
  BEGIN_OF_MED(LOC);
  if ( getGaussPresence() )
    return static_cast<ArrayGauss *>(_value)->getPtr() ;
  else
    return static_cast<ArrayNoGauss *>(_value)->getPtr() ;
}

Here is the caller graph for this function:

template<class T , class INTERLACIN_TAG >
const T * MEDMEM::FIELD< T, INTERLACIN_TAG >::getValueByType ( int  t) const throw (MEDEXCEPTION) [inline, inherited]

Return a reference to values array to read them.

Definition at line 4006 of file MEDMEM_Field.hxx.

{
  if ( getInterlacingType() != MED_EN::MED_NO_INTERLACE_BY_TYPE )
    throw MEDEXCEPTION(LOCALIZED("getValueByType() : not MED_NO_INTERLACE_BY_TYPE field" ));

  if ( getGaussPresence() ) {
    ArrayNoByTypeGauss* array = static_cast<ArrayNoByTypeGauss *>(_value);
    return array->getPtr() + array->getIndex( t );
  }
  else {
    ArrayNoByType* array = static_cast<ArrayNoByType *>(_value);
    return array->getPtr() + array->getIndex( t );
  }
}
template<class T , class INTERLACIN_TAG >
int MEDMEM::FIELD< T, INTERLACIN_TAG >::getValueByTypeLength ( int  t) const throw (MEDEXCEPTION) [inline, inherited]

Return number of values of a geomertic type in NoInterlaceByType mode.

Definition at line 3982 of file MEDMEM_Field.hxx.

{
  const char * LOC ="getValueByTypeLength() : ";
  if ( getInterlacingType() != MED_EN::MED_NO_INTERLACE_BY_TYPE )
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"not MED_NO_INTERLACE_BY_TYPE field" ));

  if ( getGaussPresence() ) {
    ArrayNoByTypeGauss* array = static_cast<ArrayNoByTypeGauss *>(_value);
    if (  t < 1 || t > array->getNbGeoType() )
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Invalid type: "<< t ));
    return array->getLengthOfType( t );
  }
  else {
    ArrayNoByType* array = static_cast<ArrayNoByType *>(_value);
    if (  t < 1 || t > array->getNbGeoType() )
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Invalid type: "<< t ));
    return array->getLengthOfType( t );
  }
}
template<class T , class INTERLACING_TAG >
T MEDMEM::FIELD< T, INTERLACING_TAG >::getValueIJ ( int  i,
int  j 
) const throw (MEDEXCEPTION) [inline, inherited]

Returns the value of $ i^{th} $ element and $ j^{th}$ component.

Returns the value of $i^{th}$ element and $j^{th}$ component.

This method only works with fields having no particular Gauss point definition (i.e., fields having one value per element). This method makes the retrieval of the value independent from the interlacing pattern, but it is slower than the complete retrieval obtained by the getValue() method.

Definition at line 3940 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getValueIJ(..)";
  int valIndex=-1;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));

  if ( getGaussPresence() )
    return static_cast<ArrayGauss *>(_value)->getIJ(valIndex,j) ;
  else
    return static_cast<ArrayNoGauss *>(_value)->getIJ(valIndex,j) ;
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
T MEDMEM::FIELD< T, INTERLACING_TAG >::getValueIJByType ( int  i,
int  j,
int  t 
) const throw (MEDEXCEPTION) [inline, inherited]

Return the value of i^{th} element in indicated type t and j^{th} component.

Definition at line 4024 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getValueIJByType(..)";
  if ( getInterlacingType() != MED_EN::MED_NO_INTERLACE_BY_TYPE )
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"not MED_NO_INTERLACE_BY_TYPE field" ));
    
  if ( getGaussPresence() )
    return static_cast<ArrayNoByTypeGauss *>(_value)->getIJByType(i,j,t) ;
  else
    return static_cast<ArrayNoByType *>(_value)->getIJByType(i,j,t) ;
}
template<class T , class INTERLACING_TAG >
T MEDMEM::FIELD< T, INTERLACING_TAG >::getValueIJK ( int  i,
int  j,
int  k 
) const throw (MEDEXCEPTION) [inline, inherited]

Returns the $ j^{th}$ component of $ k^{th}$ Gauss points of $ i^{th}$ value.

Returns the $j^{th}$ component of $k^{th}$ Gauss points of $i^{th}$ value.

This method is compatible with elements having more than one Gauss point. This method makes the retrieval of the value independent from the interlacing pattern, but it is slower than the complete retrieval obtained by the getValue() method.

Definition at line 3962 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getValueIJK(..)";
  int valIndex=-1;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));

  if ( getGaussPresence() )
    return static_cast<ArrayGauss *>(_value)->getIJK(valIndex,j,k) ;
  else
    return static_cast<ArrayNoGauss *>(_value)->getIJK(valIndex,j,k) ;
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
T MEDMEM::FIELD< T, INTERLACING_TAG >::getValueIJKByType ( int  i,
int  j,
int  k,
int  t 
) const throw (MEDEXCEPTION) [inline, inherited]

Return the j^{th} component of k^{th} gauss points of i^{th} value with type t.

Definition at line 4039 of file MEDMEM_Field.hxx.

{
  const char * LOC = "getValueIJKByType(..)";
  if ( getInterlacingType() != MED_EN::MED_NO_INTERLACE_BY_TYPE )
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"not MED_NO_INTERLACE_BY_TYPE field" ));

  if ( getGaussPresence() )
    return static_cast<ArrayNoByTypeGauss *>(_value)->getIJKByType(i,j,k,t) ;
  else
    return static_cast<ArrayNoByType      *>(_value)->getIJKByType(i,j,k,t) ;
}
template<class T , class INTERLACING_TAG >
int MEDMEM::FIELD< T, INTERLACING_TAG >::getValueLength ( ) const throw (MEDEXCEPTION) [inline, inherited]

Return the actual length of the reference to values array returned by getValue.

Take care of number of components and number of Gauss points by geometric type

Definition at line 3846 of file MEDMEM_Field.hxx.

{
  if ( getGaussPresence() )
    return static_cast<ArrayGauss *>(_value)->getArraySize() ;
  else
    return static_cast<ArrayNoGauss *>(_value)->getArraySize() ;
}

Here is the caller graph for this function:

template<class T, class INTERLACING_TAG >
bool MEDMEM::FIELD< T, INTERLACING_TAG >::getValueOnElement ( int  eltIdInSup,
T *  retValues 
) const throw (MEDEXCEPTION) [inherited]

Fills in already allocated retValues array the values related to eltIdInSup.

If the element does not exist in this->_support false is returned, true otherwise.

Definition at line 3434 of file MEDMEM_Field.hxx.

{

  if(eltIdInSup<1)
    return false;
  if(_support->isOnAllElements())
    {
      int nbOfEltsThis=_support->getMesh()->getNumberOfElements(_support->getEntity(),MED_EN::MED_ALL_ELEMENTS);
      if(eltIdInSup>nbOfEltsThis)
        return false;
      const T* valsThis=getValue();
      for(int j=0;j<_numberOfComponents;j++)
        retValues[j]=valsThis[(eltIdInSup-1)*_numberOfComponents+j];
      return true;
    }
  else
    {
      int nbOfEltsThis=_support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS);
      const int *eltsThis=_support->getNumber(MED_EN::MED_ALL_ELEMENTS);
      int iThis;
      bool found=false;
      for(iThis=0;iThis<nbOfEltsThis && !found;)
        if(eltsThis[iThis]==eltIdInSup)
          found=true;
        else
          iThis++;
      if(!found)
        return false;
      const T* valsThis=getValue();
      for(int j=0;j<_numberOfComponents;j++)
        retValues[j]=valsThis[iThis*_numberOfComponents+j];
      return true;
    }
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::getValueOnPoint ( const double *  coords,
double *  output 
) const throw (MEDEXCEPTION) [inherited]

Retrieve value in a given point.

Parameters:
coords- point coordinates
output- output buffer

Definition at line 3476 of file MEDMEM_Field.hxx.

  {
    getValueOnPoints(1, coords, output);
  }
template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::getValueOnPoints ( int  nb_points,
const double *  coords,
double *  output 
) const throw (MEDEXCEPTION) [inherited]

Retrieve values in given points.

Parameters:
nb_points- number of points
coords- point coordinates
output- output buffer

Definition at line 3488 of file MEDMEM_Field.hxx.

  {
    const char* LOC = " FIELD<T, INTERLACING_TAG>::getValueOnPoints(int nb_points, const double* coords, double* output) : ";
    // check operation feasibility
    if ( !getSupport() ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"NULL Support"));
    if ( !getSupport()->getMesh() ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"NULL Mesh"));
    if ( !_value ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"NULL _value"));
    if ( getGaussPresence() ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Not implemeneted for Gauss points"));

    MED_EN::medEntityMesh entity = getSupport()->getEntity();
    if ( entity != MED_EN::MED_CELL &&
         entity != MED_EN::MED_NODE )
      throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support must be on CELLs or NODEs"));

    // initialize output value
    for ( int j = 0; j < nb_points*getNumberOfComponents(); ++j )
      output[j] = 0.0;

    const MEDMEM::MESH* mesh = getSupport()->getMesh()->convertInMESH();
    MEDMEM::AutoDeref derefMesh( mesh );

    const double* point = coords;
    double* value = output;

    if ( entity == MED_EN::MED_CELL )
      {
        MEDMEM::PointLocator pLocator (*mesh);
        for ( int i = 0; i < nb_points; ++i)
          {
            // find the cell enclosing the point
            std::list<int> cellIds = pLocator.locate( point );
            int nbCells = cellIds.size();
            if ( nbCells < 1 )
              throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Point is out of mesh"));

            // retrieve value
            std::list<int>::iterator iCell = cellIds.begin();
            for ( ; iCell != cellIds.end(); ++iCell )
              for ( int j = 1; j <= getNumberOfComponents(); ++j )
                value[j-1] += getValueIJ( *iCell, j ) / nbCells;

            // next point
            point += mesh->getSpaceDimension();
            value += getNumberOfComponents();
          }
      }
    else // MED_EN::MED_NODE
      {
        const double * allCoords = mesh->getCoordinates( MED_EN::MED_FULL_INTERLACE );

        MEDMEM::PointLocatorInSimplex pLocator (*mesh);
        for ( int i = 0; i < nb_points; ++i)
          {
            // find nodes of the simplex enclosing the point
            std::list<int> nodeIds = pLocator.locate( point );
            int nbNodes = nodeIds.size();
            if ( nbNodes < 1 )
              throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Point is out of mesh"));
            if ( nbNodes != mesh->getMeshDimension() + 1 )
              throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Invalid nb of points of simplex: "<<nbNodes));

            // get coordinates of simplex nodes
            std::vector<const double*> nodeCoords( nbNodes );
            std::list<int>::iterator iNode = nodeIds.begin();
            int n = 0;
            for ( ; n < nbNodes; ++iNode, ++n )
              nodeCoords[n] = allCoords + (*iNode-1) * mesh->getSpaceDimension();

            // compute wegths of simplex nodes
            double nodeWgt[4];
            pLocator.getNodeWightsInSimplex( nodeCoords, coords, nodeWgt );

            // retrieve value
            for ( n = 0, iNode = nodeIds.begin(); iNode != nodeIds.end(); ++iNode, ++n )
              for ( int j = 1; j <= getNumberOfComponents(); ++j )
                value[j-1] += getValueIJ( *iNode, j ) * nodeWgt[ n ];

            // next point
            point += mesh->getSpaceDimension();
            value += getNumberOfComponents();
          }
      }
  }
template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::init ( ) [inherited]

     

Definition at line 1172 of file MEDMEM_Field.hxx.

{
}
template<class T , class INTERLACING_TAG >
bool MEDMEM::FIELD< T, INTERLACING_TAG >::isOnAllElements ( ) const throw (MEDEXCEPTION) [inherited]

Definition at line 4252 of file MEDMEM_Field.hxx.

{
  const char * LOC = "isOnAllElements(..)";
  BEGIN_OF_MED(LOC);
  if (_support)
    return _support->isOnAllElements();
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" ));
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::read ( int  index = 0) [inline, inherited]

Read FIELD in the file specified in the driver given by its index.

Definition at line 3125 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T, INTERLACING_TAG>::read(int index=0) : ";
  BEGIN_OF_MED(LOC);

  if ( index>=0 && index<(int)_drivers.size() && _drivers[index] ) {
    _drivers[index]->open();
    try
    {
      _drivers[index]->read();
    }
    catch ( const MEDEXCEPTION& ex )
    {
      _drivers[index]->close();
      throw ex;
    }
    _drivers[index]->close();
  }
  else
    throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
                                     << "The index given is invalid, index must be between  0 and |"
                                     << _drivers.size()
                                     )
                          );
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::read ( const GENDRIVER &  driver) [inline, inherited]

Read FIELD with the driver.

Additional information (name etc.) to select a field must be set to the field.

Definition at line 3156 of file MEDMEM_Field.hxx.

{
  const char* LOC = " FIELD<T, INTERLACING_TAG>::read(const GENDRIVER &) : ";
  BEGIN_OF_MED(LOC);

  // For the case where driver does not know about me since it has been created through
  // constructor witout parameters: create newDriver knowing me and get missing data
  // from driver using merge()
  std::auto_ptr<GENDRIVER> newDriver( DRIVERFACTORY::buildDriverForField(driver.getDriverType(),
                                                                         driver.getFileName(),
                                                                         this, RDONLY));
  newDriver->merge( driver );

  newDriver->open();
  try
  {
    newDriver->read();
  }
  catch ( const MEDEXCEPTION& ex )
  {
    newDriver->close();
    throw ex;
  }
  newDriver->close();

  END_OF_MED(LOC);
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::read ( driverTypes  driverType,
const std::string &  filename 
) [inline, inherited]

Read FIELD with driver of the given type.

Additional information (name etc.) to select a field must be set to the field.

Definition at line 3188 of file MEDMEM_Field.hxx.

{
  const char* LOC = " FIELD<T, INTERLACING_TAG>::read(driverTypes driverType, const std::string& filename) : ";
  BEGIN_OF_MED(LOC);

  std::auto_ptr<GENDRIVER> newDriver( DRIVERFACTORY::buildDriverForField(driverType, filename,
                                                                         this, RDONLY));
  newDriver->open();
  try
  {
    newDriver->read();
  }
  catch ( const MEDEXCEPTION& ex )
  {
    newDriver->close();
    throw ex;
  }
  newDriver->close();

  END_OF_MED(LOC);
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::rmDriver ( int  index = 0) [inherited]

Remove the driver referenced by its index.

Definition at line 3244 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T, INTERLACING_TAG>::rmDriver (int index=0): ";
  BEGIN_OF_MED(LOC);

  if ( index>=0 && index<(int)_drivers.size() && _drivers[index] ) {
    MESSAGE_MED ("detruire");
  }
  else
    throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
                                     << "The <index given is invalid, index must be between  0 and  |"
                                     << _drivers.size()
                                     )
                          );

  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setArray ( MEDMEM_Array_ *  value) throw (MEDEXCEPTION) [inline, inherited]

Definition at line 3778 of file MEDMEM_Field.hxx.

{
  if (NULL != _value) delete _value ;
  _value=Value ;
}

Here is the caller graph for this function:

template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setColumn ( int  i,
T *  value 
) throw (MEDEXCEPTION) [inline, inherited]

Update values array in the $j^{th}$ column of FIELD values array with the given ones and according to specified mode.

Definition at line 4309 of file MEDMEM_Field.hxx.

{
  if ( getGaussPresence() )
    static_cast<ArrayGauss *>(_value)->setColumn(j, value) ;
  else
    static_cast<ArrayNoGauss *>(_value)->setColumn(j, value) ;
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG>
void MEDMEM::FIELD< T, INTERLACING_TAG >::setGaussLocalization ( MED_EN::medGeometryElement  geomElement,
const GAUSS_LOCALIZATION< INTERLACING_TAG > &  gaussloc 
) [inherited]

Definition at line 4136 of file MEDMEM_Field.hxx.

{
  locMap::iterator it = _gaussModel.find(geomElement);
  if ( it != _gaussModel.end() ) {
    delete it->second;
    it->second = new GAUSS_LOCALIZATION<INTERLACING_TAG> (gaussloc);
  }
  else {
    _gaussModel[ geomElement ] = new GAUSS_LOCALIZATION<INTERLACING_TAG> (gaussloc);
  }
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG>
void MEDMEM::FIELD< T, INTERLACING_TAG >::setGaussLocalization ( MED_EN::medGeometryElement  geomElement,
GAUSS_LOCALIZATION_ *  gaussloc 
) [inherited]

Take onership of GAUSS_LOCALIZATION_* whose interlacing type may differ from one of the field.

Definition at line 4122 of file MEDMEM_Field.hxx.

{
  locMap::iterator it = _gaussModel.find(geomElement);
  if ( it != _gaussModel.end() ) {
    delete it->second;
    it->second = gaussloc;
  }
  else {
    _gaussModel[ geomElement ] = gaussloc;
  }
}
template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setRow ( int  i,
T *  value 
) throw (MEDEXCEPTION) [inline, inherited]

Update values array in the j^{th} row of FIELD values array with the given ones and according to specified mode.

Definition at line 4289 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::setRow(int i, T* value) : ";
  int valIndex=i;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" ));

  if ( getGaussPresence() )
    static_cast<ArrayGauss *>(_value)->setRow(valIndex, value) ;
  else
    static_cast<ArrayNoGauss *>(_value)->setRow(valIndex, value) ;
}

Here is the caller graph for this function:

template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setValue ( T *  value) throw (MEDEXCEPTION) [inline, inherited]

This method makes it possible to have the field pointing to an existing value array.

Copy new values array in FIELD according to the given mode.

The ordering of the elements in the value array must conform to the MEDMEM ordering (I,K,J) : the outer loop is on the elements, the intermediate loop is on the Gauss points, the inner loop is on the components.

Array must have right size. If not results are unpredicable. In MED_FULL_INTERLACE mode, values are stored elementwise in X1,Y1,Z1,X2,Y2,Z2.. order. In MED_NO_INTERLACE mode, values are stored componentwise in X1,X2,X3,...,Y1,Y2,Y3,... order.

Definition at line 4276 of file MEDMEM_Field.hxx.

{
  if ( getGaussPresence() )
    static_cast<ArrayGauss *>(_value)->setPtr(value) ;
  else
    static_cast<ArrayNoGauss *>(_value)->setPtr(value) ;
}
template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setValueIJ ( int  i,
int  j,
value 
) throw (MEDEXCEPTION) [inline, inherited]

Sets the value of $ i^{th} $ element and $ j^{th}$ component with value.

Sets the value of i^{th} element and j^{th} component with the given one.

Definition at line 4320 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::setValueIJ(int i, int j, T value) : ";
  int valIndex=-1;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" ));

  if ( getGaussPresence() )
    static_cast<ArrayGauss *>(_value)->setIJ(valIndex,j,value) ;
  else
    static_cast<ArrayNoGauss *>(_value)->setIJ(valIndex,j,value) ;
}

Here is the caller graph for this function:

template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setValueIJByType ( int  i,
int  j,
int  t,
value 
) throw (MEDEXCEPTION) [inline, inherited]

Set the value of i^{th} element and j^{th} component with the given one.

Definition at line 4356 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::setValueIJByType(int i, int j, int t, T value) : ";
  if ( getInterlacingType() != MED_EN::MED_NO_INTERLACE_BY_TYPE )
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"not MED_NO_INTERLACE_BY_TYPE field" ));

  if ( getGaussPresence() )
    return static_cast<ArrayNoByTypeGauss *>(_value)->setIJByType(i,j,t,value) ;
  else
    return static_cast<ArrayNoByType *>(_value)->setIJByType(i,j,t,value) ;
}
template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setValueIJK ( int  i,
int  j,
int  k,
value 
) throw (MEDEXCEPTION) [inline, inherited]

Set the value of i^{th} element, j^{th} component and k^{th} gauss point with the given one.

Definition at line 4338 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::setValueIJ(int i, int j, T value) : ";
  int valIndex=-1;
  if (_support)
    valIndex = _support->getValIndFromGlobalNumber(i);
  else
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" ));

  if ( getGaussPresence() )
    static_cast<ArrayGauss *>(_value)->setIJK(valIndex,j,k,value) ;
  else
    static_cast<ArrayNoGauss *>(_value)->setIJK(valIndex,j,k,value) ;
}

Here is the caller graph for this function:

template<class T, class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::setValueIJKByType ( int  i,
int  j,
int  k,
int  t,
value 
) throw (MEDEXCEPTION) [inline, inherited]

Set the value of component of k^{th} gauss points of i^{th} element and j^{th} component with the given one.

Definition at line 4371 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::setValueIJKByType(int i, int j, int t, int k, T value) : ";
  if ( getInterlacingType() != MED_EN::MED_NO_INTERLACE_BY_TYPE )
    throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"not MED_NO_INTERLACE_BY_TYPE field" ));

  if ( getGaussPresence() )
    return static_cast<ArrayNoByTypeGauss *>(_value)->setIJKByType(i,j,k,t,value) ;
  else
    return static_cast<ArrayNoByType *>(_value)->setIJKByType(i,j,k,t,value) ;
}
template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::write ( int  index = 0) [inline, inherited]

Writes FIELD in the file specified by the driver handle index.

Example :

//...
// Attaching the friver to file "output.med", meshname "Mesh"
int driver_handle = mesh.addDriver(MED_DRIVER, "output.med", "Mesh");
// Writing the content of mesh to the file 
mesh.write(driver_handle);

Definition at line 3279 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::write(int index=0, const string & driverName = \"\") : ";
  BEGIN_OF_MED(LOC);

  if( index>=0 && index<(int)_drivers.size() && _drivers[index] ) {
    _drivers[index]->open();
    try
    {
      _drivers[index]->write();
    }
    catch ( const MEDEXCEPTION& ex )
    {
      _drivers[index]->close();
      throw ex;
    }
    _drivers[index]->close();
  }
  else
    throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
                                     << "The index given is invalid, index must be between  0 and |"
                                     << _drivers.size()
                                     )
                          );
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::write ( const GENDRIVER &  driver,
MED_EN::med_mode_acces  medMode = MED_EN::RDWR 
) [inline, inherited]

Write FIELD with the given driver.

Definition at line 3308 of file MEDMEM_Field.hxx.

{
  const char* LOC = " FIELD<T, INTERLACING_TAG>::write(const GENDRIVER &) : ";
  BEGIN_OF_MED(LOC);

  // For the case where driver does not know about me since it has been created through
  // constructor witout parameters: create newDriver knowing me and get missing data
  // from driver using merge()
  std::auto_ptr<GENDRIVER> newDriver( DRIVERFACTORY::buildDriverForField(driver.getDriverType(),
                                                                         driver.getFileName(),
                                                                         this, WRONLY));
  newDriver->merge( driver );
  if ( newDriver->getDriverType() == MED_DRIVER )
    newDriver->setAccessMode( MED_EN::med_mode_acces( getMedAccessMode( medMode ) ));

  newDriver->open();
  try
  {
    newDriver->write();
  }
  catch ( const MEDEXCEPTION& ex )
  {
    newDriver->close();
    throw ex;
  }
  newDriver->close();

  END_OF_MED(LOC);
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::write ( driverTypes  driverType,
const std::string &  filename,
MED_EN::med_mode_acces  medMode = MED_EN::RDWR 
) [inline, inherited]

Write FIELD with driver of the given type.

Definition at line 3341 of file MEDMEM_Field.hxx.

{
  const char* LOC = " FIELD<T, INTERLACING_TAG>::write(driverTypes driverType, const std::string& filename) : ";
  BEGIN_OF_MED(LOC);

  std::auto_ptr<GENDRIVER> newDriver( DRIVERFACTORY::buildDriverForField(driverType, filename,
                                                                         this, WRONLY));
  if ( newDriver->getDriverType() == MED_DRIVER )
    newDriver->setAccessMode( MED_EN::med_mode_acces( getMedAccessMode( medMode ) ));

  newDriver->open();
  try
  {
    newDriver->write();
  }
  catch ( const MEDEXCEPTION& ex )
  {
    newDriver->close();
    throw ex;
  }
  newDriver->close();

  END_OF_MED(LOC);
}

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::writeAppend ( int  index = 0,
const string &  driverName = "" 
) [inline, inherited]

Write FIELD in the file specified in the driver given by its index.

Use this method for ASCII drivers (e.g. VTK_DRIVER)

Definition at line 3371 of file MEDMEM_Field.hxx.

{
  const char * LOC = "FIELD<T,INTERLACING_TAG>::write(int index=0, const string & driverName = \"\") : ";
  BEGIN_OF_MED(LOC);

  if( index>=0 && index<(int)_drivers.size() && _drivers[index] ) {
    _drivers[index]->openAppend();
    if (driverName != "") _drivers[index]->setFieldName(driverName);
    try
    {
      _drivers[index]->writeAppend();
    }
    catch ( const MEDEXCEPTION& ex )
    {
      _drivers[index]->close();
      throw ex;
    }
    _drivers[index]->close();
  }
  else
    throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
                                     << "The index given is invalid, index must be between  0 and |"
                                     << _drivers.size()
                                     )
                          );
  END_OF_MED(LOC);
}

Here is the caller graph for this function:

template<class T , class INTERLACING_TAG >
void MEDMEM::FIELD< T, INTERLACING_TAG >::writeAppend ( const GENDRIVER &  genDriver) [inline, inherited]

Write FIELD with the driver which is equal to the given driver.

Use by MED object. Use this method for ASCII drivers (e.g. VTK_DRIVER).

Definition at line 3405 of file MEDMEM_Field.hxx.

{
  const char* LOC = " FIELD<T, INTERLACING_TAG>::write(const GENDRIVER &) : ";
  BEGIN_OF_MED(LOC);

  for (unsigned int index=0; index < _drivers.size(); index++ )
    if ( *_drivers[index] == genDriver ) {
      _drivers[index]->openAppend();
      try
      {
        _drivers[index]->writeAppend();
      }
      catch ( const MEDEXCEPTION& ex )
      {
        _drivers[index]->close();
        throw ex;
      }
      _drivers[index]->close();
    }

  END_OF_MED(LOC);

}

Friends And Related Function Documentation

template<class T, class INTERLACING_TAG>
friend class MED_FIELD_RDONLY_DRIVER< T > [friend, inherited]

Definition at line 930 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
friend class MED_FIELD_WRONLY_DRIVER< T > [friend, inherited]

Definition at line 931 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
friend class VTK_FIELD_DRIVER< T > [friend, inherited]

Definition at line 932 of file MEDMEM_Field.hxx.


Member Data Documentation

template<class T, class INTERLACING_TAG>
map<MED_EN::medGeometryElement,GAUSS_LOCALIZATION_*> MEDMEM::FIELD< T, INTERLACING_TAG >::_gaussModel [protected, inherited]

Definition at line 858 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
GMESH* MEDMEM::FIELD< T, INTERLACING_TAG >::_mesh [protected, inherited]

Definition at line 852 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
T MEDMEM::FIELD< T, INTERLACING_TAG >::_scalarForPow = 1 [static, protected, inherited]

Definition at line 860 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
Array* MEDMEM::FIELD< T, INTERLACING_TAG >::_value [protected, inherited]

Definition at line 848 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
T MEDMEM::FIELD< T, INTERLACING_TAG >::_vmax [protected, inherited]

Definition at line 856 of file MEDMEM_Field.hxx.

template<class T, class INTERLACING_TAG>
T MEDMEM::FIELD< T, INTERLACING_TAG >::_vmin [protected, inherited]

Definition at line 855 of file MEDMEM_Field.hxx.


The documentation for this class was generated from the following files: