Version: 6.5.0
Functions
Numerical operations on fields

Functions

FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::operator+ (const FIELD &m) const
FIELD & MEDMEM::FIELD< T, INTERLACING_TAG >::operator+= (const FIELD &m)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::add (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::addDeep (const FIELD &m, const FIELD &n)
FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::operator- (const FIELD &m) const
FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::operator- () const
FIELD & MEDMEM::FIELD< T, INTERLACING_TAG >::operator-= (const FIELD &m)
void MEDMEM::FIELD< T, INTERLACING_TAG >::applyLin (T a, T b, int icomp)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::sub (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::subDeep (const FIELD &m, const FIELD &n)
FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::operator* (const FIELD &m) const
FIELD & MEDMEM::FIELD< T, INTERLACING_TAG >::operator*= (const FIELD &m)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::mul (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::mulDeep (const FIELD &m, const FIELD &n)
FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::operator/ (const FIELD &m) const
FIELD & MEDMEM::FIELD< T, INTERLACING_TAG >::operator/= (const FIELD &m)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::div (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::divDeep (const FIELD &m, const FIELD &n)
double MEDMEM::FIELD< T, INTERLACING_TAG >::normMax () const throw (MEDEXCEPTION)
double MEDMEM::FIELD< T, INTERLACING_TAG >::norm2 () const throw (MEDEXCEPTION)
void MEDMEM::FIELD< T, INTERLACING_TAG >::getMinMax (T &vmin, T &vmax) throw (MEDEXCEPTION)
vector< int > MEDMEM::FIELD< T, INTERLACING_TAG >::getHistogram (int &nbint) throw (MEDEXCEPTION)
FIELD< double > * MEDMEM::FIELD< T, INTERLACING_TAG >::buildGradient () const throw (MEDEXCEPTION)
FIELD< double > * MEDMEM::FIELD< T, INTERLACING_TAG >::buildNorm2Field () const throw (MEDEXCEPTION)
template<T T_function>
void MEDMEM::FIELD< T, INTERLACING_TAG >::applyFunc ()
static T MEDMEM::FIELD< T, INTERLACING_TAG >::pow (T x)
void MEDMEM::FIELD< T, INTERLACING_TAG >::applyPow (T scalar)
void MEDMEM::FIELD< T, INTERLACING_TAG >::applyLin (T a, T b)
static FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::scalarProduct (const FIELD &m, const FIELD &n, bool deepCheck=false)
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL2 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL2 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL1 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL1 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD< T, INTERLACING_TAG >::integral (const SUPPORT *subSupport=NULL) const throw (MEDEXCEPTION)
FIELD * MEDMEM::FIELD< T, INTERLACING_TAG >::extract (const SUPPORT *subSupport) const throw (MEDEXCEPTION)

Detailed Description

This section groups together the different operators that enable the user to treat the FIELD objects as high-level numerical arrays, giving operators for numerical treatment (overloading of basic operators, algorithms, etc...)

Function Documentation

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::operator+ ( const FIELD< T, INTERLACING_TAG > &  m) const

Overload addition operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a + b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator + in associatives expressions like a = b + c + d +e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator+= ( const FIELD< T, INTERLACING_TAG > &  m)

Overloaded Operator += Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::add ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Addition of fields. Static member function. The function return a pointer to a new created field that holds the addition. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::addDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Same as add method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::operator- ( const FIELD< T, INTERLACING_TAG > &  m) const

Overload substraction operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a - b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator - in associatives expressions like a = b - c - d -e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::operator- ( ) const
template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator-= ( const FIELD< T, INTERLACING_TAG > &  m)

Overloaded Operator -= Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyLin ( a,
b,
int  icomp 
)

Apply to a given field component the linear function x -> ax+b. calculation is done "in place".

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::sub ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Substraction of fields. Static member function. The function return a pointer to a new created field that holds the substraction. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::subDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Same as sub method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::operator* ( const FIELD< T, INTERLACING_TAG > &  m) const

Overload multiplication operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a * b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator * in associatives expressions like a = b * c * d *e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator*= ( const FIELD< T, INTERLACING_TAG > &  m)

Overloaded Operator *= Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::mul ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Multiplication of fields. Static member function. The function return a pointer to a new created field that holds the multiplication. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::mulDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Same as mul method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::operator/ ( const FIELD< T, INTERLACING_TAG > &  m) const

Overload division operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a / b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator / in associatives expressions like a = b / c / d /e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator/= ( const FIELD< T, INTERLACING_TAG > &  m)

Overloaded Operator /= Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::div ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Division of fields. Static member function. The function return a pointer to a new created field that holds the division. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::divDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
)
static

Same as div method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACIN_TAG >
double MEDMEM::FIELD< T, INTERLACIN_TAG >::normMax ( ) const throw (MEDEXCEPTION)

Return maximum of all absolute values contained in the array (all elements and all components are browsed).

template<class T , class INTERLACIN_TAG >
double MEDMEM::FIELD< T, INTERLACIN_TAG >::norm2 ( ) const throw (MEDEXCEPTION)

Return Euclidian norm for all elements of the array.

template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::getMinMax ( T &  vmin,
T &  vmax 
) throw (MEDEXCEPTION)

Return Extrema of field

template<class T , class INTERLACIN_TAG >
vector< int > MEDMEM::FIELD< T, INTERLACIN_TAG >::getHistogram ( int &  nbint) throw (MEDEXCEPTION)

Return Histogram of field

template<class T , class INTERLACIN_TAG >
FIELD< double, FullInterlace > * MEDMEM::FIELD< T, INTERLACIN_TAG >::buildGradient ( ) const throw (MEDEXCEPTION)
template<class T , class INTERLACIN_TAG >
FIELD< double, FullInterlace > * MEDMEM::FIELD< T, INTERLACIN_TAG >::buildNorm2Field ( ) const throw (MEDEXCEPTION)
template<class T , class INTERLACIN_TAG >
template<T T_function>
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyFunc ( )

Apply to each (scalar) field component the template parameter T_function, which is a pointer to function. Since the pointer is known at compile time, the function is inlined into the inner loop! calculation is done "in place". Use examples :

myField.applyFunc<std::sqrt>(); // apply sqare root function
myField.applyFunc<myFunction>(); // apply your own created function
template<class T , class INTERLACIN_TAG >
T MEDMEM::FIELD< T, INTERLACIN_TAG >::pow ( x)
staticprotected
template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyPow ( scalar)

Apply to each (scalar) field component the math function pow. calculation is done "in place". Use examples :

myField.applyFunc<std::sqrt>(); // apply sqare root function
myField.applyFunc<myFunction>(); // apply your own created function
template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyLin ( a,
b 
)

Apply to each (scalar) field component the linear function x -> ax+b. calculation is done "in place".

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::scalarProduct ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n,
bool  deepCheck = false 
)
static

Return a pointer to a new field that holds the scalar product. Static member function. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits. Data members are initialized. The new field point to the same support and has one component. Each value of it is the scalar product of the two argument's fields. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getIterationNumber(), MEDMEM::FIELD_::getName(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), MEDMEM::FIELD_::getOrderNumber(), MEDMEM::FIELD_::getSupport(), MEDMEM::FIELD_::getTime(), MEDMEM::FIELD< T, INTERLACING_TAG >::getValue(), MEDMEM::FIELD_::setIterationNumber(), MEDMEM::FIELD_::setName(), MEDMEM::FIELD_::setOrderNumber(), and MEDMEM::FIELD_::setTime().

template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL2 ( int  component,
const FIELD< double, FullInterlace > *  p_field_volume = NULL 
) const

Return L2 Norm of the field's component. Cannot be applied to a field with a support on nodes. If the optional p_field_volume argument is furnished, the volume is not re-calculated. For the nodal field, p_field_volume must be for all cells even if the field is partial.

References MEDMEM::MESH::convertInMESH(), MEDMEM::MESH::getConnectivity(), MEDMEM::MESH::getConnectivityIndex(), MEDMEM::MESH::getNumberOfElements(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL2 ( const FIELD< double, FullInterlace > *  p_field_volume = NULL) const

Return L2 Norm of the field. If the optional p_field_volume argument is furnished, the volume is not re-calculated. For the nodal field, p_field_volume must be for all cells even if the field is partial.

References MEDMEM::MESH::convertInMESH(), MEDMEM::MESH::getConnectivity(), MEDMEM::MESH::getConnectivityIndex(), MEDMEM::MESH::getNumberOfElements(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL1 ( int  component,
const FIELD< double, FullInterlace > *  p_field_volume = NULL 
) const

Return L1 Norm of the field's component. If the optional p_field_volume argument is furnished, the volume is not re-calculated.

References MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL1 ( const FIELD< double, FullInterlace > *  p_field_volume = NULL) const

Return L1 Norm of the field. Cannot be applied to a field with a support on nodes. If the optional p_field_volume argument is furnished, the volume is not re-calculated.

References MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::integral ( const SUPPORT subSupport = NULL) const throw (MEDEXCEPTION)

Return integral of the field.

Parameters
subSupport- optional part of a field to consider.
Return values
double- value of integral

References MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::extract ( 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.

References MEDMEM::FIELD< T, INTERLACING_TAG >::_value, MEDMEM::FIELD_::copyGlobalInfo(), MEDMEM::FIELD< T, INTERLACING_TAG >::getNumberOfElements(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS