Version: 6.3.1
Functions

Numerical operations on fields

Functions

FIELDMEDMEM::FIELD.operator+ (const FIELD &m) const
FIELDMEDMEM::FIELD.operator+= (const FIELD &m)
static FIELDMEDMEM::FIELD.add (const FIELD &m, const FIELD &n)
static FIELDMEDMEM::FIELD.addDeep (const FIELD &m, const FIELD &n)
FIELDMEDMEM::FIELD.operator- (const FIELD &m) const
FIELDMEDMEM::FIELD.operator- () const
FIELDMEDMEM::FIELD.operator-= (const FIELD &m)
void MEDMEM::FIELD.applyLin (T a, T b, int icomp)
static FIELDMEDMEM::FIELD.sub (const FIELD &m, const FIELD &n)
static FIELDMEDMEM::FIELD.subDeep (const FIELD &m, const FIELD &n)
FIELDMEDMEM::FIELD.operator* (const FIELD &m) const
FIELDMEDMEM::FIELD.operator*= (const FIELD &m)
static FIELDMEDMEM::FIELD.mul (const FIELD &m, const FIELD &n)
static FIELDMEDMEM::FIELD.mulDeep (const FIELD &m, const FIELD &n)
FIELDMEDMEM::FIELD.operator/ (const FIELD &m) const
FIELDMEDMEM::FIELD.operator/= (const FIELD &m)
static FIELDMEDMEM::FIELD.div (const FIELD &m, const FIELD &n)
static FIELDMEDMEM::FIELD.divDeep (const FIELD &m, const FIELD &n)
double MEDMEM::FIELD.normMax () const throw (MEDEXCEPTION)
double MEDMEM::FIELD.norm2 () const throw (MEDEXCEPTION)
void MEDMEM::FIELD.getMinMax (T &vmin, T &vmax) throw (MEDEXCEPTION)
vector< intMEDMEM::FIELD.getHistogram (int &nbint) throw (MEDEXCEPTION)
FIELD< double > * MEDMEM::FIELD.buildGradient () const throw (MEDEXCEPTION)
FIELD< double > * MEDMEM::FIELD.buildNorm2Field () const throw (MEDEXCEPTION)
template<T T_function>
void MEDMEM::FIELD.applyFunc ()
static T MEDMEM::FIELD.pow (T x)
void MEDMEM::FIELD.applyPow (T scalar)
void MEDMEM::FIELD.applyLin (T a, T b)
static FIELDMEDMEM::FIELD.scalarProduct (const FIELD &m, const FIELD &n, bool deepCheck=false)
double MEDMEM::FIELD.normL2 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD.normL2 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD.normL1 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD.normL1 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD.integral (const SUPPORT *subSupport=NULL) const throw (MEDEXCEPTION)
 Return integral of the field.
FIELDMEDMEM::FIELD.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 [inherited]

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< T, INTERLACING_TAG >._add_in_place(), MEDMEM.FIELD_._checkFieldCompatibility(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), BEGIN_OF_MED, and END_OF_MED.

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

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(), BEGIN_OF_MED, END_OF_MED, MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), test_NonCoincidentDEC.size, and med_test1.value1.

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, inherited]

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< T, INTERLACING_TAG >._add_in_place(), MEDMEM.FIELD_._checkFieldCompatibility(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), BEGIN_OF_MED, END_OF_MED, 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, inherited]
template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM.FIELD< T, INTERLACING_TAG >::operator- ( const FIELD< T, INTERLACING_TAG > &  m) const [inherited]

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(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), MEDMEM.FIELD< T, INTERLACING_TAG >._sub_in_place(), BEGIN_OF_MED, and END_OF_MED.

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

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(), BEGIN_OF_MED, END_OF_MED, MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), test_NonCoincidentDEC.size, and med_test1.value1.

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

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

