From: Michael NDJINGA Date: Mon, 14 Sep 2020 12:49:59 +0000 (+0200) Subject: Corrected environment files and enabled testing X-Git-Tag: V9_6_0~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=73fd276900065e404d9220a49f765a3c69f080e0;p=tools%2Fsolverlab.git Corrected environment files and enabled testing --- diff --git a/CDMATH/base/inc/GenericMatrix.hxx b/CDMATH/base/inc/GenericMatrix.hxx index 3cf2231..77735d5 100755 --- a/CDMATH/base/inc/GenericMatrix.hxx +++ b/CDMATH/base/inc/GenericMatrix.hxx @@ -53,6 +53,10 @@ class GenericMatrix virtual double operator ()( int i, int j ) const = 0; + double max() const; + + double min() const; + virtual bool isSymmetric(double tol=1e-6) const ; bool isSquare() const ; diff --git a/CDMATH/base/src/GenericMatrix.cxx b/CDMATH/base/src/GenericMatrix.cxx old mode 100644 new mode 100755 index f9e15be..0d2f5eb --- a/CDMATH/base/src/GenericMatrix.cxx +++ b/CDMATH/base/src/GenericMatrix.cxx @@ -98,6 +98,21 @@ GenericMatrix::coefficient(int index) const return (-1); } + +double +GenericMatrix::max() const +{ + return _values.max(); +} + + +double +GenericMatrix::min() const +{ + return _values.max(); +} + + void GenericMatrix::view() const { diff --git a/CDMATH/mesh/inc/Field.hxx b/CDMATH/mesh/inc/Field.hxx index 752f15c..4323fe0 100755 --- a/CDMATH/mesh/inc/Field.hxx +++ b/CDMATH/mesh/inc/Field.hxx @@ -243,7 +243,7 @@ class Field void setFieldByDataArrayDouble ( const MEDCoupling::DataArrayDouble* array ); - DoubleTab getNormEuclidean( void ) const ; + Vector getNormEuclidean( void ) const ; double max( int component=0 ) const ; diff --git a/CDMATH/mesh/src/Field.cxx b/CDMATH/mesh/src/Field.cxx index 64044f6..699285d 100755 --- a/CDMATH/mesh/src/Field.cxx +++ b/CDMATH/mesh/src/Field.cxx @@ -401,18 +401,21 @@ Field::readFieldMed( const std::string & fileNameRadical, } -DoubleTab +Vector Field::getNormEuclidean() const { - DoubleTab norm(getNumberOfElements(),_field->magnitude()->getArray()->getConstPointer()); - return norm; + Vector result(_numberOfComponents); + DoubleTab norm(_numberOfComponents,_field->magnitude()->getArray()->getConstPointer()); + result.setValues(norm); + + return result; } double Field::max(int component) const { - if( component >= getNumberOfComponents() ) - throw CdmathException("double Field::max() : component number should be smaller than field number of components"); + if( component >= getNumberOfComponents() || component < 0) + throw CdmathException("double Field::max() : component number should be between 0 and the field number of components"); double result=-1e100; for(int i=0; i= getNumberOfComponents() ) - throw CdmathException("double Field::min() : component number should be smaller than field number of components"); + if( component >= getNumberOfComponents() || component < 0) + throw CdmathException("double Field::min() : component number should be between 0 and the field number of components"); double result=1e100; for(int i=0; igetNumberOfComponents(); - int nbElems=getNumberOfElements(); - - Vector result(nbComp);//Vector containing the Linfinity norm of each component + double res[nbComp];//Pointer containing the L2 norm of each component + _field->normMax(res); + Vector result(nbComp);//Vector containing the L2 norm of each component - for(int i=0; iresult(j)) - result(j)=fabs((*this)(i,j)); + for(int i=0; i