References testGaussLocalization.b, and test_NonCoincidentDEC.size.

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, inherited]

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< T, INTERLACING_TAG >._operationInitialize(), MEDMEM.FIELD< T, INTERLACING_TAG >._sub_in_place(), BEGIN_OF_MED, END_OF_MED, 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, inherited]
template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM.FIELD< T, INTERLACING_TAG >::operator* ( const FIELD< T, INTERLACING_TAG > &  m) const [inherited]

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(), MEDMEM.FIELD< T, INTERLACING_TAG >._mul_in_place(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), BEGIN_OF_MED, and END_OF_MED.

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

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(), BEGIN_OF_MED, END_OF_MED, MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), test_NonCoincidentDEC.size, and med_test1.value1.

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, inherited]

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< T, INTERLACING_TAG >._mul_in_place(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), BEGIN_OF_MED, END_OF_MED, 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, inherited]
template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM.FIELD< T, INTERLACING_TAG >::operator/ ( const FIELD< T, INTERLACING_TAG > &  m) const [inherited]

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(), MEDMEM.FIELD< T, INTERLACING_TAG >._div_in_place(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), BEGIN_OF_MED, END_OF_MED, and MEDMEM.RCBASE.removeReference().

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

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(), BEGIN_OF_MED, END_OF_MED, MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), test_NonCoincidentDEC.size, and med_test1.value1.

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, inherited]

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< T, INTERLACING_TAG >._div_in_place(), MEDMEM.FIELD< T, INTERLACING_TAG >._operationInitialize(), BEGIN_OF_MED, END_OF_MED, MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getSupport(), and MEDMEM.RCBASE.removeReference().

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, inherited]
template<class T , class INTERLACIN_TAG >
double MEDMEM.FIELD< T, INTERLACIN_TAG >::normMax ( ) const throw (MEDEXCEPTION) [inherited]

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

References test_NonCoincidentDEC.size, and batchmode_medcorba_test.value.

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

Return Euclidian norm for all elements of the array.

References test_NonCoincidentDEC.size, and batchmode_medcorba_test.value.

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

Return Extrema of field

References test_NonCoincidentDEC.size, and batchmode_medcorba_test.value.

template<class T , class INTERLACIN_TAG >
vector< int > MEDMEM.FIELD< T, INTERLACIN_TAG >::getHistogram ( int nbint) throw (MEDEXCEPTION) [inherited]

Return Histogram of field

References test_NonCoincidentDEC.size, and batchmode_medcorba_test.value.

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

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 

References test_NonCoincidentDEC.size, and batchmode_medcorba_test.value.

template<class T, class INTERLACIN_TAG >
T MEDMEM.FIELD< T, INTERLACIN_TAG >::pow ( x) [static, protected, inherited]
template<class T, class INTERLACIN_TAG >
void MEDMEM.FIELD< T, INTERLACIN_TAG >::applyPow ( scalar) [inherited]

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 
) [inherited]

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

References testGaussLocalization.b, test_NonCoincidentDEC.size, and batchmode_medcorba_test.value.

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, inherited]

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(), medMeshing_test.numberOfElements, MEDMEM.FIELD_.setIterationNumber(), MEDMEM.FIELD_.setName(), MEDMEM.FIELD_.setOrderNumber(), MEDMEM.FIELD_.setTime(), batchmode_medcorba_test.value, med_test1.value1, and med_test1.value2.

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

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.RCBASE.addReference(), MEDMEM.MEDMEM_Array< ARRAY_ELEMENT_TYPE, INTERLACING_POLICY, CHECKING_POLICY >.getIJ(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), MED_EN.MED_NO_INTERLACE, MED_EN.MED_NO_INTERLACE_BY_TYPE, MEDMEM.RCBASE.removeReference(), and batchmode_medcorba_test.value.

template<class T , class INTERLACING_TAG >
double MEDMEM.FIELD< T, INTERLACING_TAG >::integral ( const SUPPORT subSupport = NULL) const throw (MEDEXCEPTION) [inherited]
template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM.FIELD< T, INTERLACING_TAG >::extract ( const SUPPORT subSupport) const throw (MEDEXCEPTION) [inherited]

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(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), MED_EN.MED_ALL_ELEMENTS, and testMEDMEM.ret.

Copyright © 2007-2011 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