diff --git a/examples/navier-stokes/navierStokesSolver_impl.h b/examples/navier-stokes/navierStokesSolver_impl.h index 528e84ccfa9107e74819046fcada6cc13dba53e7..f10e8eb64c7f157f8dd2426baa8e65e51e9f55af 100644 --- a/examples/navier-stokes/navierStokesSolver_impl.h +++ b/examples/navier-stokes/navierStokesSolver_impl.h @@ -51,9 +51,6 @@ navierStokesSolver< Mesh, EulerScheme > :: navierStokesSolver() T( 0.0 ), rhsIndex( 0 ) { - - this -> mesh. setName( "navier-stokes-mesh" ); - this -> dofVector. setName( "navier-stokes-dof-vector" ); } template< typename Mesh, typename EulerScheme > diff --git a/src/core/arrays/tnlArray.h b/src/core/arrays/tnlArray.h index 6ebf9399b58afc449d8f5ec3fefa9cdfcd0df2cd..fb6e017b80938cfc09a0919c3d0b0eed37da8072 100644 --- a/src/core/arrays/tnlArray.h +++ b/src/core/arrays/tnlArray.h @@ -42,8 +42,6 @@ class tnlArray : public virtual tnlObject tnlArray(); - tnlArray( const tnlString& name ); - static tnlString getType(); tnlString getTypeVirtual() const; diff --git a/src/core/arrays/tnlArray_impl.h b/src/core/arrays/tnlArray_impl.h index 3655f886914843aa421983532d67cf3743f3a7db..dff8c2502de1447564b049ad5632370c1051f788 100644 --- a/src/core/arrays/tnlArray_impl.h +++ b/src/core/arrays/tnlArray_impl.h @@ -36,15 +36,6 @@ tnlArray< Element, Device, Index > :: tnlArray() { }; -template< typename Element, - typename Device, - typename Index > -tnlArray< Element, Device, Index > :: tnlArray( const tnlString& name ) -: size( 0 ), data( 0 ) -{ - this -> setName( name ); -}; - template< typename Element, typename Device, typename Index > @@ -88,7 +79,6 @@ bool tnlArray< Element, Device, Index > :: setSize( const Index size ) { tnlAssert( size >= 0, cerr << "You try to set size of tnlArray to negative value." - << "Name: " << this -> getName() << endl << "New size: " << size << endl ); if( this->size == size ) return true; if( this->data ) @@ -101,8 +91,7 @@ bool tnlArray< Element, Device, Index > :: setSize( const Index size ) if( ! this->data ) { cerr << "I am not able to allocate new array with size " - << ( double ) this->size * sizeof( ElementType ) / 1.0e9 << " GB for " - << this->getName() << "." << endl; + << ( double ) this->size * sizeof( ElementType ) / 1.0e9 << " GB." << endl; this -> size = 0; return false; } @@ -117,8 +106,6 @@ bool tnlArray< Element, Device, Index > :: setLike( const Array& array ) { tnlAssert( array. getSize() >= 0, cerr << "You try to set size of tnlArray to negative value." - << "Name: " << this -> getName() << endl - << "Array name:" << array. getName() << "Array size: " << array. getSize() << endl ); return setSize( array.getSize() ); }; @@ -157,8 +144,7 @@ template< typename Element, void tnlArray< Element, Device, Index > :: setElement( const Index i, const Element& x ) { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for setElement method in tnlArray with name " - << this -> getName() + cerr << "Wrong index for setElement method in tnlArray " << " index is " << i << " and array size is " << this -> getSize() ); return tnlArrayOperations< Device > :: setMemoryElement( &( this -> data[ i ] ), x ); @@ -170,8 +156,7 @@ template< typename Element, Element tnlArray< Element, Device, Index > :: getElement( Index i ) const { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for getElement method in tnlArray with name " - << this -> getName() + cerr << "Wrong index for getElement method in tnlArray " << " index is " << i << " and array size is " << this -> getSize() ); return tnlArrayOperations< Device > :: getMemoryElement( & ( this -> data[ i ] ) ); @@ -184,8 +169,7 @@ __cuda_callable__ Element& tnlArray< Element, Device, Index > :: operator[] ( Index i ) { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for operator[] in tnlArray with name " - << this -> getName() + cerr << "Wrong index for operator[] in tnlArray " << " index is " << i << " and array size is " << this -> getSize() ); return this->data[ i ]; @@ -198,8 +182,7 @@ __cuda_callable__ const Element& tnlArray< Element, Device, Index > :: operator[] ( Index i ) const { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for operator[] in tnlArray with name " - << this -> getName() + cerr << "Wrong index for operator[] in tnlArray " << " index is " << i << " and array size is " << this -> getSize() ); return this->data[ i ]; @@ -212,9 +195,7 @@ tnlArray< Element, Device, Index >& tnlArray< Element, Device, Index > :: operator = ( const tnlArray< Element, Device, Index >& array ) { tnlAssert( array. getSize() == this -> getSize(), - cerr << "Source name: " << array. getName() << endl - << "Source size: " << array. getSize() << endl - << "Target name: " << this -> getName() << endl + cerr << "Source size: " << array. getSize() << endl << "Target size: " << this -> getSize() << endl ); tnlArrayOperations< Device > :: template copyMemory< Element, @@ -234,9 +215,7 @@ tnlArray< Element, Device, Index >& tnlArray< Element, Device, Index > :: operator = ( const Array& array ) { tnlAssert( array. getSize() == this -> getSize(), - cerr << "Source name: " << array. getName() << endl - << "Source size: " << array. getSize() << endl - << "Target name: " << this -> getName() << endl + cerr << "Source size: " << array. getSize() << endl << "Target size: " << this -> getSize() << endl ); tnlArrayOperations< Device, typename Array :: DeviceType > :: @@ -339,7 +318,6 @@ bool tnlArray< Element, Device, Index > :: save( tnlFile& file ) const if( this -> size != 0 && ! tnlArrayIO< Element, Device, Index >::save( file, this -> data, this -> size ) ) { cerr << "I was not able to save " << this->getType() - << " " << this -> getName() << " with size " << this -> getSize() << endl; return false; } @@ -372,7 +350,6 @@ bool tnlArray< Element, Device, Index > :: load( tnlFile& file ) if( ! tnlArrayIO< Element, Device, Index >::load( file, this -> data, this -> size ) ) { cerr << "I was not able to load " << this->getType() - << " " << this -> getName() << " with size " << this -> getSize() << endl; return false; } diff --git a/src/core/arrays/tnlConstSharedArray_impl.h b/src/core/arrays/tnlConstSharedArray_impl.h index 49b525a77fe014faa06df9dd9085bbad41e4b75b..ce0065859c45fe94f40c8879307f6f5e55e46045 100644 --- a/src/core/arrays/tnlConstSharedArray_impl.h +++ b/src/core/arrays/tnlConstSharedArray_impl.h @@ -78,11 +78,9 @@ void tnlConstSharedArray< Element, Device, Index > :: bind( const Element* data, { tnlAssert( size >= 0, cerr << "You try to set size of tnlConstSharedArray to negative value." - << "Name: " << this -> getName() << endl << "New size: " << size << endl ); tnlAssert( data != 0, - cerr << "You try to use null pointer to data for tnlConstSharedArray." - << "Name: " << this -> getName() ); + cerr << "You try to use null pointer to data for tnlConstSharedArray." ); this -> size = size; this -> data = data; @@ -141,7 +139,6 @@ Element tnlConstSharedArray< Element, Device, Index > :: getElement( Index i ) c { tnlAssert( 0 <= i && i < this -> getSize(), cerr << "Wrong index for getElement method in tnlConstSharedArray with name " - << this -> getName() << " index is " << i << " and array size is " << this -> getSize() ); return tnlArrayOperations< Device >::getMemoryElement( &( this -> data[ i ] ) ); @@ -155,7 +152,6 @@ const Element& tnlConstSharedArray< Element, Device, Index > :: operator[] ( Ind { tnlAssert( 0 <= i && i < this -> getSize(), cerr << "Wrong index for operator[] in tnlConstSharedArray with name " - << this -> getName() << " index is " << i << " and array size is " << this -> getSize() ); // TODO: add static assert - this does not make sense for tnlCudaDevice @@ -241,7 +237,7 @@ template< typename Element, bool tnlConstSharedArray< Element, Device, Index > :: save( tnlFile& file ) const { tnlAssert( this -> size != 0, - cerr << "You try to save empty array. Its name is " << this -> getName() ); + cerr << "You try to save empty array." ); if( ! tnlObject :: save( file ) ) return false; #ifdef HAVE_NOT_CXX11 @@ -252,7 +248,7 @@ bool tnlConstSharedArray< Element, Device, Index > :: save( tnlFile& file ) cons return false; if( ! file. write< Element, Device, Index >( this -> data, this -> size ) ) { - cerr << "I was not able to WRITE tnlConstSharedArray " << this -> getName() + cerr << "I was not able to WRITE tnlConstSharedArray " << " with size " << this -> getSize() << endl; return false; } diff --git a/src/core/arrays/tnlMultiArray.h b/src/core/arrays/tnlMultiArray.h index eb24d7afa552628755684120d775a35ea0b89987..0a9345d5b791152ec8c421ed0de1f62669e2d999 100644 --- a/src/core/arrays/tnlMultiArray.h +++ b/src/core/arrays/tnlMultiArray.h @@ -43,8 +43,6 @@ class tnlMultiArray< 1, Element, Device, Index > : public tnlArray< Element, Dev tnlMultiArray(); - tnlMultiArray( const tnlString& name ); - static tnlString getType(); tnlString getTypeVirtual() const; @@ -124,8 +122,6 @@ class tnlMultiArray< 2, Element, Device, Index > : public tnlArray< Element, Dev tnlMultiArray(); - tnlMultiArray( const tnlString& name ); - static tnlString getType(); tnlString getTypeVirtual() const; @@ -209,8 +205,6 @@ class tnlMultiArray< 3, Element, Device, Index > : public tnlArray< Element, Dev tnlMultiArray(); - tnlMultiArray( const tnlString& name ); - static tnlString getType(); tnlString getTypeVirtual() const; @@ -294,8 +288,6 @@ class tnlMultiArray< 4, Element, Device, Index > : public tnlArray< Element, Dev tnlMultiArray(); - tnlMultiArray( const tnlString& name ); - static tnlString getType(); tnlString getTypeVirtual() const; diff --git a/src/core/arrays/tnlMultiArray1D_impl.h b/src/core/arrays/tnlMultiArray1D_impl.h index b45aabdedb0bf4b5f5d8cb72a2d39070597cd98b..2ac13a53af9fc4bc71a5a5f1f48f1c6ab66d26fd 100644 --- a/src/core/arrays/tnlMultiArray1D_impl.h +++ b/src/core/arrays/tnlMultiArray1D_impl.h @@ -23,12 +23,6 @@ tnlMultiArray< 1, Element, Device, Index > :: tnlMultiArray() { } -template< typename Element, typename Device, typename Index > -tnlMultiArray< 1, Element, Device, Index > :: tnlMultiArray( const tnlString& name ) -{ - this -> setName( name ); -} - template< typename Element, typename Device, typename Index > tnlString tnlMultiArray< 1, Element, Device, Index > :: getType() { @@ -155,10 +149,8 @@ bool tnlMultiArray< 1, Element, Device, Index > :: operator == ( const MultiArra // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to compare two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); return tnlArray< Element, Device, Index > :: operator == ( array ); } @@ -176,10 +168,8 @@ tnlMultiArray< 1, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -192,10 +182,8 @@ tnlMultiArray< 1, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -205,14 +193,12 @@ bool tnlMultiArray< 1, Element, Device, Index > :: save( tnlFile& file ) const { if( ! tnlArray< Element, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiArray." << endl; return false; } return true; @@ -223,14 +209,12 @@ bool tnlMultiArray< 1, Element, Device, Index > :: load( tnlFile& file ) { if( ! tnlArray< Element, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiArray." << endl; return false; } return true; diff --git a/src/core/arrays/tnlMultiArray2D_impl.h b/src/core/arrays/tnlMultiArray2D_impl.h index cc10ee13d4ccb96750a2f63df0e02932bbc2c27e..2b51149244a19719c77cfe01b65f47c5484739de 100644 --- a/src/core/arrays/tnlMultiArray2D_impl.h +++ b/src/core/arrays/tnlMultiArray2D_impl.h @@ -25,13 +25,6 @@ tnlMultiArray< 2, Element, Device, Index > :: tnlMultiArray() { } -template< typename Element, typename Device, typename Index > -tnlMultiArray< 2, Element, Device, Index > :: tnlMultiArray( const tnlString& name ) -{ - this -> setName( name ); -} - - template< typename Element, typename Device, typename Index > tnlString tnlMultiArray< 2, Element, Device, Index > :: getType() { @@ -168,10 +161,8 @@ bool tnlMultiArray< 2, Element, Device, Index > :: operator == ( const MultiArra // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to compare two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); return tnlArray< Element, Device, Index > :: operator == ( array ); } @@ -189,10 +180,8 @@ tnlMultiArray< 2, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -205,10 +194,8 @@ tnlMultiArray< 2, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -218,14 +205,12 @@ bool tnlMultiArray< 2, Element, Device, Index > :: save( tnlFile& file ) const { if( ! tnlArray< Element, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiArray." << endl; return false; } return true; @@ -236,14 +221,12 @@ bool tnlMultiArray< 2, Element, Device, Index > :: load( tnlFile& file ) { if( ! tnlArray< Element, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiArray." << endl; return false; } return true; diff --git a/src/core/arrays/tnlMultiArray3D_impl.h b/src/core/arrays/tnlMultiArray3D_impl.h index 3cd8dfbd237ba327d54d77d9359041320b95ead0..25a91599dfa95d51d2817818315a711ce3adc916 100644 --- a/src/core/arrays/tnlMultiArray3D_impl.h +++ b/src/core/arrays/tnlMultiArray3D_impl.h @@ -25,12 +25,6 @@ tnlMultiArray< 3, Element, Device, Index > :: tnlMultiArray() { } -template< typename Element, typename Device, typename Index > -tnlMultiArray< 3, Element, Device, Index > :: tnlMultiArray( const tnlString& name ) -{ - this -> setName( name ); -} - template< typename Element, typename Device, typename Index > tnlString tnlMultiArray< 3, Element, Device, Index > :: getType() { @@ -191,10 +185,8 @@ bool tnlMultiArray< 3, Element, Device, Index > :: operator == ( const MultiArra // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to compare two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); return tnlArray< Element, Device, Index > :: operator == ( array ); } @@ -212,10 +204,8 @@ tnlMultiArray< 3, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -228,10 +218,8 @@ tnlMultiArray< 3, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -241,14 +229,12 @@ bool tnlMultiArray< 3, Element, Device, Index > :: save( tnlFile& file ) const { if( ! tnlArray< Element, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiArray." << endl; return false; } return true; @@ -259,14 +245,12 @@ bool tnlMultiArray< 3, Element, Device, Index > :: load( tnlFile& file ) { if( ! tnlArray< Element, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiArray." << endl; return false; } return true; diff --git a/src/core/arrays/tnlMultiArray4D_impl.h b/src/core/arrays/tnlMultiArray4D_impl.h index a2ebfcd21f709f8da7ad77d1ec96d3ee54f03a06..67d492fa119a6b6b980e5228702b060a694becfc 100644 --- a/src/core/arrays/tnlMultiArray4D_impl.h +++ b/src/core/arrays/tnlMultiArray4D_impl.h @@ -25,12 +25,6 @@ tnlMultiArray< 4, Element, Device, Index > :: tnlMultiArray() { } -template< typename Element, typename Device, typename Index > -tnlMultiArray< 4, Element, Device, Index > :: tnlMultiArray( const tnlString& name ) -{ - this -> setName( name ); -} - template< typename Element, typename Device, typename Index > tnlString tnlMultiArray< 4, Element, Device, Index > :: getType() { @@ -205,10 +199,8 @@ bool tnlMultiArray< 4, Element, Device, Index > :: operator == ( const MultiArra // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to compare two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); return tnlArray< Element, Device, Index > :: operator == ( array ); } @@ -226,10 +218,8 @@ tnlMultiArray< 4, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -242,10 +232,8 @@ tnlMultiArray< 4, Element, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == array. getDimensions(), cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << array. getName() - << " dimensions are ( " << array. getDimensions() << " )" << endl; ); + << "First array dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second array dimensions are ( " << array. getDimensions() << " )" << endl; ); tnlArray< Element, Device, Index > :: operator = ( array ); return ( *this ); } @@ -255,14 +243,12 @@ bool tnlMultiArray< 4, Element, Device, Index > :: save( tnlFile& file ) const { if( ! tnlArray< Element, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiArray." << endl; return false; } return true; @@ -273,14 +259,12 @@ bool tnlMultiArray< 4, Element, Device, Index > :: load( tnlFile& file ) { if( ! tnlArray< Element, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlArray of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the tnlArray of tnlMultiArray." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiArray " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiArray." << endl; return false; } return true; diff --git a/src/core/arrays/tnlSharedArray_impl.h b/src/core/arrays/tnlSharedArray_impl.h index c58802aef78569d31543cfb22f2028abea756347..8ec3257f4963dabaa28e97e1e685e007b7e57f2b 100644 --- a/src/core/arrays/tnlSharedArray_impl.h +++ b/src/core/arrays/tnlSharedArray_impl.h @@ -104,11 +104,9 @@ void tnlSharedArray< Element, Device, Index > :: bind( Element* data, { tnlAssert( size >= 0, cerr << "You try to set size of tnlSharedArray to negative value." - << "Name: " << this -> getName() << endl << "New size: " << size << endl ); tnlAssert( data != 0, - cerr << "You try to use null pointer to data for tnlSharedArray." - << "Name: " << this -> getName() ); + cerr << "You try to use null pointer to data for tnlSharedArray." ); this -> size = size; this -> data = data; @@ -184,8 +182,7 @@ template< typename Element, void tnlSharedArray< Element, Device, Index > :: setElement( const Index i, const Element& x ) { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for setElement method in tnlSharedArray with name " - << this -> getName() + cerr << "Wrong index for setElement method in tnlSharedArray " << " index is " << i << " and array size is " << this -> getSize() ); return tnlArrayOperations< Device >::setMemoryElement( & ( this -> data[ i ] ), x ); @@ -197,8 +194,7 @@ template< typename Element, Element tnlSharedArray< Element, Device, Index > :: getElement( Index i ) const { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for getElement method in tnlSharedArray with name " - << this -> getName() + cerr << "Wrong index for getElement method in tnlSharedArray " << " index is " << i << " and array size is " << this -> getSize() ); return tnlArrayOperations< Device >::getMemoryElement( &( this -> data[ i ] ) ); @@ -211,8 +207,7 @@ __cuda_callable__ Element& tnlSharedArray< Element, Device, Index > :: operator[] ( Index i ) { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for operator[] in tnlSharedArray with name " - << this -> getName() + cerr << "Wrong index for operator[] in tnlSharedArray " << " index is " << i << " and array size is " << this -> getSize() ); return this->data[ i ]; @@ -225,8 +220,7 @@ __cuda_callable__ const Element& tnlSharedArray< Element, Device, Index > :: operator[] ( Index i ) const { tnlAssert( 0 <= i && i < this -> getSize(), - cerr << "Wrong index for operator[] in tnlSharedArray with name " - << this -> getName() + cerr << "Wrong index for operator[] in tnlSharedArray " << " index is " << i << " and array size is " << this -> getSize() ); return this->data[ i ]; @@ -239,9 +233,7 @@ tnlSharedArray< Element, Device, Index >& tnlSharedArray< Element, Device, Index > :: operator = ( const tnlSharedArray< Element, Device, Index >& array ) { tnlAssert( array. getSize() == this -> getSize(), - cerr << "Source name: " << array. getName() << endl - << "Source size: " << array. getSize() << endl - << "Target name: " << this -> getName() << endl + cerr << "Source size: " << array. getSize() << endl << "Target size: " << this -> getSize() << endl ); tnlArrayOperations< Device > :: template copyMemory< Element, @@ -260,9 +252,7 @@ template< typename Element, tnlSharedArray< Element, Device, Index >& tnlSharedArray< Element, Device, Index > :: operator = ( const Array& array ) { tnlAssert( array. getSize() == this -> getSize(), - cerr << "Source name: " << array. getName() << endl - << "Source size: " << array. getSize() << endl - << "Target name: " << this -> getName() << endl + cerr << "Source size: " << array. getSize() << endl << "Target size: " << this -> getSize() << endl ); tnlArrayOperations< typename Array :: DeviceType, Device > :: @@ -307,8 +297,7 @@ template< typename Element, typename Index > void tnlSharedArray< Element, Device, Index > :: setValue( const Element& e ) { - tnlAssert( this -> size != 0, - cerr << "Array name is " << this -> getName() ); + tnlAssert( this -> size != 0, ); tnlArrayOperations< Device >::template setMemory< Element, Index > ( this -> getData(), e, this -> getSize() ); @@ -354,7 +343,7 @@ template< typename Element, bool tnlSharedArray< Element, Device, Index > :: save( tnlFile& file ) const { tnlAssert( this -> size != 0, - cerr << "You try to save empty array. Its name is " << this -> getName() ); + cerr << "You try to save empty array." << endl ); if( ! tnlObject :: save( file ) ) return false; #ifdef HAVE_NOT_CXX11 @@ -365,8 +354,7 @@ bool tnlSharedArray< Element, Device, Index > :: save( tnlFile& file ) const return false; if( ! file. write< Element, Device, Index >( this -> data, this -> size ) ) { - cerr << "I was not able to WRITE tnlSharedArray " << this -> getName() - << " with size " << this -> getSize() << endl; + cerr << "I was not able to WRITE tnlSharedArray with size " << this -> getSize() << endl; return false; } return true; @@ -398,16 +386,14 @@ bool tnlSharedArray< Element, Device, Index > :: load( tnlFile& file ) if( _size != this->size ) { cerr << "Error: The size " << _size << " of the data to be load is different from the " << - "allocated array. This is not possible in the shared array ( in " << this->getName() << - " )." << endl; + "allocated array. This is not possible in the shared array." << endl; return false; } if( _size ) { if( ! file. read< Element, Device, Index >( this -> data, this -> size ) ) { - cerr << "I was not able to READ tnlSharedArray " << this -> getName() - << " with size " << this -> getSize() << endl; + cerr << "I was not able to READ tnlSharedArray with size " << this -> getSize() << endl; return false; } } diff --git a/src/core/containers/tnlContainer_impl.h b/src/core/containers/tnlContainer_impl.h index 5a0d10946a70d18cdc5894c685dc95d858fefb21..7a536a860e43ba433574a7809e1c5ae0827ef6ab 100644 --- a/src/core/containers/tnlContainer_impl.h +++ b/src/core/containers/tnlContainer_impl.h @@ -88,8 +88,7 @@ bool tnlContainer< Element, Device, Index >::save( tnlFile& file ) const if( ! tnlObject::save( file ) || ! this->data.save( file ) ) { - cerr << "I am no able to save " << this->getType() - << " " << this->getName() << "." << endl; + cerr << "I am no able to save " << this->getType() << "." << endl; return false; } return true; @@ -101,8 +100,7 @@ bool tnlContainer< Element, Device, Index >::load( tnlFile& file ) if( ! tnlObject::load( file ) || ! this->data.load( file ) ) { - cerr << "I am no able to load " << this->getType() - << " " << this->getName() << "." << endl; + cerr << "I am no able to load " << this->getType() << "." << endl; return false; } return true; diff --git a/src/core/containers/tnlStaticContainer_impl.h b/src/core/containers/tnlStaticContainer_impl.h index 2ea081a9a3bdfda26577cc086832ef55de3c558d..009e43b89947d7c6bf4a396eadb41908ec348865 100644 --- a/src/core/containers/tnlStaticContainer_impl.h +++ b/src/core/containers/tnlStaticContainer_impl.h @@ -70,8 +70,7 @@ bool tnlStaticContainer< Size, Element >::save( tnlFile& file ) const if( ! tnlObject::save( file ) || ! this->data.save( file ) ) { - cerr << "I am no able to save " << this->getType() - << " " << this->getName() << "." << endl; + cerr << "I am no able to save " << this->getType() << "." << endl; return false; } return true; @@ -83,8 +82,7 @@ bool tnlStaticContainer< Size, Element >::load( tnlFile& file ) if( ! tnlObject::load( file ) || ! this->data.load( file ) ) { - cerr << "I am no able to load " << this->getType() - << " " << this->getName() << "." << endl; + cerr << "I am no able to load " << this->getType() << "." << endl; return false; } return true; diff --git a/src/core/tnlCurve.h b/src/core/tnlCurve.h index 89ead3407a12a45bb3846b8bef24520f6af633ae..dce343e3ee02435933fd6599427ce1f66e9b31a3 100644 --- a/src/core/tnlCurve.h +++ b/src/core/tnlCurve.h @@ -184,14 +184,12 @@ template< class T > bool Write( const tnlCurve< T >& curve, tnlFile file; if( ! file. open( tnlString( file_name ) + tnlString( ".tnl" ), tnlWriteMode ) ) { - cerr << "I am not able to open the file " << file_name << " for drawing curve " - << curve. getName() <<"." << endl; + cerr << "I am not able to open the file " << file_name << " for drawing curve." << endl; return false; } if( ! curve. save( file ) ) { - cerr << "I am not able to write to the file " << file_name << " for drawing grid " - << curve. getName() <<"." << endl; + cerr << "I am not able to write to the file " << file_name << " for drawing grid." << endl; return false; } file. close(); @@ -202,8 +200,7 @@ template< class T > bool Write( const tnlCurve< T >& curve, file. open( file_name, ios :: out ); if( ! file ) { - cerr << "I am not able to to open the file " << file_name << " for drawing curve " - << curve. getName() <<"." << endl; + cerr << "I am not able to to open the file " << file_name << " for drawing curve." << endl; return false; } bool result = Write( curve, file, format, step ); diff --git a/src/core/tnlObject.cpp b/src/core/tnlObject.cpp index 6e32643b6896feda8f1ed2a1592bbffe07d7fb40..f4b2ed0f13184a20c3fb421b90fb04876f088a18 100644 --- a/src/core/tnlObject.cpp +++ b/src/core/tnlObject.cpp @@ -25,21 +25,15 @@ #include <cstring> #include <stdio.h> -const char magic_number[] = "SIM33"; +const char magic_number[] = "TNLMN"; tnlObject :: tnlObject() -: name( "<no name>" ) { - dbgFunctionName( "tnlObject", "tnlObject" ); - dbgCout( "Initiating object " << getName() ); } tnlObject :: tnlObject( const tnlString& _name ) -: name( _name ) { - dbgFunctionName( "tnlObject", "tnlObject" ); - dbgCout( "Initiating object " << getName() ); } tnlString tnlObject :: getType() @@ -62,16 +56,6 @@ tnlString tnlObject :: getSerializationTypeVirtual() const return this->getSerializationType(); } -void tnlObject :: setName( const tnlString& name) -{ - this -> name = name; -} - -const tnlString& tnlObject :: getName() const -{ - return name; -} - bool tnlObject :: save( tnlFile& file ) const { dbgFunctionName( "tnlObject", "Save" ); @@ -82,9 +66,7 @@ bool tnlObject :: save( tnlFile& file ) const if( ! file. write( magic_number, strlen( magic_number ) ) ) #endif return false; - dbgCout( "Writing object name " << name ); - if( ! this->getSerializationTypeVirtual().save( file ) || - ! name. save( file ) ) return false; + if( ! this->getSerializationTypeVirtual().save( file ) ) return false; return true; } @@ -100,8 +82,6 @@ bool tnlObject :: load( tnlFile& file ) cerr << "Given file contains instance of " << objectType << " but " << getSerializationTypeVirtual() << " is expected." << endl; return false; } - dbgCout( "Reading object name " ); - if( ! name. load( file ) ) return false; return true; } @@ -144,7 +124,6 @@ bool tnlObject :: load( const tnlString& fileName ) bool getObjectType( tnlFile& file, tnlString& type ) { dbgFunctionName( "", "getObjectType" ); - dbgCout( "Checking magic number." ); char mn[ 10 ]; #ifdef HAVE_NOT_CXX11 if( ! file. read< char, tnlHost, int >( mn, strlen( magic_number ) ) ) @@ -155,7 +134,8 @@ bool getObjectType( tnlFile& file, tnlString& type ) cerr << "Unable to read file " << file. getFileName() << " ... " << endl; return false; } - if( strncmp( mn, magic_number, 5 ) != 0 ) return false; + if( strncmp( mn, magic_number, 5 ) != 0 && + strncmp( mn, "SIM33", 5 ) != 0 ) return false; if( ! type. load( file ) ) return false; return true; } diff --git a/src/core/tnlObject.h b/src/core/tnlObject.h index ad6338bd5e348364168cb0133c7365cd52319d1c..be9f0f26d7cc4b7969978aab0d407dd8fda5db72 100644 --- a/src/core/tnlObject.h +++ b/src/core/tnlObject.h @@ -61,16 +61,6 @@ class tnlObject virtual tnlString getSerializationTypeVirtual() const; - /**** - * Name getter - */ - void setName( const tnlString& name ); - - /**** - * Name getter - */ - const tnlString& getName() const; - //! Method for saving the object to a file as a binary data virtual bool save( tnlFile& file ) const; @@ -84,10 +74,6 @@ class tnlObject //! Destructor virtual ~tnlObject(){}; - protected: - - //! Object name - tnlString name; }; bool getObjectType( tnlFile& file, tnlString& type ); diff --git a/src/core/vectors/tnlMultiVector1D_impl.h b/src/core/vectors/tnlMultiVector1D_impl.h index 6e1b6a6695f41c38454f24a8493d9ae68b4bbe90..1fe506de95cbb7890a50f3df9c8485aa3a70650e 100644 --- a/src/core/vectors/tnlMultiVector1D_impl.h +++ b/src/core/vectors/tnlMultiVector1D_impl.h @@ -25,12 +25,6 @@ tnlMultiVector< 1, Real, Device, Index > :: tnlMultiVector() { } -template< typename Real, typename Device, typename Index > -tnlMultiVector< 1, Real, Device, Index > :: tnlMultiVector( const tnlString& name ) -{ - this -> setName( name ); -} - template< typename Real, typename Device, typename Index > tnlString tnlMultiVector< 1, Real, Device, Index > :: getType() { @@ -147,10 +141,8 @@ bool tnlMultiVector< 1, Real, Device, Index > :: operator == ( const MultiVector // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to compare two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First Vector name dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second Vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); return tnlVector< Real, Device, Index > :: operator == ( Vector ); } @@ -168,10 +160,8 @@ tnlMultiVector< 1, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -184,10 +174,8 @@ tnlMultiVector< 1, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -197,14 +185,12 @@ bool tnlMultiVector< 1, Real, Device, Index > :: save( tnlFile& file ) const { if( ! tnlVector< Real, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiVector." << endl; return false; } return true; @@ -215,14 +201,12 @@ bool tnlMultiVector< 1, Real, Device, Index > :: load( tnlFile& file ) { if( ! tnlVector< Real, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiVector." << endl; return false; } return true; diff --git a/src/core/vectors/tnlMultiVector2D_impl.h b/src/core/vectors/tnlMultiVector2D_impl.h index a964b062e641695bfcc29f30861c4c43b50f35f4..be3f3874d9f68504a3b9ff4ea09cc39f7c9fe3e8 100644 --- a/src/core/vectors/tnlMultiVector2D_impl.h +++ b/src/core/vectors/tnlMultiVector2D_impl.h @@ -25,13 +25,6 @@ tnlMultiVector< 2, Real, Device, Index > :: tnlMultiVector() { } -template< typename Real, typename Device, typename Index > -tnlMultiVector< 2, Real, Device, Index > :: tnlMultiVector( const tnlString& name ) -{ - this -> setName( name ); -} - - template< typename Real, typename Device, typename Index > tnlString tnlMultiVector< 2, Real, Device, Index > :: getType() { @@ -155,10 +148,8 @@ bool tnlMultiVector< 2, Real, Device, Index > :: operator == ( const MultiVector // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to compare two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); return tnlVector< Real, Device, Index > :: operator == ( Vector ); } @@ -176,10 +167,8 @@ tnlMultiVector< 2, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -192,10 +181,8 @@ tnlMultiVector< 2, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -205,14 +192,12 @@ bool tnlMultiVector< 2, Real, Device, Index > :: save( tnlFile& file ) const { if( ! tnlVector< Real, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiVector." << endl; return false; } return true; @@ -223,14 +208,12 @@ bool tnlMultiVector< 2, Real, Device, Index > :: load( tnlFile& file ) { if( ! tnlVector< Real, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiVector." << endl; return false; } return true; diff --git a/src/core/vectors/tnlMultiVector3D_impl.h b/src/core/vectors/tnlMultiVector3D_impl.h index 3a19302c373be1f7b56db3fee36b688aa6aa6a04..a549954007be0df8a18ba2461688de0ac6d59065 100644 --- a/src/core/vectors/tnlMultiVector3D_impl.h +++ b/src/core/vectors/tnlMultiVector3D_impl.h @@ -25,12 +25,6 @@ tnlMultiVector< 3, Real, Device, Index > :: tnlMultiVector() { } -template< typename Real, typename Device, typename Index > -tnlMultiVector< 3, Real, Device, Index > :: tnlMultiVector( const tnlString& name ) -{ - this -> setName( name ); -} - template< typename Real, typename Device, typename Index > tnlString tnlMultiVector< 3, Real, Device, Index > :: getType() { @@ -174,10 +168,8 @@ bool tnlMultiVector< 3, Real, Device, Index > :: operator == ( const MultiVector // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to compare two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); return tnlVector< Real, Device, Index > :: operator == ( Vector ); } @@ -195,10 +187,8 @@ tnlMultiVector< 3, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -211,10 +201,8 @@ tnlMultiVector< 3, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -224,14 +212,12 @@ bool tnlMultiVector< 3, Real, Device, Index > :: save( tnlFile& file ) const { if( ! tnlVector< Real, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiVector." << endl; return false; } return true; @@ -242,14 +228,12 @@ bool tnlMultiVector< 3, Real, Device, Index > :: load( tnlFile& file ) { if( ! tnlVector< Real, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiVector." << endl; return false; } return true; diff --git a/src/core/vectors/tnlMultiVector4D_impl.h b/src/core/vectors/tnlMultiVector4D_impl.h index b843e4838df4691c6f101bdc793e3dad71c7aebe..2e34a41bbae4458b3c912c7107494bd9370f2015 100644 --- a/src/core/vectors/tnlMultiVector4D_impl.h +++ b/src/core/vectors/tnlMultiVector4D_impl.h @@ -25,12 +25,6 @@ tnlMultiVector< 4, Real, Device, Index > :: tnlMultiVector() { } -template< typename Real, typename Device, typename Index > -tnlMultiVector< 4, Real, Device, Index > :: tnlMultiVector( const tnlString& name ) -{ - this -> setName( name ); -} - template< typename Real, typename Device, typename Index > tnlString tnlMultiVector< 4, Real, Device, Index > :: getType() { @@ -191,10 +185,8 @@ bool tnlMultiVector< 4, Real, Device, Index > :: operator == ( const MultiVector // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to compare two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); return tnlVector< Real, Device, Index > :: operator == ( Vector ); } @@ -212,10 +204,8 @@ tnlMultiVector< 4, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -228,10 +218,8 @@ tnlMultiVector< 4, Real, Device, Index >& // TODO: Static assert on dimensions tnlAssert( this -> getDimensions() == Vector. getDimensions(), cerr << "You are attempting to assign two Vectors with different dimensions." << endl - << "First Vector name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second Vector is " << Vector. getName() - << " dimensions are ( " << Vector. getDimensions() << " )" << endl; ); + << "First vector dimensions are ( " << this -> getDimensions() << " )" << endl + << "Second vector dimensions are ( " << Vector. getDimensions() << " )" << endl; ); tnlVector< Real, Device, Index > :: operator = ( Vector ); return ( *this ); } @@ -241,14 +229,12 @@ bool tnlMultiVector< 4, Real, Device, Index > :: save( tnlFile& file ) const { if( ! tnlVector< Real, Device, Index > :: save( file ) ) { - cerr << "I was not able to write the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. save( file ) ) { - cerr << "I was not able to write the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to write the dimensions of tnlMultiVector." << endl; return false; } return true; @@ -259,14 +245,12 @@ bool tnlMultiVector< 4, Real, Device, Index > :: load( tnlFile& file ) { if( ! tnlVector< Real, Device, Index > :: load( file ) ) { - cerr << "I was not able to read the tnlVector of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the tnlVector of tnlMultiVector." << endl; return false; } if( ! dimensions. load( file ) ) { - cerr << "I was not able to read the dimensions of tnlMultiVector " - << this -> getName() << endl; + cerr << "I was not able to read the dimensions of tnlMultiVector." << endl; return false; } return true; diff --git a/src/core/vectors/tnlVector.h b/src/core/vectors/tnlVector.h index be32ab03b7eaab1b199cc55d71ec1e9f15a9c51c..a5c029e1048ba973e9aa915787231371c742a55d 100644 --- a/src/core/vectors/tnlVector.h +++ b/src/core/vectors/tnlVector.h @@ -39,9 +39,7 @@ class tnlVector : public tnlArray< Real, Device, Index > tnlVector(); - tnlVector( const tnlString& name ); - - tnlVector( const tnlString& name, const Index size ); + tnlVector( const Index size ); static tnlString getType(); diff --git a/src/core/vectors/tnlVectorOperationsCuda_impl.h b/src/core/vectors/tnlVectorOperationsCuda_impl.h index 41d537fb5f9c4cb85bd7e4bf503048765b43198b..ccd191e63fd521f48f63d44039525e9d844071cd 100644 --- a/src/core/vectors/tnlVectorOperationsCuda_impl.h +++ b/src/core/vectors/tnlVectorOperationsCuda_impl.h @@ -45,8 +45,7 @@ typename Vector :: RealType tnlVectorOperations< tnlCuda > :: getVectorMax( cons typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result( 0 ); tnlParallelReductionMax< Real, Index > operation; @@ -64,8 +63,7 @@ typename Vector :: RealType tnlVectorOperations< tnlCuda > :: getVectorMin( cons typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result( 0 ); tnlParallelReductionMin< Real, Index > operation; @@ -83,8 +81,7 @@ typename Vector :: RealType tnlVectorOperations< tnlCuda > :: getVectorAbsMax( c typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result( 0 ); tnlParallelReductionAbsMax< Real, Index > operation; @@ -102,8 +99,7 @@ typename Vector :: RealType tnlVectorOperations< tnlCuda > :: getVectorAbsMin( c typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result( 0 ); tnlParallelReductionAbsMin< Real, Index > operation; @@ -122,8 +118,7 @@ typename Vector :: RealType tnlVectorOperations< tnlCuda > :: getVectorLpNorm( c typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); tnlAssert( p > 0.0, cerr << " p = " << p ); @@ -144,8 +139,7 @@ typename Vector :: RealType tnlVectorOperations< tnlCuda > :: getVectorSum( cons typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result( 0 ); tnlParallelReductionSum< Real, Index > operation; @@ -164,10 +158,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); tnlParallelReductionDiffMax< Real, Index > operation; @@ -186,10 +178,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); tnlParallelReductionDiffMin< Real, Index > operation; @@ -209,10 +199,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); tnlParallelReductionDiffAbsMax< Real, Index > operation; @@ -231,10 +219,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); tnlParallelReductionDiffAbsMin< Real, Index > operation; @@ -258,10 +244,8 @@ getVectorDifferenceLpNorm( const Vector1& v1, tnlAssert( p > 0.0, cerr << " p = " << p ); - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); tnlParallelReductionDiffLpNorm< Real, Index > operation; @@ -281,10 +265,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); tnlParallelReductionDiffSum< Real, Index > operation; @@ -319,8 +301,7 @@ void tnlVectorOperations< tnlCuda > :: vectorScalarMultiplication( Vector& v, typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); #ifdef HAVE_CUDA dim3 blockSize( 0 ), gridSize( 0 ); @@ -345,10 +326,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getScalarProduct( typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result( 0 ); /*#if defined HAVE_CUBLAS && defined HAVE_CUDA @@ -402,10 +381,8 @@ void tnlVectorOperations< tnlCuda > :: addVector( Vector1& y, typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( y. getSize() > 0, - cerr << "Vector name is " << y. getName() ); - tnlAssert( y. getSize() == x. getSize(), - cerr << "Vector names are " << x. getName() << " and " << y. getName() ); + tnlAssert( y. getSize() > 0, ); + tnlAssert( y. getSize() == x. getSize(), ); tnlAssert( y.getData() != 0, ); tnlAssert( x.getData() != 0, ); @@ -476,12 +453,9 @@ addVectors( Vector1& v, typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v.getSize() > 0, - cerr << "Vector name is " << v.getName() ); - tnlAssert( v.getSize() == v1.getSize(), - cerr << "Vector names are " << v.getName() << " and " << v1.getName() ); - tnlAssert( v.getSize() == v2.getSize(), - cerr << "Vector names are " << v.getName() << " and " << v2.getName() ); + tnlAssert( v.getSize() > 0, ); + tnlAssert( v.getSize() == v1.getSize(), ); + tnlAssert( v.getSize() == v2.getSize(), ); tnlAssert( v.getData() != 0, ); tnlAssert( v1.getData() != 0, ); tnlAssert( v2.getData() != 0, ); diff --git a/src/core/vectors/tnlVectorOperationsHost_impl.h b/src/core/vectors/tnlVectorOperationsHost_impl.h index 29d8485eb08c20501b6cefe1c49bb3e055fb091a..25de5f300e536a261b0528ac1ea40e719eda07e5 100644 --- a/src/core/vectors/tnlVectorOperationsHost_impl.h +++ b/src/core/vectors/tnlVectorOperationsHost_impl.h @@ -42,8 +42,7 @@ typename Vector::RealType tnlVectorOperations< tnlHost >::getVectorMax( const Ve { typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result = v. getElement( 0 ); const Index n = v. getSize(); for( Index i = 1; i < n; i ++ ) @@ -56,8 +55,7 @@ typename Vector :: RealType tnlVectorOperations< tnlHost > :: getVectorMin( cons { typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result = v. getElement( 0 ); const Index n = v. getSize(); for( Index i = 1; i < n; i ++ ) @@ -70,8 +68,7 @@ typename Vector :: RealType tnlVectorOperations< tnlHost > :: getVectorAbsMax( c { typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result = fabs( v. getElement( 0 ) ); const Index n = v. getSize(); for( Index i = 1; i < n; i ++ ) @@ -85,8 +82,7 @@ typename Vector :: RealType tnlVectorOperations< tnlHost > :: getVectorAbsMin( c { typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result = fabs( v. getElement( 0 ) ); const Index n = v. getSize(); for( Index i = 1; i < n; i ++ ) @@ -101,8 +97,7 @@ typename Vector :: RealType tnlVectorOperations< tnlHost > :: getVectorLpNorm( c { typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); tnlAssert( p > 0.0, cerr << " p = " << p ); if( p == 1.0 ) @@ -137,8 +132,7 @@ typename Vector :: RealType tnlVectorOperations< tnlHost > :: getVectorSum( cons { typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); Real result = v. getElement( 0 ); const Index n = v. getSize(); @@ -153,10 +147,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getVectorDifferen { typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result = v1. getElement( 0 ) - v2. getElement( 0 ); const Index n = v1. getSize(); for( Index i = 1; i < n; i ++ ) @@ -171,10 +163,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result = v1. getElement( 0 ) - v2. getElement( 0 ); const Index n = v1. getSize(); @@ -190,10 +180,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result = fabs( v1. getElement( 0 ) - v2. getElement( 0 ) ); const Index n = v1. getSize(); @@ -209,10 +197,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result = fabs( v1. getElement( 0 ) - v2. getElement( 0 ) ); const Index n = v1. getSize(); @@ -232,10 +218,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getVectorDifferen tnlAssert( p > 0.0, cerr << " p = " << p ); - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); if( p == 1.0 ) { @@ -271,10 +255,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getVectorDifferen typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result = v1. getElement( 0 ) - v2. getElement( 0 ); const Index n = v1. getSize(); @@ -291,8 +273,7 @@ void tnlVectorOperations< tnlHost > :: vectorScalarMultiplication( Vector& v, typedef typename Vector :: RealType Real; typedef typename Vector :: IndexType Index; - tnlAssert( v. getSize() > 0, - cerr << "Vector name is " << v. getName() ); + tnlAssert( v. getSize() > 0, ); const Index n = v. getSize(); for( Index i = 0; i < n; i ++ ) @@ -307,10 +288,8 @@ typename Vector1 :: RealType tnlVectorOperations< tnlHost > :: getScalarProduct( typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v1. getSize() > 0, - cerr << "Vector name is " << v1. getName() ); - tnlAssert( v1. getSize() == v2. getSize(), - cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); + tnlAssert( v1. getSize() > 0, ); + tnlAssert( v1. getSize() == v2. getSize(), ); Real result = 0; const Index n = v1. getSize(); @@ -331,10 +310,8 @@ void tnlVectorOperations< tnlHost > :: addVector( Vector1& y, typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( x. getSize() > 0, - cerr << "Vector name is " << x. getName() ); - tnlAssert( x. getSize() == y. getSize(), - cerr << "Vector names are " << x. getName() << " and " << y. getName() ); + tnlAssert( x. getSize() > 0, ); + tnlAssert( x. getSize() == y. getSize(), ); const Index n = y. getSize(); if( thisMultiplicator == 1.0 ) @@ -360,13 +337,9 @@ addVectors( Vector1& v, typedef typename Vector1 :: RealType Real; typedef typename Vector1 :: IndexType Index; - tnlAssert( v.getSize() > 0, - cerr << "Vector name is " << v.getName() ); - tnlAssert( v.getSize() == v1.getSize(), - cerr << "Vector names are " << v.getName() << " and " << v1.getName() ); - tnlAssert( v.getSize() == v2.getSize(), - cerr << "Vector names are " << v.getName() << " and " << v2.getName() ); - + tnlAssert( v.getSize() > 0, ); + tnlAssert( v.getSize() == v1.getSize(), ); + tnlAssert( v.getSize() == v2.getSize(), ); const Index n = v.getSize(); if( thisMultiplicator == 1.0 ) diff --git a/src/core/vectors/tnlVector_impl.h b/src/core/vectors/tnlVector_impl.h index c0d08a6ae2baea5e04aabfb27479839707287439..4f7bfb8b5abb9afcca2378473026906794113b3c 100644 --- a/src/core/vectors/tnlVector_impl.h +++ b/src/core/vectors/tnlVector_impl.h @@ -31,17 +31,8 @@ tnlVector< Real, Device, Index > :: tnlVector() template< typename Real, typename Device, typename Index > -tnlVector< Real, Device, Index > :: tnlVector( const tnlString& name ) +tnlVector< Real, Device, Index > :: tnlVector( const Index size ) { - this -> setName( name ); -} - -template< typename Real, - typename Device, - typename Index > -tnlVector< Real, Device, Index > :: tnlVector( const tnlString& name, const Index size ) -{ - this -> setName( name ); this -> setSize( size ); } diff --git a/src/legacy/CMakeLists.txt b/src/legacy/CMakeLists.txt index e5716caa29486217a4d5d866609a145d3d74049d..d97b78740023dd147b62fba4d2fe2324aa8c27c4 100755 --- a/src/legacy/CMakeLists.txt +++ b/src/legacy/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_SUBDIRECTORY( core ) ADD_SUBDIRECTORY( diff ) -ADD_SUBDIRECTORY( mesh ) +#ADD_SUBDIRECTORY( mesh ) ADD_SUBDIRECTORY( solvers ) SET( headers ) diff --git a/src/legacy/benchmarks/matrix-solvers-benchmark.h b/src/legacy/benchmarks/matrix-solvers-benchmark.h index 01bc0824bccef1b6bee22564a8e8c8bd75191b4a..69325136ee7a5805964bdb71ffafc6fdf47baa94 100644 --- a/src/legacy/benchmarks/matrix-solvers-benchmark.h +++ b/src/legacy/benchmarks/matrix-solvers-benchmark.h @@ -256,7 +256,6 @@ bool benchmarkMatrix( const tnlParameterContainer& parameters ) typedef tnlCSRMatrix< Real, tnlHost, Index > csrMatrixType; tnlString inputFile = parameters. getParameter< tnlString >( "input-file" ); csrMatrixType csrMatrix; - csrMatrix.setName( "matrix-solvers-benchmark:csrMatrix" ); if( ! csrMatrix. load( inputFile ) ) { cerr << "Unable to load file " << inputFile << endl; diff --git a/src/legacy/benchmarks/tnlSpmvBenchmarkBase_impl.h b/src/legacy/benchmarks/tnlSpmvBenchmarkBase_impl.h index 9066c57d7e5b8b76806346e5651a5232c384210f..dd51338e56a6ad4251de8c0a9c49060a90897ad4 100644 --- a/src/legacy/benchmarks/tnlSpmvBenchmarkBase_impl.h +++ b/src/legacy/benchmarks/tnlSpmvBenchmarkBase_impl.h @@ -36,7 +36,6 @@ tnlSpmvBenchmarkBase< Matrix >::tnlSpmvBenchmarkBase() benchmarkStatusColumnWidth( 12 ), infoColumnWidth( 20 ) { - matrix.setName( "spmvBenchmark::matrix" ); } template< typename Matrix > diff --git a/src/legacy/diff/tnlMPIMesh2D.h b/src/legacy/diff/tnlMPIMesh2D.h index 83c6bbfa4fbaea36a32ccbdd4c97484ef20d268d..367f8f43696c00f13560ebfd08dbd793c6ad3930 100644 --- a/src/legacy/diff/tnlMPIMesh2D.h +++ b/src/legacy/diff/tnlMPIMesh2D.h @@ -460,7 +460,6 @@ bool tnlMPIMesh< 2, Real, Device, Index > :: CreateMesh( const tnlGridOld< 2, Re ay = u. GetAy(); hx = u. GetHx(); hy = u. GetHy(); - name. setString( u. getName(). getString() ); } :: MPIBcast< double >( ax, 1, root, original_comm ); :: MPIBcast< double >( ay, 1, root, original_comm ); @@ -483,7 +482,6 @@ bool tnlMPIMesh< 2, Real, Device, Index > :: CreateMesh( const tnlGridOld< 2, Re hx, hy ); //cout << "Node " << MPIGetRank() << " mesh size " // << sub_u -> GetXSize() << "x" << sub_u -> GetYSize() << endl; - sub_u. setName( name. getString() ); MPI_Allreduce( &err, &all_err, 1, MPI_INT,MPI_SUM, mesh_comm ); if( all_err != 0 ) return false; #else diff --git a/src/legacy/diff/tnlMPIMesh3D.h b/src/legacy/diff/tnlMPIMesh3D.h index 9e28be84b038ec68006788b27e4050fadb84ad09..30e3a2c31d44af200491348275daec2f8644dd53 100644 --- a/src/legacy/diff/tnlMPIMesh3D.h +++ b/src/legacy/diff/tnlMPIMesh3D.h @@ -578,7 +578,6 @@ bool tnlMPIMesh< 3, Real, Device, Index > :: CreateMesh( const tnlGridOld< 3, Re hx = u. GetHx(); hy = u. GetHy(); hz = u. GetHz(); - name. setString( u. getName(). getString() ); } :: MPIBcast< double >( ax, 1, root, original_comm ); :: MPIBcast< double >( ay, 1, root, original_comm ); @@ -614,7 +613,6 @@ bool tnlMPIMesh< 3, Real, Device, Index > :: CreateMesh( const tnlGridOld< 3, Re << " rank " << MPIGetRank( original_comm ) << "." << endl; err = 1; } - sub_u. setName( name. getString() ); dbgMPIBarrier; dbgCout( "Subdomain is as: Ax = " << sub_u. GetAx() << " Ay = " << sub_u. GetAy() << diff --git a/src/legacy/matrices/tnlAdaptiveRgCSRMatrix.h b/src/legacy/matrices/tnlAdaptiveRgCSRMatrix.h index d5e02d7712d2c91409d2e0a07ebd8178db9602a0..0f9e338bbac4cdd203916165435b7d17a411a98d 100644 --- a/src/legacy/matrices/tnlAdaptiveRgCSRMatrix.h +++ b/src/legacy/matrices/tnlAdaptiveRgCSRMatrix.h @@ -926,13 +926,14 @@ void tnlAdaptiveRgCSRMatrix< Real, Device, Index > :: printOutGroup( ostream& st template< typename Real, typename Device, typename Index > void tnlAdaptiveRgCSRMatrix< Real, Device, Index > :: printOut( ostream& str, + const tnlString& name, const tnlString& format, const Index lines ) const { if( format == "" || format == "text" ) { str << "Structure of tnlAdaptiveRgCSRMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << nonzeroElements. getSize() << endl; str << "Number of groups: " << numberOfGroups << endl; @@ -954,7 +955,7 @@ void tnlAdaptiveRgCSRMatrix< Real, Device, Index > :: printOut( ostream& str, if( format == "html" ) { str << "<h1>Structure of tnlAdaptiveRgCSRMatrix</h1>" << endl; - str << "<b>Matrix name:</b> " << this -> getName() << "<p>" << endl; + str << "<b>Matrix name:</b> " << name << "<p>" << endl; str << "<b>Matrix size:</b> " << this -> getSize() << "<p>" << endl; str << "<b>Allocated elements:</b> " << nonzeroElements. getSize() << "<p>" << endl; str << "<b>Number of groups:</b> " << this -> numberOfGroups << "<p>" << endl; diff --git a/src/legacy/matrices/tnlCSRMatrix.h b/src/legacy/matrices/tnlCSRMatrix.h index 79e531fd0452605b9a5b33f4ac0ca1490703a37a..b59f0e31397a5eda5f261c05575db22f84cf04f2 100644 --- a/src/legacy/matrices/tnlCSRMatrix.h +++ b/src/legacy/matrices/tnlCSRMatrix.h @@ -798,11 +798,12 @@ tnlCSRMatrix< Real, Device, Index >& tnlCSRMatrix< Real, Device, Index > :: oper template< typename Real, typename Device, typename Index > void tnlCSRMatrix< Real, Device, Index > :: printOut( ostream& str, + const tnlString& name, const tnlString& format, const Index lines ) const { str << "Structure of tnlCSRMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << nonzero_elements. getSize() << endl; str << "Matrix rows:" << endl; diff --git a/src/legacy/matrices/tnlEllpackMatrix.h b/src/legacy/matrices/tnlEllpackMatrix.h index 16146ec3f27626954a1b39e2f68b0ff716670075..33b3c28919b370a704b9b43e772a2580905e504d 100644 --- a/src/legacy/matrices/tnlEllpackMatrix.h +++ b/src/legacy/matrices/tnlEllpackMatrix.h @@ -308,10 +308,11 @@ void tnlEllpackMatrix< Real, tnlHost, Index > :: vectorProduct( const tnlVector< }; template< typename Real, typename Index > -void tnlEllpackMatrix< Real, tnlHost, Index > :: printOut( ostream& str ) const +void tnlEllpackMatrix< Real, tnlHost, Index > :: printOut( ostream& str, + const tnlString& name ) const { str << "Structure of tnlEllpackMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << ellpack_nonzero_elements. getSize() << endl; str << "Matrix row length:" << row_length << endl; @@ -328,6 +329,4 @@ void tnlEllpackMatrix< Real, tnlHost, Index > :: printOut( ostream& str ) const } } - - #endif /* TNLELLPACKMATRIX_H_ */ diff --git a/src/legacy/matrices/tnlFastCSRMatrix.h b/src/legacy/matrices/tnlFastCSRMatrix.h index b00df4b26605550ad2a9a8ca4468e0ca01fab0ab..ffd3c7dc179cfb5789b035aa598222ce719aa687 100644 --- a/src/legacy/matrices/tnlFastCSRMatrix.h +++ b/src/legacy/matrices/tnlFastCSRMatrix.h @@ -474,10 +474,11 @@ bool tnlFastCSRMatrix< Real, tnlHost, Index > :: Load( istream& file ) template< typename Real, typename Index > void tnlFastCSRMatrix< Real, tnlHost, Index > :: printOut( ostream& str, - const Index lines ) const + const tnlString& name, + const Index lines ) const { str << "Structure of tnlFastCSRMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << nonzero_elements. getSize() << endl; str << "Matrix rows:" << endl; diff --git a/src/legacy/matrices/tnlFastRgCSRMatrix.h b/src/legacy/matrices/tnlFastRgCSRMatrix.h index b5003985bd45645aadd720f8219300d9f05d5812..b11e0b1fb2dc659df73b27f7ae94d52d2a7c33ac 100644 --- a/src/legacy/matrices/tnlFastRgCSRMatrix.h +++ b/src/legacy/matrices/tnlFastRgCSRMatrix.h @@ -610,10 +610,11 @@ void tnlFastRgCSRMatrix< Real, tnlHost, Index > :: vectorProduct( const tnlVecto template< typename Real, typename Index > void tnlFastRgCSRMatrix< Real, tnlHost, Index > :: printOut( ostream& str, - const Index lines ) const + const tnlString& name, + const Index lines ) const { str << "Structure of tnlFastRgCSRMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << nonzero_elements. getSize() << endl; str << "Matrix blocks: " << block_offsets. getSize() << endl; diff --git a/src/legacy/matrices/tnlFastRgCSRMatrixCUDA.h b/src/legacy/matrices/tnlFastRgCSRMatrixCUDA.h index ba7ef95556c177f0077d860d1ed75a0f3bb4bea7..96f89a69fd2acdbbe9c6d0b0584ded7637358b16 100644 --- a/src/legacy/matrices/tnlFastRgCSRMatrixCUDA.h +++ b/src/legacy/matrices/tnlFastRgCSRMatrixCUDA.h @@ -350,10 +350,11 @@ void tnlFastRgCSRMatrix< Real, tnlCuda, Index > :: vectorProduct( const tnlVecto template< typename Real, typename Index > void tnlFastRgCSRMatrix< Real, tnlCuda, Index > :: printOut( ostream& str, - const int lines ) const + const tnlString& name, + const int lines ) const { str << "Structure of tnlFastRgCSRMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << nonzero_elements. getSize() << endl; str << "Matrix blocks: " << block_offsets. getSize() << endl; diff --git a/src/legacy/matrices/tnlMatrix.h b/src/legacy/matrices/tnlMatrix.h index c8245cde094eefb3e17883215e9e740827553e5e..db31c122a3103ee73942da5040a99e6ad91bbec9 100644 --- a/src/legacy/matrices/tnlMatrix.h +++ b/src/legacy/matrices/tnlMatrix.h @@ -188,7 +188,7 @@ Index tnlMatrix< Real, Device, Index > :: getArtificialZeroElements() const template< typename Real, typename Device, typename Index > Index tnlMatrix< Real, Device, Index > :: getNonzeroElementsInRow( const Index& row ) const { - tnlAssert( false, cerr << "not implemented yet - matrix name is " << this -> getName() ); + tnlAssert( false, cerr << "not implemented yet." ); /* * TODO: this method should be abstract */ diff --git a/src/legacy/matrices/tnlRgCSRMatrix.h b/src/legacy/matrices/tnlRgCSRMatrix.h index df7216035e61d000b2a19c2c5312f6fc15cd7bfb..f6d3f98bcdebd7e59908687ec757dff026d19e79 100644 --- a/src/legacy/matrices/tnlRgCSRMatrix.h +++ b/src/legacy/matrices/tnlRgCSRMatrix.h @@ -498,10 +498,12 @@ bool tnlRgCSRMatrix< Real, Device, Index > :: copyFrom( const tnlCSRMatrix< Real template< typename Real, typename Device, typename Index > template< typename Device2 > -bool tnlRgCSRMatrix< Real, Device, Index > :: copyFrom( const tnlRgCSRMatrix< Real, Device2, Index >& rgCSRMatrix ) +bool +tnlRgCSRMatrix< Real, Device, Index >:: +copyFrom( const tnlRgCSRMatrix< Real, Device2, Index >& rgCSRMatrix ) { dbgFunctionName( "tnlRgCSRMatrix< Real, Device, Index >", "copyFrom" ); - tnlAssert( rgCSRMatrix. getSize() > 0, cerr << "Copying from matrix " << rgCSRMatrix. getName() << " with non-positiove size." ); + tnlAssert( rgCSRMatrix. getSize() > 0, cerr << "Copying from matrix with non-positiove size." ); this -> cudaBlockSize = rgCSRMatrix. cudaBlockSize; this -> groupSize = rgCSRMatrix. groupSize; @@ -797,13 +799,14 @@ void tnlRgCSRMatrix< Real, Device, Index > :: vectorProduct( const tnlVector< Re template< typename Real, typename Device, typename Index > void tnlRgCSRMatrix< Real, Device, Index > :: printOut( ostream& str, + const tnlString& name, const tnlString& format, const Index lines ) const { if( format == "" || format == "text" ) { str << "Structure of tnlRgCSRMatrix" << endl; - str << "Matrix name:" << this -> getName() << endl; + str << "Matrix name:" << name << endl; str << "Matrix size:" << this -> getSize() << endl; str << "Allocated elements:" << nonzeroElements. getSize() << endl; str << "Number of groups: " << groupOffsets. getSize() << endl; @@ -851,7 +854,7 @@ void tnlRgCSRMatrix< Real, Device, Index > :: printOut( ostream& str, if( format == "html" ) { str << "<h1>Structure of tnlRgCSRMatrix</h1>" << endl; - str << "<b>Matrix name:</b> " << this -> getName() << "<p>" << endl; + str << "<b>Matrix name:</b> " << name << "<p>" << endl; str << "<b>Matrix size:</b> " << this -> getSize() << "<p>" << endl; str << "<b>Allocated elements:</b> " << nonzeroElements. getSize() << "<p>" << endl; str << "<b>Number of groups:</b> " << this -> numberOfGroups << "<p>" << endl; diff --git a/src/legacy/mesh/CMakeLists.txt b/src/legacy/mesh/CMakeLists.txt deleted file mode 100755 index bafbc607fa6e450304d74f49bb82a24d70449904..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -ADD_SUBDIRECTORY( implementation ) - -SET( headers tnlDistributedGrid.h - tnlGridOld.h ) - -set( tnl_legacy_mesh_SOURCES - ${tnl_legacy_mesh_implementation_SOURCES} - PARENT_SCOPE ) - -INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/legacy/mesh ) \ No newline at end of file diff --git a/src/legacy/mesh/implementation/CMakeLists.txt b/src/legacy/mesh/implementation/CMakeLists.txt deleted file mode 100644 index 13fd6057a11db6f1ca1cc9896619f9b68842dcb7..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/implementation/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -SET( headers tnlGrid1D_impl.h - tnlGrid2D_impl.h - tnlGrid3D_impl.h ) - -SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/legacy/mesh/implementation ) -set( tnl_legacy_mesh_implementation_SOURCES - ${CURRENT_DIR}/tnlGridOld_impl.cpp - PARENT_SCOPE ) - -INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/legacy/mesh/implementation ) \ No newline at end of file diff --git a/src/legacy/mesh/implementation/tnlGrid1D_impl.h b/src/legacy/mesh/implementation/tnlGrid1D_impl.h deleted file mode 100644 index e61c4122e86ad9ff509e19cc766f28e15943ec17..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/implementation/tnlGrid1D_impl.h +++ /dev/null @@ -1,751 +0,0 @@ -/*************************************************************************** - tnlGridOld1D_impl.h - description - ------------------- - begin : Nov 22, 2012 - copyright : (C) 2012 by Tomas Oberhuber - email : tomas.oberhuber@fjfi.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef tnlGridOld1D_IMPL_H_ -#define tnlGridOld1D_IMPL_H_ - -#ifdef HAVE_CUDA -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantDirichletBC( const Index xSize, - const Real bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setDirichletBC( const Index xSize, - const Real* bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantNeumannBC( const Index xSize, - const Real hx, - const Real bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setNeumannBC( const Index xSize, - const Real hx, - const Real* bc, - Real* u ); -#endif - -template< typename Real, typename Device, typename Index > -tnlGridOld< 1, Real, Device, Index > :: tnlGridOld() -{ -} - - -template< typename Real, typename Device, typename Index > -tnlGridOld< 1, Real, Device, Index > :: tnlGridOld( const tnlString& name ) -{ - this -> setName( name ); -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 1, Real, Device, Index > :: tnlGridOld( const tnlString& name, - const tnlGridOld< 1, Real, tnlHost, Index >& grid ) -{ - this -> setName( name ); - this -> setLike( grid ); -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 1, Real, Device, Index > :: tnlGridOld( const tnlString& name, - const tnlGridOld< 1, Real, tnlCuda, Index >& grid ) -{ - this -> setName( name ); - this -> setLike( grid ); -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 1, Index >& tnlGridOld< 1, Real, Device, Index > :: getDimensions() const -{ - return tnlMultiVector< 1, Real, Device, Index > :: getDimensions(); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: setDimensions( const tnlStaticVector< 1, Index >& dimensions ) -{ - if( ! tnlMultiVector< 1, Real, Device, Index > :: setDimensions( dimensions ) ) - return false; - spaceSteps[ 0 ] = ( domainUpperCorner[ 0 ] - domainLowerCorner[ 0 ] ) / ( Real ) ( this -> getDimensions()[ 0 ] - 1 ); - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: setDomain( const tnlStaticVector< 1, Real >& origin, - const tnlStaticVector< 1, Real >& proportions ) -{ - if( origin >= proportions ) - { - cerr << "Wrong parameters for the grid domain of " << this -> getName() << ". The low corner must by smaller than the high corner." << endl - << "origin = " << origin << endl << "proportions = " << proportions << endl; - return false; - } - domainLowerCorner = origin; - domainUpperCorner = proportions; - spaceSteps[ 0 ] = ( domainUpperCorner[ 0 ] - domainLowerCorner[ 0 ] ) / ( Real ) ( this -> getDimensions()[ 0 ] - 1 ); - return true; -} - -template< typename Real, typename Device, typename Index > - template< typename Grid > -bool tnlGridOld< 1, Real, Device, Index > :: setLike( const Grid& v ) -{ - return tnlMultiVector< 1, Real, Device, Index > :: setDimensions( v. getDimensions() ) && - this -> setDomain( v. getDomainLowerCorner(), v. getDomainUpperCorner() ); -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 1, Real >& tnlGridOld< 1, Real, Device, Index > :: getDomainLowerCorner() const -{ - return this -> domainLowerCorner; -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 1, Real >& tnlGridOld< 1, Real, Device, Index > :: getDomainUpperCorner() const -{ - return this -> domainUpperCorner; -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 1, Real >& tnlGridOld< 1, Real, Device, Index > :: getSpaceSteps() const -{ - return spaceSteps; -} - -template< typename Real, typename Device, typename Index > -tnlString tnlGridOld< 1, Real, Device, Index > :: getType() const -{ - return tnlString( "tnlGridOld< ") + - tnlString( "1" ) + - tnlString( ", " ) + - tnlString( ::getType< Real >() ) + - tnlString( ", " ) + - Device :: getDeviceType() + - tnlString( ", " ) + - tnlString( ::getType< Index >() ) + - tnlString( " >" ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: operator == ( const tnlGridOld< 1, Real, Device, Index >& grid ) const -{ - tnlAssert( this -> getDomainLowerCorner() == grid. getDomainLowerCorner() && - this -> getDomainUpperCorner() == grid. getDomainUpperCorner(), - cerr << "You are attempting to compare two grids with different domains." << endl - << "First grid name is " << this -> getName() - << " domain is ( " << this -> getDomainLowerCorner() << " )- (" - << this -> getDomainUpperCorner() << ")" << endl - << "Second grid is " << grid. getName() - << " domain is ( " << grid. getDomainLowerCorner() << " )- (" - << grid. getDomainUpperCorner() << ")" << endl; ); - return tnlMultiVector< 1, Real, Device, Index > :: operator == ( grid ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: operator != ( const tnlGridOld< 1, Real, Device, Index >& grid ) const -{ - return ! ( (* this ) == grid ); -} - -template< typename Real, typename Device, typename Index > - template< typename Real2, typename Device2, typename Index2 > -tnlGridOld< 1, Real, Device, Index >& -tnlGridOld< 1, Real, Device, Index > -:: operator = ( const tnlGridOld< 1, Real2, Device2, Index2 >& grid ) -{ - tnlMultiVector< 1, Real, Device, Index > :: operator = ( grid ); - return ( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getValue( const tnlStaticVector< 1, Real >& point ) const -{ - tnlAssert( 0, cerr << "Interpolation is not implemented yet."); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getValue( const Real& x ) const -{ - return this -> getValue( tnlStaticVector< 1, Real >( x ) ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: Partial_x_f( const Index i1 ) const -{ - tnlAssert( i1 >= 0 && - i1 < ( this -> getDimensions(). x() - 1 ), - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions(). y() - 1 ) << " )" << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElementIndex( i1 + 1 ) - - this -> getElementIndex( i1 ) ) / Hx; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: Partial_x_b( const Index i1 ) const -{ - tnlAssert( i1 > 0 && - i1 <= ( this -> getDimensions()[ tnlX ] - 1 ), - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 ) - - this -> getElement( i1 - 1 ) ) / Hx; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: Partial_x( const Index i1 ) const -{ - tnlAssert( i1 > 0 && - i1 < ( this -> getDimensions()[ tnlX ] - 1 ), - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1 ) - - this -> getElement( i1 - 1 ) ) / ( 2.0 * Hx ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: Partial_xx( const Index i1 ) const -{ - tnlAssert( i1 > 0 && - i1 < ( this -> getDimensions()[ tnlX ] - 1 ), - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1 ) - - 2.0 * this -> getElement( i1 ) + - this -> getElement( i1 - 1 ) ) / ( Hx * Hx ); -}; - - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: setDirichletBC( const tnlGridOld< 1, Real, Device, Index >&bc, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Index xSize = this -> getDimensions(). x(); - if( lowerBC. x() ) - ( *this )( 0 ) = bc( 0 ); - if( upperBC. x() ) - ( *this )( xSize - 1 ) = bc( xSize - 1 ); - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - { - tnlAssert( false, ); - /*const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setDirichletBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - bc. getData(), - this -> getData() );*/ - } -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: setDirichletBC( const Real& bcValue, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Index xSize = this -> getDimensions(). x(); - if( lowerBC. x() ) - ( *this )( 0 ) = bcValue; - if( upperBC. x() ) - ( *this )( xSize - 1 ) = bcValue; - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - tnlAssert( false, ); - /*{ - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setConstantDirichletBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - bcValue, - this -> getData() ); - }*/ -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: setNeumannBC( const tnlGridOld< 1, Real, Device, Index >&bc, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Real& hx = this -> getSpaceSteps(). x(); - - const Index xSize = this -> getDimensions(). x(); - if( lowerBC. x() ) - ( *this )( 0 ) = ( *this )( 1 ) + hx * bc( 0 ); - if( upperBC. x() ) - ( *this )( xSize - 1 ) = ( *this )( xSize - 1 ) + hx * bc( xSize -1 ); - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - tnlAssert( false, ); - /*{ - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - ::setNeumannBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - this -> getSpaceSteps(). x(), - this -> getSpaceSteps(). y(), - bc. getData(), - this -> getData() ); - }*/ -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: setNeumannBC( const Real& bcValue, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Real& hx = this -> getSpaceSteps(). x(); - - const Index xSize = this -> getDimensions(). x(); - if( lowerBC. x() ) - ( *this )( 0 ) = ( *this )( 1 ) + hx * bcValue; - if( upperBC. x() ) - ( *this )( xSize - 1 ) = ( *this )( xSize - 1 ) + hx * bcValue; - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - tnlAssert( false, ) - /*{ - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setConstantNeumannBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - this -> getSpaceSteps(). x(), - this -> getSpaceSteps(). y(), - bcValue, - this -> getData() ); - }*/ -#endif - } -} - -/* -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getMax() const -{ - return tnlMax( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getMin() const -{ - return tnlMin( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getAbsMax() const -{ - return tnlAbsMax( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getAbsMin() const -{ - return tnlAbsMin( * this ); -} -*/ - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getLpNorm( const Real& p ) const -{ - Real result = this -> lpNorm( p ); - return result * getSpaceSteps(). x(); -} - -/*template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getSum() const -{ - return tnlMultiVector< 1, Real, Device, Index > :: sum( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getDifferenceMax( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceMax( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getDifferenceMin( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceMin( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getDifferenceAbsMax( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceAbsMax( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getDifferenceAbsMin( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceAbsMin( *this ); -} -*/ - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getDifferenceLpNorm( const tnlVector< Real, Device, Index >& v, const Real& p ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - - Real result = v. differenceLpNorm( * this, p ); - return result * getSpaceSteps(). x(); -} - -/* -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: getDifferenceSum( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return this -> differenceSum( v ); -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: scalarMultiplication( const Real& alpha ) -{ - return this -> scalarMultiplication( alpha ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 1, Real, Device, Index > :: scalarProduct( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return this -> scalarProduct( v ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: alphaXPlusY( const Real& alpha, - const tnlVector< Real, Device, Index >& x ) -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - this -> alphaXPlusY( alpha, x ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 1, Real, Device, Index > :: saxmy( const Real& alpha, - const tnlVector< Real, Device, Index >& x ) -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - this -> saxmy( alpha, x ); -}; -*/ - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: save( tnlFile& file ) const -{ - if( ! tnlMultiVector< 1, Real, Device, Index > :: save( file ) ) - { - cerr << "I was not able to write the tnlMultiVector of the tnlGridOld " - << this -> getName() << endl; - return false; - } - if( ! domainLowerCorner. save( file ) || - ! domainUpperCorner. save( file ) || - ! spaceSteps. save( file ) ) - { - cerr << "I was not able to write the domain decsription of the tnlGridOld " - << this -> getName() << endl; - return false; - } - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: load( tnlFile& file ) -{ - if( ! tnlMultiVector< 1, Real, Device, Index > :: load( file ) ) - { - cerr << "I was not able to read the tnlMultiVector of the tnlGridOld " - << this -> getName() << endl; - return false; - } - if( ! domainLowerCorner. load( file ) || - ! domainUpperCorner. load( file ) || - ! spaceSteps. load( file ) ) - { - cerr << "I was not able to read the domain description of the tnlGridOld " - << this -> getName() << endl; - return false; - } - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: save( const tnlString& fileName ) const -{ - return tnlObject :: save( fileName ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: load( const tnlString& fileName ) -{ - return tnlObject :: load( fileName ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 1, Real, Device, Index > :: draw( const tnlString& fileName, - const tnlString& format, - const tnlStaticVector< 1, Index > steps ) const -{ - tnlAssert( steps > ( tnlStaticVector< 1, Index >( 0 ) ), - cerr << "Wrong steps of increment ( " << steps << " )" - << " for drawing the tnlGridOld " << this -> getName() << "." << endl; ); - if( format == "tnl" ) - return this -> save( fileName ); - fstream file; - file. open( fileName. getString(), ios :: out ); - if( ! file ) - { - cerr << " I am not able to open the file " << fileName - << " for drawing the tnlGridOld " << this -> getName() << "." << endl; - return false; - } - if( format == "gnuplot" ) - { - const Index xSize = this -> getDimensions()[ tnlX ]; - const Real& ax = this -> getDomainLowerCorner()[ tnlX ]; - const Real& hx = this -> getSpaceSteps()[ tnlX ]; - for( Index i = 0; i < xSize; i += steps[ tnlX ] ) - file << setprecision( 12 ) - << ax + i * hx * steps[ tnlX ] - << " " - << this -> getElement( i ) - << endl; - return true; - } - cerr << endl << "I do not know a format " << format << " for tnlGridOld with 2 dimensions."; - return false; -} - -#ifdef HAVE_CUDA -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantDirichletBC( const Index xSize, - const Real bc, - Real* u ) -{ - /*const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - u[ ij ] = bc; - }*/ -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setDirichletBC( const Index xSize, - const Real* bc, - Real* u ) -{ - /*const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - u[ ij ] = bc[ ij ]; - }*/ -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantNeumannBC( const Index xSize, - const Real hx, - const Real bc, - Real* u ) -{ - /*const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - if( i == 0 ) - u[ ij ] = u[ ij + ySize ] + hx * bc; - if( i == xSize - 1 ) - u[ ij ] = u[ ij - ySize ] + hx * bc; - - __syncthreads(); - - if( j == 0 ) - u[ ij ] = u[ ij + 1 ] + hy * bc; - if( j == ySize - 1 ) - u[ ij ] = u[ ij - 1 ] + hy * bc; - }*/ -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setNeumannBC( const Index xSize, - const Real hx, - const Real* bc, - Real* u ) -{ - /*const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - if( i == 0 ) - u[ ij ] = u[ ij + ySize ] + hx * bc[ ij ]; - if( i == xSize - 1 ) - u[ ij ] = u[ ij - ySize ] + hx * bc[ ij ]; - - __syncthreads(); - - if( j == 0 ) - u[ ij ] = u[ ij + 1 ] + hy * bc[ ij ]; - if( j == ySize - 1 ) - u[ ij ] = u[ ij - 1 ] + hy * bc[ ij ]; - }*/ -} - -#endif - - - - -#endif /* tnlGrid1D_IMPL_H_ */ diff --git a/src/legacy/mesh/implementation/tnlGrid2D_impl.h b/src/legacy/mesh/implementation/tnlGrid2D_impl.h deleted file mode 100644 index 2a6d9a668588c62c9133feec4a89b6c3f2d0f032..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/implementation/tnlGrid2D_impl.h +++ /dev/null @@ -1,948 +0,0 @@ -/*************************************************************************** - tnlGridOld2D_impl.h - description - ------------------- - begin : Nov 22, 2012 - copyright : (C) 2012 by Tomas Oberhuber - email : tomas.oberhuber@fjfi.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef tnlGridOld2D_IMPL_H_ -#define tnlGridOld2D_IMPL_H_ - -#ifdef HAVE_CUDA -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantDirichletBC( const Index xSize, - const Index ySize, - const Real bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setDirichletBC( const Index xSize, - const Index ySize, - const Real* bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real* bc, - Real* u ); -#endif - -template< typename Real, typename Device, typename Index > -tnlGridOld< 2, Real, Device, Index > :: tnlGridOld() -{ -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 2, Real, Device, Index > :: tnlGridOld( const tnlString& name ) -{ - this -> setName( name ); -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 2, Real, Device, Index > :: tnlGridOld( const tnlString& name, - const tnlGridOld< 2, Real, tnlHost, Index >& grid ) -{ - this -> setName( name ); - this -> setLike( grid ); -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 2, Real, Device, Index > :: tnlGridOld( const tnlString& name, - const tnlGridOld< 2, Real, tnlCuda, Index >& grid ) -{ - this -> setName( name ); - this -> setLike( grid ); -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 2, Index >& tnlGridOld< 2, Real, Device, Index > :: getDimensions() const -{ - return tnlMultiVector< 2, Real, Device, Index > :: getDimensions(); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: setDimensions( const tnlStaticVector< 2, Index >& dimensions ) -{ - if( ! tnlMultiVector< 2, Real, Device, Index > :: setDimensions( dimensions ) ) - return false; - spaceSteps[ 0 ] = ( domainUpperCorner[ 0 ] - domainLowerCorner[ 0 ] ) / ( Real ) ( this -> getDimensions()[ 0 ] - 1 ); - spaceSteps[ 1 ] = ( domainUpperCorner[ 1 ] - domainLowerCorner[ 1 ] ) / ( Real ) ( this -> getDimensions()[ 1 ] - 1 ); - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: setDomain( const tnlStaticVector< 2, Real >& origin, - const tnlStaticVector< 2, Real >& proportions ) -{ - if( origin >= proportions ) - { - cerr << "Wrong parameters for the grid domain of " << this -> getName() << ". The low corner must by smaller than the high corner." << endl - << "origin = " << origin << endl << "proportions = " << proportions << endl; - return false; - } - domainLowerCorner = origin; - domainUpperCorner = proportions; - spaceSteps[ 0 ] = ( domainUpperCorner[ 0 ] - domainLowerCorner[ 0 ] ) / ( Real ) ( this -> getDimensions()[ 0 ] - 1 ); - spaceSteps[ 1 ] = ( domainUpperCorner[ 1 ] - domainLowerCorner[ 1 ] ) / ( Real ) ( this -> getDimensions()[ 1 ] - 1 ); - return true; -} - -template< typename Real, typename Device, typename Index > - template< typename Grid > -bool tnlGridOld< 2, Real, Device, Index > :: setLike( const Grid& v ) -{ - return tnlMultiVector< 2, Real, Device, Index > :: setLike( v ) && - this -> setDomain( v. getDomainLowerCorner(), v. getDomainUpperCorner() ); -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 2, Real >& tnlGridOld< 2, Real, Device, Index > :: getDomainLowerCorner() const -{ - return this -> domainLowerCorner; -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 2, Real >& tnlGridOld< 2, Real, Device, Index > :: getDomainUpperCorner() const -{ - return this -> domainUpperCorner; -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 2, Real >& tnlGridOld< 2, Real, Device, Index > :: getSpaceSteps() const -{ - return spaceSteps; -} - -template< typename Real, typename Device, typename Index > -tnlString tnlGridOld< 2, Real, Device, Index > :: getType() const -{ - return tnlString( "tnlGridOld< ") + - tnlString( "2" ) + - tnlString( ", " ) + - tnlString( ::getType< Real >() ) + - tnlString( ", " ) + - Device :: getDeviceType() + - tnlString( ", " ) + - tnlString( ::getType< Index >() ) + - tnlString( " >" ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: operator == ( const tnlGridOld< 2, Real, Device, Index >& grid ) const -{ - tnlAssert( this -> getDomainLowerCorner() == grid. getDomainLowerCorner() && - this -> getDomainUpperCorner() == grid. getDomainUpperCorner(), - cerr << "You are attempting to compare two grids with different domains." << endl - << "First grid name is " << this -> getName() - << " domain is ( " << this -> getDomainLowerCorner() << " )- (" - << this -> getDomainUpperCorner() << ")" << endl - << "Second grid is " << grid. getName() - << " domain is ( " << grid. getDomainLowerCorner() << " )- (" - << grid. getDomainUpperCorner() << ")" << endl; ); - return tnlMultiVector< 2, Real, Device, Index > :: operator == ( grid ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: operator != ( const tnlGridOld< 2, Real, Device, Index >& grid ) const -{ - return ! ( (* this ) == grid ); -} - -template< typename Real, typename Device, typename Index > - template< typename Real2, typename Device2, typename Index2 > -tnlGridOld< 2, Real, Device, Index >& -tnlGridOld< 2, Real, Device, Index > -:: operator = ( const tnlGridOld< 2, Real2, Device2, Index2 >& grid ) -{ - tnlAssert( this -> getDimensions() == grid. getDimensions(), - cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << grid. getName() - << " dimensions are ( " << grid. getDimensions() << " )" << endl; ); - tnlVector< Real, Device, Index > :: operator = ( grid ); - return ( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getValue( const tnlStaticVector< 2, Real >& point ) const -{ - Real x = ( point[ 0 ] - domainLowerCorner[ 0 ] ) / spaceSteps[ 0 ]; - Real y = ( point[ 1 ] - domainLowerCorner[ 1 ] ) / spaceSteps[ 1 ]; - Index ix = ( Index ) ( x ); - Index iy = ( Index ) ( y ); - Real dx = x - ( Real ) ix; - Real dy = y - ( Real ) iy; - if( iy >= this -> getDimensions()[ tnlY ] - 1 ) - { - if( ix >= this -> getDimensions()[ tnlX ] - 1 ) - return this -> getElement( this -> getDimensions()[ tnlX ] - 1, - this -> getDimensions()[ tnlY ] - 1 ); - return ( Real( 1.0 ) - dx ) * this -> getElement( ix, - this -> getDimensions()[ tnlY ] - 1 ) + - dx * this -> getElement( ix + 1, - this -> getDimensions()[ tnlY ] - 1 ); - if( ix >= this -> getDimensions()[ tnlX ] - 1 ) - return ( Real( 1.0 ) - dy ) * this -> getElement( this -> getDimensions()[ tnlX ] - 1, - iy ) + - dy * this -> getElement( this -> getDimensions()[ tnlX ] - 1, - iy + 1 ); - Real a1, a2; - a1 = ( Real( 1.0 ) - dx ) * this -> getElement( ix, iy ) + - dx * this -> getElement( ix + 1, iy ); - - a2 = ( Real( 1.0 ) - dx ) * this -> getElement( ix, iy + 1 ) + - dx * this -> getElement( ix + 1, iy + 1 ); - return ( Real( 1.0 ) - dy ) * a1 + dy * a2; - } -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getValue( const Real& x, - const Real& y ) const -{ - return this -> getValue( tnlStaticVector< 2, Real >( x, y ) ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_x_f( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && - i1 < this -> getDimensions(). x() - 1 && i2 <= this -> getDimensions(). y() - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions() .x() - 1 ) << " ) " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions(). y() - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1, i2 ) - - this -> getElement( i1, i2 ) ) / Hx; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_x_b( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 > 0 && i2 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && i2 <= this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1, i2 ) - - this -> getElement( i1 - 1, i2 ) ) / Hx; -}; -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_x( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 > 0 && i2 >= 0 && - i1 < this -> getDimensions()[ tnlX ] - 1 && i2 <= this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1, i2 ) - - this -> getElement( i1 - 1, i2 ) ) / ( 2.0 * Hx ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_xx( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 > 0 && i2 >= 0 && - i1 < this -> getDimensions()[ tnlX ] - 1 && i2 <= this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1, i2 ) - - 2.0 * this -> getElement( i1, i2 ) + - this -> getElement( i1 - 1, i2 ) ) / ( Hx * Hx ); -}; -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_y_f( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && i2 < this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ) " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 + 1 ) - - this -> getElement( i1, i2 ) ) / Hy; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_y_b( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 >= 0 && i2 > 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && i2 <= this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 ) - - this -> getElement( i1, i2 - 1 ) ) / Hy; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_y( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 >= 0 && i2 > 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && i2 < this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ) " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 + 1 ) - - this -> getElement( i1, i2 - 1 ) ) / ( 2.0 * Hy ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: Partial_yy( const Index i1, - const Index i2 ) const -{ - tnlAssert( i1 >= 0 && i2 > 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && i2 < this -> getDimensions()[ tnlY ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ) " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 + 1 ) - - 2.0 * this -> getElement( i1, i2 ) + - this -> getElement( i1, i2 - 1 ) ) / ( Hy * Hy ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: setDirichletBC( const tnlGridOld< 2, Real, Device, Index >&bc, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - Index i, j; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, 0 ) = bc( i, 0 ); - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, ySize - 1 ) = bc( i, ySize - 1 ); - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( 0, j ) = bc( 0, j ); - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( xSize - 1, j ) = bc( xSize - 1, j ); - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setDirichletBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - bc. getData(), - this -> getData() ); -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: setDirichletBC( const Real& bcValue, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - Index i, j; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, 0 ) = bcValue; - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, ySize - 1 ) = bcValue; - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( 0, j ) = bcValue; - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( xSize - 1, j ) = bcValue; - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setConstantDirichletBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - bcValue, - this -> getData() ); -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: setNeumannBC( const tnlGridOld< 2, Real, Device, Index >&bc, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Real& hx = this -> getSpaceSteps(). x(); - const Real& hy = this -> getSpaceSteps(). y(); - - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - Index i, j; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, 0 ) = ( *this )( i, 1 ) + hy * bc( i, 0 ); - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, ySize - 1 ) = ( *this )( i, ySize - 2 ) + hy * bc( i, ySize - 1 ); - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( 0, j ) = ( *this )( 1, j ) + hx * bc( 0, j ); - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( xSize - 1, j ) = ( *this )( xSize - 2, j ) + hx * bc( xSize - 1, j ); - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - ::setNeumannBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - this -> getSpaceSteps(). x(), - this -> getSpaceSteps(). y(), - bc. getData(), - this -> getData() ); -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: setNeumannBC( const Real& bcValue, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Real& hx = this -> getSpaceSteps(). x(); - const Real& hy = this -> getSpaceSteps(). y(); - - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - Index i, j; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, 0 ) = ( *this )( i, 1 ) + hy * bcValue; - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - ( *this )( i, ySize - 1 ) = ( *this )( i, ySize - 2 ) + hy * bcValue; - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( 0, j ) = ( *this )( 1, j ) + hx * bcValue; - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - ( *this )( xSize - 1, j ) = ( *this )( xSize - 2, j ) + hx * bcValue; - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setConstantNeumannBC< 2, Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - this -> getSpaceSteps(). x(), - this -> getSpaceSteps(). y(), - bcValue, - this -> getData() ); -#endif - } -} - -/*template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getMax() const -{ - return tnlMax( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getMin() const -{ - return tnlMin( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getAbsMax() const -{ - return tnlAbsMax( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getAbsMin() const -{ - return tnlAbsMin( * this ); -}*/ - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getLpNorm( const Real& p ) const -{ - Real result = this -> lpNorm( p ); - return result * getSpaceSteps(). x() - * getSpaceSteps(). y(); -} - -/*template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getSum() const -{ - return tnlMultiVector< 2, Real, Device, Index > :: sum( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getDifferenceMax( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceMax( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getDifferenceMin( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceMin( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getDifferenceAbsMax( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceAbsMax( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getDifferenceAbsMin( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceAbsMin( *this ); -}*/ - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getDifferenceLpNorm( const tnlVector< Real, Device, Index >& v, const Real& p ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - - Real result = v. differenceLpNorm( * this, p ); - return result * getSpaceSteps(). x() - * getSpaceSteps(). y(); -} - -/*template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: getDifferenceSum( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return this -> differenceSum( v ); -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: scalarMultiplication( const Real& alpha ) -{ - return this -> scalarMultiplication( alpha ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 2, Real, Device, Index > :: scalarProduct( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return this -> scalarProduct( v ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: alphaXPlusY( const Real& alpha, - const tnlVector< Real, Device, Index >& x ) -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - this -> alphaXPlusY( alpha, x ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 2, Real, Device, Index > :: saxmy( const Real& alpha, - const tnlVector< Real, Device, Index >& x ) -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - this -> saxmy( alpha, x ); -};*/ - - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: save( tnlFile& file ) const -{ - if( ! tnlMultiVector< 2, Real, Device, Index > :: save( file ) ) - { - cerr << "I was not able to write the tnlMultiVector of the tnlGridOld " - << this -> getName() << endl; - return false; - } - if( ! domainLowerCorner. save( file ) || - ! domainUpperCorner. save( file ) || - ! spaceSteps. save( file ) ) - { - cerr << "I was not able to write the domain decsription of the tnlGridOld " - << this -> getName() << endl; - return false; - } - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: load( tnlFile& file ) -{ - if( ! tnlMultiVector< 2, Real, Device, Index > :: load( file ) ) - { - cerr << "I was not able to read the tnlMultiVector of the tnlGridOld " - << this -> getName() << endl; - return false; - } - if( ! domainLowerCorner. load( file ) || - ! domainUpperCorner. load( file ) || - ! spaceSteps. load( file ) ) - { - cerr << "I was not able to read the domain description of the tnlGridOld " - << this -> getName() << endl; - return false; - } - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: save( const tnlString& fileName ) const -{ - return tnlObject :: save( fileName ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: load( const tnlString& fileName ) -{ - return tnlObject :: load( fileName ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 2, Real, Device, Index > :: draw( const tnlString& fileName, - const tnlString& format, - const tnlStaticVector< 2, Index > steps ) const -{ - tnlAssert( steps > ( tnlStaticVector< 2, Index >( 0 ) ), - cerr << "Wrong steps of increment ( " << steps << " )" - << " for drawing the tnlGridOld " << this -> getName() << "." << endl; ); - if( format == "tnl" ) - return this -> save( fileName ); - fstream file; - file. open( fileName. getString(), ios :: out ); - if( ! file ) - { - cerr << " I am not able to open the file " << fileName - << " for drawing the tnlGridOld " << this -> getName() << "." << endl; - return false; - } - const Index xSize = this -> getDimensions()[ tnlX ]; - const Index ySize = this -> getDimensions()[ tnlY ]; - const Real& ax = this -> getDomainLowerCorner()[ tnlX ]; - const Real& ay = this -> getDomainLowerCorner()[ tnlY ]; - const Real& hx = this -> getSpaceSteps()[ tnlX ]; - const Real& hy = this -> getSpaceSteps()[ tnlY ]; - if( format == "gnuplot" ) - { - for( Index i = 0; i < xSize; i += steps[ tnlX ] ) - { - for( Index j = 0; j < ySize; j += steps[ tnlY ] ) - { - file << setprecision( 12 ) - << ax + Real( i ) * hx * steps[ tnlX ] - << " " - << ay + Real( j ) * hy * steps[ tnlY ] - << " " - << this -> getElement( i, j ) - << endl; - } - file << endl; - } - return true; - } - if( format == "vti" ) - { - file << "<VTKFile type=\"ImagegetString\" version=\"0.1\" byte_order=\"LittleEndian\">" << endl; - file << "<ImagegetString WholeExtent=\"" - << 0 << " " << xSize - 1 << " " << 0 << " " << ySize - 1 - << " 0 0\" Origin=\"0 0 0\" Spacing=\"" - << hx * steps[ tnlX ] << " " << hy * steps[ tnlY ] << " 0\">" << endl; - file << "<Piece Extent=\"0 " << xSize - 1 << " 0 " << ySize - 1 <<" 0 0\">" << endl; - file << "<PointgetString Scalars=\"order_parameter\">" << endl; - file << "<getStringArray Name=\"order_parameter\" type=\"Float32\" format=\"ascii\">" << endl; - file. flags( ios_base::scientific ); - Index iStep = steps[ tnlX ]; - Index jStep = steps[ tnlY ]; - for( Index j = 0; j <= ySize - jStep; j += jStep ) - for( Index i = 0; i <= xSize - iStep; i += iStep ) - file << this -> getElement( i, j ) << " "; - file << endl; - file << "</getStringArray>" << endl; - file << "</PointgetString>" << endl; - file << "</Piece>" << endl; - file << "</ImagegetString>" << endl; - file << "</VTKFile>" << endl; - return true; - } - cerr << endl << "I do not know a format " << format << " for tnlGridOld with 2 dimensions."; - return false; -} - -#ifdef HAVE_CUDA -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantDirichletBC( const Index xSize, - const Index ySize, - const Real bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - u[ ij ] = bc; - } - -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setDirichletBC( const Index xSize, - const Index ySize, - const Real* bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - u[ ij ] = bc[ ij ]; - } -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - if( i == 0 ) - u[ ij ] = u[ ij + ySize ] + hx * bc; - if( i == xSize - 1 ) - u[ ij ] = u[ ij - ySize ] + hx * bc; - - __syncthreads(); - - if( j == 0 ) - u[ ij ] = u[ ij + 1 ] + hy * bc; - if( j == ySize - 1 ) - u[ ij ] = u[ ij - 1 ] + hy * bc; - } -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real* bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - if( i == 0 ) - u[ ij ] = u[ ij + ySize ] + hx * bc[ ij ]; - if( i == xSize - 1 ) - u[ ij ] = u[ ij - ySize ] + hx * bc[ ij ]; - - __syncthreads(); - - if( j == 0 ) - u[ ij ] = u[ ij + 1 ] + hy * bc[ ij ]; - if( j == ySize - 1 ) - u[ ij ] = u[ ij - 1 ] + hy * bc[ ij ]; - } -} - -#endif - - - - -#endif /* tnlGrid2D_IMPL_H_ */ diff --git a/src/legacy/mesh/implementation/tnlGrid3D_impl.h b/src/legacy/mesh/implementation/tnlGrid3D_impl.h deleted file mode 100644 index e3d7757e7bb2b97a13eb97a8bfb4de6470d99515..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/implementation/tnlGrid3D_impl.h +++ /dev/null @@ -1,1157 +0,0 @@ -/*************************************************************************** - tnlGridOld3D_impl.h - description - ------------------- - begin : Nov 22, 2012 - copyright : (C) 2012 by Tomas Oberhuber - email : tomas.oberhuber@fjfi.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef tnlGridOld3D_IMPL_H_ -#define tnlGridOld3D_IMPL_H_ - -#ifdef HAVE_CUDA -/*template< int Dimensions, typename Real, typename Index > -__global__ void setConstantDirichletBC( const Index xSize, - const Index ySize, - const Real bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setDirichletBC( const Index xSize, - const Index ySize, - const Real* bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real bc, - Real* u ); - -template< int Dimensions, typename Real, typename Index > -__global__ void setNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real* bc, - Real* u ); -*/ -#endif - -template< typename Real, typename Device, typename Index > -tnlGridOld< 3,Real, Device, Index > :: tnlGridOld() -{ -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 3,Real, Device, Index > :: tnlGridOld( const tnlString& name ) -{ - this -> setName( name ); -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 3,Real, Device, Index > :: tnlGridOld( const tnlString& name, - const tnlGridOld< 3,Real, tnlHost, Index >& grid ) -{ - this -> setName( name ); - this -> setLike( grid ); -} - -template< typename Real, typename Device, typename Index > -tnlGridOld< 3,Real, Device, Index > :: tnlGridOld( const tnlString& name, - const tnlGridOld< 3,Real, tnlCuda, Index >& grid ) -{ - this -> setName( name ); - this -> setLike( grid ); -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 3,Index >& tnlGridOld< 3,Real, Device, Index > :: getDimensions() const -{ - return tnlMultiVector< 3,Real, Device, Index > :: getDimensions(); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: setDimensions( const tnlStaticVector< 3,Index >& dimensions ) -{ - if( ! tnlMultiVector< 3,Real, Device, Index > :: setDimensions( dimensions ) ) - return false; - spaceSteps[ 0 ] = ( domainUpperCorner[ 0 ] - domainLowerCorner[ 0 ] ) / ( Real ) ( this -> getDimensions()[ 0 ] - 1 ); - spaceSteps[ 1 ] = ( domainUpperCorner[ 1 ] - domainLowerCorner[ 1 ] ) / ( Real ) ( this -> getDimensions()[ 1 ] - 1 ); - spaceSteps[ 2 ] = ( domainUpperCorner[ 2 ] - domainLowerCorner[ 2 ] ) / ( Real ) ( this -> getDimensions()[ 2 ] - 1 ); - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: setDomain( const tnlStaticVector< 3,Real >& origin, - const tnlStaticVector< 3,Real >& proportions ) -{ - if( origin >= proportions ) - { - cerr << "Wrong parameters for the grid domain of " << this -> getName() << ". The low corner must by smaller than the high corner." << endl - << "origin = " << origin << endl << "proportions = " << proportions << endl; - return false; - } - domainLowerCorner = origin; - domainUpperCorner = proportions; - spaceSteps[ 0 ] = ( domainUpperCorner[ 0 ] - domainLowerCorner[ 0 ] ) / ( Real ) ( this -> getDimensions()[ 0 ] - 1 ); - spaceSteps[ 1 ] = ( domainUpperCorner[ 1 ] - domainLowerCorner[ 1 ] ) / ( Real ) ( this -> getDimensions()[ 1 ] - 1 ); - spaceSteps[ 2 ] = ( domainUpperCorner[ 2 ] - domainLowerCorner[ 2 ] ) / ( Real ) ( this -> getDimensions()[ 2 ] - 1 ); - return true; -} - -template< typename Real, typename Device, typename Index > - template< typename Grid > -bool tnlGridOld< 3,Real, Device, Index > :: setLike( const Grid& v ) -{ - return tnlMultiVector< 3,Real, Device, Index > :: setLike( v ) && - this -> setDomain( v. getDomainLowerCorner(), v. getDomainUpperCorner() ); -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 3,Real >& tnlGridOld< 3,Real, Device, Index > :: getDomainLowerCorner() const -{ - return this -> domainLowerCorner; -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 3,Real >& tnlGridOld< 3,Real, Device, Index > :: getDomainUpperCorner() const -{ - return this -> domainUpperCorner; -} - -template< typename Real, typename Device, typename Index > -const tnlStaticVector< 3,Real >& tnlGridOld< 3,Real, Device, Index > :: getSpaceSteps() const -{ - return spaceSteps; -} - -template< typename Real, typename Device, typename Index > -tnlString tnlGridOld< 3,Real, Device, Index > :: getType() const -{ - return tnlString( "tnlGridOld< ") + - tnlString( "3" ) + - tnlString( ", " ) + - tnlString( ::getType< Real >() ) + - tnlString( ", " ) + - Device :: getDeviceType() + - tnlString( ", " ) + - tnlString( ::getType< Index >() ) + - tnlString( " >" ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: operator == ( const tnlGridOld< 3,Real, Device, Index >& grid ) const -{ - tnlAssert( this -> getDomainLowerCorner() == grid. getDomainLowerCorner() && - this -> getDomainUpperCorner() == grid. getDomainUpperCorner(), - cerr << "You are attempting to compare two grids with different domains." << endl - << "First grid name is " << this -> getName() - << " domain is ( " << this -> getDomainLowerCorner() << " )- (" - << this -> getDomainUpperCorner() << ")" << endl - << "Second grid is " << grid. getName() - << " domain is ( " << grid. getDomainLowerCorner() << " )- (" - << grid. getDomainUpperCorner() << ")" << endl; ); - return tnlMultiVector< 3,Real, Device, Index > :: operator == ( grid ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: operator != ( const tnlGridOld< 3,Real, Device, Index >& grid ) const -{ - return ! ( (* this ) == grid ); -} - -template< typename Real, typename Device, typename Index > - template< typename Real2, typename Device2, typename Index2 > -tnlGridOld< 3,Real, Device, Index >& -tnlGridOld< 3,Real, Device, Index > -:: operator = ( const tnlGridOld< 3,Real2, Device2, Index2 >& grid ) -{ - tnlAssert( this -> getDimensions() == grid. getDimensions(), - cerr << "You are attempting to assign two arrays with different dimensions." << endl - << "First array name is " << this -> getName() - << " dimensions are ( " << this -> getDimensions() << " )" << endl - << "Second array is " << grid. getName() - << " dimensions are ( " << grid. getDimensions() << " )" << endl; ); - tnlVector< Real, Device, Index > :: operator = ( grid ); - return ( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getValue( const tnlStaticVector< 3,Real >& point ) const -{ - tnlAssert( 0, cerr << "Interpolation is not implemented yet."); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getValue( const Real& x, - const Real& y, - const Real& z ) const -{ - return this -> getValue( tnlStaticVector< 3, Real >( x, y, z ) ); -} - - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_x_f( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && i3 >= 0 && - i1 < this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1, i2, i3 ) - - this -> getElement( i1, i2, i3 ) ) / Hx; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_x_b( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 > 0 && i2 >= 0 && i3 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1, i2, i3 ) - - this -> getElement( i1 - 1, i2, i3 ) ) / Hx; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_x( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 > 0 && i2 >= 0 && i3 >= 0 && - i1 < this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1, i2, i3 ) - - this -> getElement( i1 - 1, i2, i3 ) ) / ( 2.0 * Hx ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_xx( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 > 0 && i2 >= 0 && i3 >= 0 && - i1 < this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ) " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hx = spaceSteps[ 0 ]; - tnlAssert( Hx > 0, cerr << "Hx = " << Hx << endl; ); - return ( this -> getElement( i1 + 1, i2, i3 ) - - 2.0 * this -> getElement( i1, i2, i3 ) + - this -> getElement( i1 - 1, i2, i3 ) ) / ( Hx * Hx ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_y_f( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && i3 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 < this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ) " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 + 1, i3 ) - - this -> getElement( i1, i2, i3 ) ) / Hy; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_y_b( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 > 0 && i3 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2, i3 ) - - this -> getElement( i1, i2 - 1, i3 ) ) / Hy; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_y( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 > 0 && i3 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 < this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ) " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 + 1, i3 ) - - this -> getElement( i1, i2 - 1, i3 ) ) / ( 2.0 * Hy ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_yy( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 > 0 && i3 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 < this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ) " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hy = spaceSteps[ 1 ]; - tnlAssert( Hy > 0, cerr << "Hy = " << Hy << endl; ); - return ( this -> getElement( i1, i2 + 1, i3 ) - - 2.0 * this -> getElement( i1, i2, i3 ) + - this -> getElement( i1, i2 - 1, i3 ) ) / ( Hy * Hy ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_z_f( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && i3 >= 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 < this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ) " << endl; ); - - const Real& Hz = spaceSteps[ 2 ]; - tnlAssert( Hz > 0, cerr << "Hz = " << Hz << endl; ); - return ( this -> getElement( i1, i2, i3 + 1 ) - - this -> getElement( i1, i2, i3 ) ) / Hz; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_z_b( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && i3 > 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 <= this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ] " << endl; ); - - const Real& Hz = spaceSteps[ 2 ]; - tnlAssert( Hz > 0, cerr << "Hz = " << Hz << endl; ); - return ( this -> getElement( i1, i2, i3 ) - - this -> getElement( i1, i2, i3 - 1 ) ) / Hz; -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_z( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && i3 > 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 < this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ) " << endl; ); - - const Real& Hz = spaceSteps[ 2 ]; - tnlAssert( Hz > 0, cerr << "Hz = " << Hz << endl; ); - return ( this -> getElement( i1, i2, i3 + 1 ) - - this -> getElement( i1, i2, i3 - 1 ) ) / ( 2.0 * Hz ); -}; - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: Partial_zz( const Index i1, - const Index i2, - const Index i3 ) const -{ - tnlAssert( i1 >= 0 && i2 >= 0 && i3 > 0 && - i1 <= this -> getDimensions()[ tnlX ] - 1 && - i2 <= this -> getDimensions()[ tnlY ] - 1 && - i3 < this -> getDimensions()[ tnlZ ] - 1, - cerr << " i1 = " << i1 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlX ] - 1 ) << " ] " << endl - << " i2 = " << i2 << " and it should be in [ 0, " << - ( this -> getDimensions()[ tnlY ] - 1 ) << " ] " << endl - << " i3 = " << i3 << " and it should be in ( 0, " << - ( this -> getDimensions()[ tnlZ ] - 1 ) << " ) " << endl; ); - - const Real& Hz = spaceSteps[ 2 ]; - tnlAssert( Hz > 0, cerr << "Hz = " << Hz << endl; ); - return ( this -> getElement( i1, i2, i3 + 1 ) - - 2.0 * this -> getElement( i1, i2, i3 ) + - this -> getElement( i1, i2, i3 - 1 ) ) / ( Hz * Hz ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: setDirichletBC( const tnlGridOld< 3,Real, Device, Index >&bc, - const tnlStaticVector< 3,bool >& lowerBC, - const tnlStaticVector< 3,bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - const Index zSize = this -> getDimensions(). z(); - Index i, j, k; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, 0, k ) = bc( i, 0, k ); - - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, ySize - 1, k ) = ( i, ySize - 1, k ); - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( 0, j, k ) = bc( 0, j, k ); - - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( xSize - 1, j, k ) = bc( xSize - 1, j, k ); - - if( lowerBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, 0 ) = bc( i, j, 0 ); - - if( upperBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, zSize - 1 ) = bc( i, j, zSize - 1 ); - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - tnlAssert( false, ); - /*const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setDirichletBC< 3,Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - bc. getData(), - this -> getData() );*/ - -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: setDirichletBC( const Real& bcValue, - const tnlStaticVector< 3,bool >& lowerBC, - const tnlStaticVector< 3,bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - const Index zSize = this -> getDimensions(). z(); - Index i, j, k; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, 0, k ) = bcValue; - - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, ySize - 1, k ) = bcValue; - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( 0, j, k ) = bcValue; - - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( xSize - 1, j, k ) = bcValue; - - if( lowerBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, 0 ) = bcValue; - - if( upperBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, zSize - 1 ) = bcValue; - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setConstantDirichletBC< 3,Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - bcValue, - this -> getData() ); -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: setNeumannBC( const tnlGridOld< 3,Real, Device, Index >&bc, - const tnlStaticVector< 3,bool >& lowerBC, - const tnlStaticVector< 3,bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Real& hx = this -> getSpaceSteps(). x(); - const Real& hy = this -> getSpaceSteps(). y(); - const Real& hz = this -> getSpaceSteps(). z(); - - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - const Index zSize = this -> getDimensions(). z(); - Index i, j, k; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, 0, k ) = ( *this )( i, 1, k ) + hy * bc. getElement( i, 0, k ); - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, ySize - 1, k ) = ( *this )( i, ySize - 2, k ) + hy * bc( i, ySize - 1, k ); - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( 0, j, k ) = ( *this )( 1, j, k ) + hx * bc( 0, j, k ); - - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( xSize - 1, j, k ) = ( *this )( xSize - 2, j, k ) + hx * bc( xSize - 1, j, k ); - - if( lowerBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, 0 ) = ( *this )( i, j, 1 ) + hz * bc( i, j, 0 ); - - if( upperBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, zSize - 1 ) = ( *this )( i, j, zSize - 2 ) + hz * bc( i, j, zSize - 1 ); - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - /* - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - ::setNeumannBC< 3,Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - this -> getSpaceSteps(). x(), - this -> getSpaceSteps(). y(), - bc. getData(), - this -> getData() ); - */ -#endif - } -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: setNeumannBC( const Real& bcValue, - const tnlStaticVector< 3,bool >& lowerBC, - const tnlStaticVector< 3,bool >& upperBC ) -{ - if( Device :: getDevice() == tnlHostDevice ) - { - const Real& hx = this -> getSpaceSteps(). x(); - const Real& hy = this -> getSpaceSteps(). y(); - const Real& hz = this -> getSpaceSteps(). z(); - - const Index xSize = this -> getDimensions(). x(); - const Index ySize = this -> getDimensions(). y(); - const Index zSize = this -> getDimensions(). z(); - Index i, j, k; - - if( lowerBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, 0, k ) = ( *this )( i, 1, k ) + hy * bcValue; - if( upperBC. x() ) - for( i = 0; i < xSize; i ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( i, ySize - 1, k ) = ( *this )( i, ySize - 2, k ) + hy * bcValue; - - if( lowerBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( 0, j, k ) = ( *this )( 1, j, k ) + hx * bcValue; - - if( upperBC. y() ) - for( j = 0; j < ySize; j ++ ) - for( k = 0; k < zSize; k ++ ) - ( *this )( xSize - 1, j, k ) = ( *this )( xSize - 2, j, k ) + hx * bcValue; - - if( lowerBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, 0 ) = ( *this )( i, j, 1 ) + hz * bcValue; - - if( upperBC. z() ) - for( i = 0; i < xSize; i ++ ) - for( j = 0; j < ySize; j ++ ) - ( *this )( i, j, zSize - 1 ) = ( *this )( i, j, zSize - 2 ) + hz * bcValue; - } - if( Device :: getDevice() == tnlCudaDevice ) - { -#ifdef HAVE_CUDA - const Index size = this -> getSize(); - const Index desBlockSize = 64; - const Index gridSize = size / desBlockSize + ( size % desBlockSize != 0 ); - dim3 gridDim( 0 ), blockDim( 0 ); - gridDim. x = gridSize; - blockDim. x = desBlockSize; - :: setConstantNeumannBC< 3,Real, Index ><<< gridDim, blockDim >>>( this -> getDimensions(). x(), - this -> getDimensions(). y(), - this -> getSpaceSteps(). x(), - this -> getSpaceSteps(). y(), - bcValue, - this -> getData() ); -#endif - } -} - -/*template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getMax() const -{ - return tnlMax( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getMin() const -{ - return tnlMin( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getAbsMax() const -{ - return tnlAbsMax( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getAbsMin() const -{ - return tnlAbsMin( * this ); -}*/ - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getLpNorm( const Real& p ) const -{ - Real result = this -> lpNorm( p ); - return result * getSpaceSteps(). x() - * getSpaceSteps(). y() - * getSpaceSteps(). z(); -} - -/* -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getSum() const -{ - return tnlMultiVector< 3,Real, Device, Index > :: sum( * this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getDifferenceMax( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceMax( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getDifferenceMin( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceMin( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getDifferenceAbsMax( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceAbsMax( *this ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getDifferenceAbsMin( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return v. differenceAbsMin( *this ); -}*/ - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getDifferenceLpNorm( const tnlVector< Real, Device, Index >& v, const Real& p ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - - Real result = v. differenceLpNorm( * this, p ); - return result * getSpaceSteps(). x() - * getSpaceSteps(). y() - * getSpaceSteps(). z(); -} - -/*template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: getDifferenceSum( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return this -> differenceSum( v ); -} - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: scalarMultiplication( const Real& alpha ) -{ - return this -> scalarMultiplication( alpha ); -} - -template< typename Real, typename Device, typename Index > -Real tnlGridOld< 3,Real, Device, Index > :: scalarProduct( const tnlVector< Real, Device, Index >& v ) const -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - return this -> scalarProduct( v ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: alphaXPlusY( const Real& alpha, - const tnlVector< Real, Device, Index >& x ) -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - this -> alphaXPlusY( alpha, x ); -}; - -template< typename Real, typename Device, typename Index > -void tnlGridOld< 3,Real, Device, Index > :: saxmy( const Real& alpha, - const tnlVector< Real, Device, Index >& x ) -{ - tnlAssert( this -> getDimensions() == v. getDimensions(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - tnlAssert( this -> getDomainLoweCorner() == v. getDomainLowerCorner() && - this -> getDomainUpperCorner() == v. getDomainUpperCorner(), - cerr << "The grid names are " << this -> getName() - << " and " << v. getName() - << "To get grids with the same parameters use the method setLike." << endl; ); - this -> saxmy( alpha, x ); -};*/ - - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: save( tnlFile& file ) const -{ - if( ! tnlMultiVector< 3,Real, Device, Index > :: save( file ) ) - { - cerr << "I was not able to write the tnlMultiVector of the tnlGridOld " - << this -> getName() << endl; - return false; - } - if( ! domainLowerCorner. save( file ) || - ! domainUpperCorner. save( file ) || - ! spaceSteps. save( file ) ) - { - cerr << "I was not able to write the domain decsription of the tnlGridOld " - << this -> getName() << endl; - return false; - } - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: load( tnlFile& file ) -{ - if( ! tnlMultiVector< 3,Real, Device, Index > :: load( file ) ) - { - cerr << "I was not able to read the tnlMultiVector of the tnlGridOld " - << this -> getName() << endl; - return false; - } - if( ! domainLowerCorner. load( file ) || - ! domainUpperCorner. load( file ) || - ! spaceSteps. load( file ) ) - { - cerr << "I was not able to read the domain description of the tnlGridOld " - << this -> getName() << endl; - return false; - } - return true; -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: save( const tnlString& fileName ) const -{ - return tnlObject :: save( fileName ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: load( const tnlString& fileName ) -{ - return tnlObject :: load( fileName ); -} - -template< typename Real, typename Device, typename Index > -bool tnlGridOld< 3,Real, Device, Index > :: draw( const tnlString& fileName, - const tnlString& format, - const tnlStaticVector< 3,Index > steps ) const -{ - tnlAssert( steps > ( tnlStaticVector< 3,Index >( 0 ) ), - cerr << "Wrong steps of increment ( " << steps << " )" - << " for drawing the tnlGridOld " << this -> getName() << "." << endl; ); - if( format == "tnl" ) - return this -> save( fileName ); - fstream file; - file. open( fileName. getString(), ios :: out ); - if( ! file ) - { - cerr << " I am not able to open the file " << fileName - << " for drawing the tnlGridOld " << this -> getName() << "." << endl; - return false; - } - const Index xSize = this -> getDimensions()[ tnlX ]; - const Index ySize = this -> getDimensions()[ tnlY ]; - const Index zSize = this -> getDimensions()[ tnlZ ]; - const Real& ax = this -> getDomainLowerCorner()[ tnlX ]; - const Real& ay = this -> getDomainLowerCorner()[ tnlY ]; - const Real& az = this -> getDomainLowerCorner()[ tnlZ ]; - const Real& hx = this -> getSpaceSteps()[ tnlX ]; - const Real& hy = this -> getSpaceSteps()[ tnlY ]; - const Real& hz = this -> getSpaceSteps()[ tnlZ ]; - if( format == "gnuplot" ) - { - cout << "GNUPLOT is not supported for tnlGridOld3D." << endl; - return false; - } - if( format == "vti" ) - { - file << "<VTKFile type=\"ImagegetString\" version=\"0.1\" byte_order=\"LittleEndian\">" << endl; - file << "<ImagegetString WholeExtent=\"" - << "0 " << xSize - 1 - << " 0 " << ySize - 1 - << " 0 " << zSize - 1 << "\" Origin=\"0 0 0\" Spacing=\"" - << hx * steps[ tnlX ] << " " << hy * steps[ tnlY ] << " " << hz * steps[ tnlZ ] << "\">" << endl; - file << "<Piece Extent=\"0 " - << xSize - 1 << " 0 " - << ySize - 1 << " 0 " - << zSize - 1 << "\">" << endl; - file << "<PointgetString Scalars=\"order_parameter\">" << endl; - file << "<getStringArray Name=\"order_parameter\" type=\"Float32\" format=\"ascii\">" << endl; - file. flags( ios_base::scientific ); - Index iStep = steps[ tnlX ]; - Index jStep = steps[ tnlY ]; - Index kStep = steps[ tnlZ ]; - for( Index k = 0; k <= zSize - kStep; k += kStep ) - for( Index j = 0; j <= ySize - jStep; j += jStep ) - for( Index i = 0; i <= xSize - iStep; i += iStep ) - { - file << this -> getElement( i, j, k ) << " "; - } - file << endl; - file << "</getStringArray>" << endl; - file << "</PointgetString>" << endl; - file << "</Piece>" << endl; - file << "</ImagegetString>" << endl; - file << "</VTKFile>" << endl; - return true; - } - if( format == "povray" ) - { - file. put( ( char ) ( xSize >> 8 ) ); - file. put( ( char ) ( xSize & 0xff ) ); - file. put( ( char ) ( ySize >> 8 ) ); - file. put( ( char ) ( ySize & 0xff ) ); - file. put( ( char ) ( zSize >> 8 ) ); - file. put( ( char ) ( zSize & 0xff ) ); - Real min( this -> getElement( 0, 0, 0 ) ), max( this -> getElement( 0, 0, 0 ) ); - for( Index k = 0; k < zSize; k ++ ) - for( Index j = 0; j < ySize; j ++ ) - for( Index i = 0; i < xSize; i ++ ) - { - min = Min( min, this -> getElement( i, j, k ) ); - max = Max( max, this -> getElement( i, j, k ) ); - } - - for( Index k = 0; k < zSize; k ++ ) - for( Index j = 0; j < ySize; j ++ ) - for( Index i = 0; i < xSize; i ++ ) - { - int v = Real( 255.0 ) * ( this -> getElement( i, j, k ) - min ) / ( max - min ); - file. write( ( char* ) &v, sizeof( int ) ); - } - return true; - } - cerr << endl << "I do not know a format " << format << " for tnlGridOld with 3 dimensions."; - return false; -} - -#ifdef HAVE_CUDA -/* -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantDirichletBC( const Index xSize, - const Index ySize, - const Real bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - u[ ij ] = bc; - } - -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setDirichletBC( const Index xSize, - const Index ySize, - const Real* bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - u[ ij ] = bc[ ij ]; - } -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setConstantNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - if( i == 0 ) - u[ ij ] = u[ ij + ySize ] + hx * bc; - if( i == xSize - 1 ) - u[ ij ] = u[ ij - ySize ] + hx * bc; - - __syncthreads(); - - if( j == 0 ) - u[ ij ] = u[ ij + 1 ] + hy * bc; - if( j == ySize - 1 ) - u[ ij ] = u[ ij - 1 ] + hy * bc; - } -} - -template< int Dimensions, typename Real, typename Index > -__global__ void setNeumannBC( const Index xSize, - const Index ySize, - const Real hx, - const Real hy, - const Real* bc, - Real* u ) -{ - const Index ij = blockIdx. x * blockDim. x + threadIdx. x; - const Index i = ij / ySize; - const Index j = ij % ySize; - - if( ij < xSize * ySize && - ( i == 0 || j == 0 || i == xSize - 1 || j == ySize - 1 ) ) - { - if( i == 0 ) - u[ ij ] = u[ ij + ySize ] + hx * bc[ ij ]; - if( i == xSize - 1 ) - u[ ij ] = u[ ij - ySize ] + hx * bc[ ij ]; - - __syncthreads(); - - if( j == 0 ) - u[ ij ] = u[ ij + 1 ] + hy * bc[ ij ]; - if( j == ySize - 1 ) - u[ ij ] = u[ ij - 1 ] + hy * bc[ ij ]; - } -} -*/ -#endif - - - - -#endif /* tnlGrid3D_IMPL_H_ */ diff --git a/src/legacy/mesh/implementation/tnlGridOld_impl.cpp b/src/legacy/mesh/implementation/tnlGridOld_impl.cpp deleted file mode 100644 index 4caed2850ee70f5ec173e641e7a94b7c25f92b4c..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/implementation/tnlGridOld_impl.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - tnlGridOld_impl.cpp - description - ------------------- - begin : Mar 18, 2013 - copyright : (C) 2013 by Tomas Oberhuber - email : tomas.oberhuber@fjfi.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include <legacy/mesh/tnlGridOld.h> -/* -#ifdef TEMPLATE_EXPLICIT_INSTANTIATION - -template class tnlGridOld< 1, float, tnlHost, int >; -template class tnlGridOld< 1, double, tnlHost, int >; -template class tnlGridOld< 1, float, tnlHost, long int >; -template class tnlGridOld< 1, double, tnlHost, long int >; -template class tnlGridOld< 2, float, tnlHost, int >; -template class tnlGridOld< 2, double, tnlHost, int >; -template class tnlGridOld< 2, float, tnlHost, long int >; -template class tnlGridOld< 2, double, tnlHost, long int >; -template class tnlGridOld< 3, float, tnlHost, int >; -template class tnlGridOld< 3, double, tnlHost, int >; -template class tnlGridOld< 3, float, tnlHost, long int >; -template class tnlGridOld< 3, double, tnlHost, long int >; - -#ifdef HAVE_CUDA -#endif - -template class tnlGridOld< 1, float, tnlCuda, int >; -template class tnlGridOld< 1, double, tnlCuda, int >; -template class tnlGridOld< 1, float, tnlCuda, long int >; -template class tnlGridOld< 1, double, tnlCuda, long int >; -template class tnlGridOld< 2, float, tnlCuda, int >; -template class tnlGridOld< 2, double, tnlCuda, int >; -template class tnlGridOld< 2, float, tnlCuda, long int >; -template class tnlGridOld< 2, double, tnlCuda, long int >; -template class tnlGridOld< 3, float, tnlCuda, int >; -template class tnlGridOld< 3, double, tnlCuda, int >; -template class tnlGridOld< 3, float, tnlCuda, long int >; -template class tnlGridOld< 3, double, tnlCuda, long int >; - -#endif -*/ - - - diff --git a/src/legacy/mesh/tnlGridOld.h b/src/legacy/mesh/tnlGridOld.h deleted file mode 100644 index fbae218608a51bcf44aa562e826673e50f91218a..0000000000000000000000000000000000000000 --- a/src/legacy/mesh/tnlGridOld.h +++ /dev/null @@ -1,505 +0,0 @@ -/*************************************************************************** - tnlGridOld.h - description - ------------------- - begin : Dec 12, 2010 - copyright : (C) 2010 by Tomas Oberhuber - email : tomas.oberhuber@fjfi.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef tnlGridOld_H_ -#define tnlGridOld_H_ - -#include <iomanip> -#include <fstream> -#include <core/tnlAssert.h> -#include <core/vectors/tnlMultiVector.h> -#include <core/vectors/tnlVector.h> - -using namespace std; - -template< int Dimensions, typename Real = double, typename Device = tnlHost, typename Index = int > -class tnlGridOld : public tnlMultiVector< Dimensions, Real, Device, Index > -{ -}; - -template< typename Real, typename Device, typename Index > -class tnlGridOld< 1, Real, Device, Index > : public tnlMultiVector< 1, Real, Device, Index > -{ - public: - - tnlGridOld(); - - //! We do not allow copy constructor without object name. - //tnlGridOld( const tnlGridOld< Dimensions, Real, Device, Index >& a ); - - tnlGridOld( const tnlString& name ); - - tnlGridOld( const tnlString& name, - const tnlGridOld< 1, Real, tnlHost, Index >& grid ); - - tnlGridOld( const tnlString& name, - const tnlGridOld< 1, Real, tnlCuda, Index >& grid ); - - const tnlStaticVector< 1, Index >& getDimensions() const; - - //! Sets the dimensions - /*** - * This method also must recompute space steps. It is save to call setDimensions and - * setDomain in any order. Both recompute the space steps. - */ - bool setDimensions( const tnlStaticVector< 1, Index >& dimensions ); - - //! Sets the computation domain in form of "rectangle". - /*** - * This method also must recompute space steps. It is save to call setDimensions and - * setDomain in any order. Both recompute the space steps. - */ - - bool setDomain( const tnlStaticVector< 1, Real >& lowerCorner, - const tnlStaticVector< 1, Real >& upperCorner ); - - template< typename Grid > - bool setLike( const Grid& v ); - - const tnlStaticVector< 1, Real >& getDomainLowerCorner() const; - - const tnlStaticVector< 1, Real >& getDomainUpperCorner() const; - - const tnlStaticVector< 1, Real >& getSpaceSteps() const; - - tnlString getType() const; - - bool operator == ( const tnlGridOld< 1, Real, Device, Index >& array ) const; - - bool operator != ( const tnlGridOld< 1, Real, Device, Index >& array ) const; - - template< typename Real2, typename Device2, typename Index2 > - tnlGridOld< 1, Real, Device, Index >& operator = ( const tnlGridOld< 1, Real2, Device2, Index2 >& array ); - - //! This method interpolates value at given point. - Real getValue( const tnlStaticVector< 1, Real >& point ) const; - - //! Interpolation for 1D grid. - Real getValue( const Real& x ) const; - - //! Forward difference w.r.t x - Real Partial_x_f( const Index i1 ) const; - - //! Backward difference w.r.t x - Real Partial_x_b( const Index i1 ) const; - - //! Central difference w.r.t. x - Real Partial_x( const Index i1 ) const; - - //! Second order difference w.r.t. x - Real Partial_xx( const Index i1 ) const; - - //! Set space dependent Dirichlet boundary conditions - void setDirichletBC( const tnlGridOld< 1, Real, Device, Index >&bc, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ); - - //! Set constant Dirichlet boundary conditions - void setDirichletBC( const Real& bc, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ); - - //! Set space dependent Neumann boundary conditions - void setNeumannBC( const tnlGridOld< 1, Real, Device, Index >&bc, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ); - - //! Set constant Neumann boundary conditions - void setNeumannBC( const Real& bc, - const tnlStaticVector< 1, bool >& lowerBC, - const tnlStaticVector< 1, bool >& upperBC ); - - Real getLpNorm( const Real& p ) const; - - Real getDifferenceLpNorm( const tnlVector< Real, Device, Index >& v, const Real& p ) const; - - //! Method for saving the object to a file as a binary data - bool save( tnlFile& file ) const; - - //! Method for restoring the object from a file - bool load( tnlFile& file ); - - bool save( const tnlString& fileName ) const; - - bool load( const tnlString& fileName ); - - //! This method writes the grid in some format suitable for some other preprocessing. - /*! Possible formats are: - * 1) Gnuplot format (gnuplot) - * 2) VTI format (vti) - * 3) Povray format (povray) - only for 3D. - */ - bool draw( const tnlString& fileName, - const tnlString& format, - const tnlStaticVector< 1, Index > steps = ( tnlStaticVector< 1, Index > ) 1 ) const; - - protected: - tnlStaticVector< 1, Real > domainLowerCorner, domainUpperCorner, spaceSteps; -}; - -template< typename Real, typename Device, typename Index > -class tnlGridOld< 2, Real, Device, Index > : public tnlMultiVector< 2, Real, Device, Index > -{ - public: - - tnlGridOld(); - - //! We do not allow copy constructor without object name. - //tnlGridOld( const tnlGridOld< Dimensions, Real, Device, Index >& a ); - - tnlGridOld( const tnlString& name ); - - tnlGridOld( const tnlString& name, - const tnlGridOld< 2, Real, tnlHost, Index >& grid ); - - tnlGridOld( const tnlString& name, - const tnlGridOld< 2, Real, tnlCuda, Index >& grid ); - - const tnlStaticVector< 2, Index >& getDimensions() const; - - //! Sets the dimensions - /*** - * This method also must recompute space steps. It is save to call setDimensions and - * setDomain in any order. Both recompute the space steps. - */ - bool setDimensions( const tnlStaticVector< 2, Index >& dimensions ); - - //! Sets the computation domain in form of "rectangle". - /*** - * This method also must recompute space steps. It is save to call setDimensions and - * setDomain in any order. Both recompute the space steps. - */ - - bool setDomain( const tnlStaticVector< 2, Real >& lowerCorner, - const tnlStaticVector< 2, Real >& upperCorner ); - - template< typename Grid > - bool setLike( const Grid& v ); - - const tnlStaticVector< 2, Real >& getDomainLowerCorner() const; - - const tnlStaticVector< 2, Real >& getDomainUpperCorner() const; - - const tnlStaticVector< 2, Real >& getSpaceSteps() const; - - tnlString getType() const; - - bool operator == ( const tnlGridOld< 2, Real, Device, Index >& array ) const; - - bool operator != ( const tnlGridOld< 2, Real, Device, Index >& array ) const; - - template< typename Real2, typename Device2, typename Index2 > - tnlGridOld< 2, Real, Device, Index >& operator = ( const tnlGridOld< 2, Real2, Device2, Index2 >& array ); - - //! This method interpolates value at given point. - Real getValue( const tnlStaticVector< 2, Real >& point ) const; - - //! Interpolation for 2D grid. - Real getValue( const Real& x, - const Real& y ) const; - - //! Forward difference w.r.t x in two dimensions - Real Partial_x_f( const Index i1, - const Index i2 ) const; - - //! Backward difference w.r.t x in two dimensions - Real Partial_x_b( const Index i1, - const Index i2 ) const; - - //! Central difference w.r.t. x in two dimensions - Real Partial_x( const Index i1, - const Index i2 ) const; - - //! Second order difference w.r.t. x in two dimensions - Real Partial_xx( const Index i1, - const Index i2 ) const; - - //! Forward difference w.r.t y - Real Partial_y_f( const Index i1, - const Index i2 ) const; - - //! Backward difference w.r.t y - Real Partial_y_b( const Index i1, - const Index i2 ) const; - - //! Central difference w.r.t y - Real Partial_y( const Index i1, - const Index i2 ) const; - - //! Second order difference w.r.t. y - Real Partial_yy( const Index i1, - const Index i2 ) const; - - //! Set space dependent Dirichlet boundary conditions - void setDirichletBC( const tnlGridOld< 2, Real, Device, Index >&bc, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ); - - //! Set constant Dirichlet boundary conditions - void setDirichletBC( const Real& bc, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ); - - //! Set space dependent Neumann boundary conditions - void setNeumannBC( const tnlGridOld< 2, Real, Device, Index >&bc, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ); - - //! Set constant Neumann boundary conditions - void setNeumannBC( const Real& bc, - const tnlStaticVector< 2, bool >& lowerBC, - const tnlStaticVector< 2, bool >& upperBC ); - - Real getLpNorm( const Real& p ) const; - - Real getDifferenceLpNorm( const tnlVector< Real, Device, Index >& v, const Real& p ) const; - - //! Method for saving the object to a file as a binary data - bool save( tnlFile& file ) const; - - //! Method for restoring the object from a file - bool load( tnlFile& file ); - - bool save( const tnlString& fileName ) const; - - bool load( const tnlString& fileName ); - - //! This method writes the grid in some format suitable for some other preprocessing. - /*! Possible formats are: - * 1) Gnuplot format (gnuplot) - * 2) VTI format (vti) - * 3) Povray format (povray) - only for 3D. - */ - bool draw( const tnlString& fileName, - const tnlString& format, - const tnlStaticVector< 2, Index > steps = ( tnlStaticVector< 2, Index > ) 1 ) const; - - protected: - tnlStaticVector< 2, Real > domainLowerCorner, domainUpperCorner, spaceSteps; -}; - -template< typename Real, typename Device, typename Index > -class tnlGridOld< 3, Real, Device, Index > : public tnlMultiVector< 3, Real, Device, Index > -{ - public: - - tnlGridOld(); - - //! We do not allow copy constructor without object name. - //tnlGridOld( const tnlGridOld< Dimensions, Real, Device, Index >& a ); - - tnlGridOld( const tnlString& name ); - - tnlGridOld( const tnlString& name, - const tnlGridOld< 3, Real, tnlHost, Index >& grid ); - - tnlGridOld( const tnlString& name, - const tnlGridOld< 3, Real, tnlCuda, Index >& grid ); - - const tnlStaticVector< 3, Index >& getDimensions() const; - - //! Sets the dimensions - /*** - * This method also must recompute space steps. It is save to call setDimensions and - * setDomain in any order. Both recompute the space steps. - */ - bool setDimensions( const tnlStaticVector< 3, Index >& dimensions ); - - //! Sets the computation domain in form of "rectangle". - /*** - * This method also must recompute space steps. It is save to call setDimensions and - * setDomain in any order. Both recompute the space steps. - */ - - bool setDomain( const tnlStaticVector< 3, Real >& lowerCorner, - const tnlStaticVector< 3, Real >& upperCorner ); - - template< typename Grid > - bool setLike( const Grid& v ); - - const tnlStaticVector< 3, Real >& getDomainLowerCorner() const; - - const tnlStaticVector< 3, Real >& getDomainUpperCorner() const; - - const tnlStaticVector< 3, Real >& getSpaceSteps() const; - - tnlString getType() const; - - bool operator == ( const tnlGridOld< 3, Real, Device, Index >& array ) const; - - bool operator != ( const tnlGridOld< 3, Real, Device, Index >& array ) const; - - template< typename Real2, typename Device2, typename Index2 > - tnlGridOld< 3, Real, Device, Index >& operator = ( const tnlGridOld< 3, Real2, Device2, Index2 >& array ); - - //! This method interpolates value at given point. - Real getValue( const tnlStaticVector< 3, Real >& point ) const; - - //! Interpolation for 3D grid. - Real getValue( const Real& x, - const Real& y, - const Real& z ) const; - - //! Forward difference w.r.t x in three dimensions - Real Partial_x_f( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Backward difference w.r.t x in three dimensions - Real Partial_x_b( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Central difference w.r.t. x - Real Partial_x( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Second order difference w.r.t. x - Real Partial_xx( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Forward difference w.r.t y in three dimensions - Real Partial_y_f( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Backward difference w.r.t y in three dimensions - Real Partial_y_b( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Central difference w.r.t y - Real Partial_y( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Second order difference w.r.t. y in three dimensions - Real Partial_yy( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Forward difference w.r.t z - Real Partial_z_f( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Backward difference w.r.t z - Real Partial_z_b( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Central difference w.r.t z - Real Partial_z( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Second order difference w.r.t. z - Real Partial_zz( const Index i1, - const Index i2, - const Index i3 ) const; - - //! Set space dependent Dirichlet boundary conditions - void setDirichletBC( const tnlGridOld< 3, Real, Device, Index >&bc, - const tnlStaticVector< 3, bool >& lowerBC, - const tnlStaticVector< 3, bool >& upperBC ); - - //! Set constant Dirichlet boundary conditions - void setDirichletBC( const Real& bc, - const tnlStaticVector< 3, bool >& lowerBC, - const tnlStaticVector< 3, bool >& upperBC ); - - //! Set space dependent Neumann boundary conditions - void setNeumannBC( const tnlGridOld< 3, Real, Device, Index >&bc, - const tnlStaticVector< 3, bool >& lowerBC, - const tnlStaticVector< 3, bool >& upperBC ); - - //! Set constant Neumann boundary conditions - void setNeumannBC( const Real& bc, - const tnlStaticVector< 3, bool >& lowerBC, - const tnlStaticVector< 3, bool >& upperBC ); - - Real getLpNorm( const Real& p ) const; - - Real getDifferenceLpNorm( const tnlVector< Real, Device, Index >& v, const Real& p ) const; - - //! Method for saving the object to a file as a binary data - bool save( tnlFile& file ) const; - - //! Method for restoring the object from a file - bool load( tnlFile& file ); - - bool save( const tnlString& fileName ) const; - - bool load( const tnlString& fileName ); - - //! This method writes the grid in some format suitable for some other preprocessing. - /*! Possible formats are: - * 1) Gnuplot format (gnuplot) - * 2) VTI format (vti) - * 3) Povray format (povray) - only for 3D. - */ - bool draw( const tnlString& fileName, - const tnlString& format, - const tnlStaticVector< 3, Index > steps = ( tnlStaticVector< 3, Index > ) 1 ) const; - - protected: - tnlStaticVector< 3, Real > domainLowerCorner, domainUpperCorner, spaceSteps; -}; - -#include <legacy/mesh/implementation/tnlGrid1D_impl.h> -#include <legacy/mesh/implementation/tnlGrid2D_impl.h> -#include <legacy/mesh/implementation/tnlGrid3D_impl.h> - -/* -#ifdef TEMPLATE_EXPLICIT_INSTANTIATION - -extern template class tnlGridOld< 1, float, tnlHost, int >; -extern template class tnlGridOld< 1, double, tnlHost, int >; -extern template class tnlGridOld< 1, float, tnlHost, long int >; -extern template class tnlGridOld< 1, double, tnlHost, long int >; -extern template class tnlGridOld< 2, float, tnlHost, int >; -extern template class tnlGridOld< 2, double, tnlHost, int >; -extern template class tnlGridOld< 2, float, tnlHost, long int >; -extern template class tnlGridOld< 2, double, tnlHost, long int >; -extern template class tnlGridOld< 3, float, tnlHost, int >; -extern template class tnlGridOld< 3, double, tnlHost, int >; -extern template class tnlGridOld< 3, float, tnlHost, long int >; -extern template class tnlGridOld< 3, double, tnlHost, long int >; - -#ifdef HAVE_CUDA - -extern template class tnlGridOld< 1, float, tnlCuda, int >; -extern template class tnlGridOld< 1, double, tnlCuda, int >; -extern template class tnlGridOld< 1, float, tnlCuda, long int >; -extern template class tnlGridOld< 1, double, tnlCuda, long int >; -extern template class tnlGridOld< 2, float, tnlCuda, int >; -extern template class tnlGridOld< 2, double, tnlCuda, int >; -extern template class tnlGridOld< 2, float, tnlCuda, long int >; -extern template class tnlGridOld< 2, double, tnlCuda, long int >; -extern template class tnlGridOld< 3, float, tnlCuda, int >; -extern template class tnlGridOld< 3, double, tnlCuda, int >; -extern template class tnlGridOld< 3, float, tnlCuda, long int >; -extern template class tnlGridOld< 3, double, tnlCuda, long int >; - -#endif - -#endif -*/ -#endif /* tnlGridOld_H_ */ - diff --git a/src/matrices/tnlCSRMatrix_impl.h b/src/matrices/tnlCSRMatrix_impl.h index d99ee5732fb53c4111bfe60de1914fd4f484946d..14e889e1d813e28703886ea285869fe895657849 100644 --- a/src/matrices/tnlCSRMatrix_impl.h +++ b/src/matrices/tnlCSRMatrix_impl.h @@ -486,8 +486,7 @@ bool tnlCSRMatrix< Real, Device, Index >::performSORIteration( const Vector& b, { tnlAssert( row >=0 && row < this->getRows(), cerr << "row = " << row - << " this->getRows() = " << this->getRows() - << " this->getName() = " << this->getName() << endl ); + << " this->getRows() = " << this->getRows() << endl ); RealType diagonalValue( 0.0 ); RealType sum( 0.0 ); @@ -505,7 +504,7 @@ bool tnlCSRMatrix< Real, Device, Index >::performSORIteration( const Vector& b, } if( diagonalValue == ( Real ) 0.0 ) { - cerr << "There is zero on the diagonal in " << row << "-th row of the matrix " << this->getName() << ". I cannot perform SOR iteration." << endl; + cerr << "There is zero on the diagonal in " << row << "-th row of the matrix. I cannot perform SOR iteration." << endl; return false; } x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / diagonalValue * ( b[ row ] - sum ); diff --git a/src/matrices/tnlChunkedEllpackMatrix.h b/src/matrices/tnlChunkedEllpackMatrix.h index dc89069ced382f9c28bde37a5a76c290282e7f92..8c39d44d5d6c19939efa0332432ba7d88e0c57a3 100644 --- a/src/matrices/tnlChunkedEllpackMatrix.h +++ b/src/matrices/tnlChunkedEllpackMatrix.h @@ -229,7 +229,8 @@ class tnlChunkedEllpackMatrix : public tnlSparseMatrix< Real, Device, Index > void print( ostream& str ) const; - void printStructure( ostream& str ) const; + void printStructure( ostream& str, + const tnlString& = "" ) const; protected: diff --git a/src/matrices/tnlChunkedEllpackMatrix_impl.h b/src/matrices/tnlChunkedEllpackMatrix_impl.h index 49ea5e9ab286a91bc44cfb8b2fb7bd187b152f80..a867c847fc99099ab4fa82b621f3e017efe6e27e 100644 --- a/src/matrices/tnlChunkedEllpackMatrix_impl.h +++ b/src/matrices/tnlChunkedEllpackMatrix_impl.h @@ -42,12 +42,6 @@ tnlChunkedEllpackMatrix< Real, Device, Index >::tnlChunkedEllpackMatrix() desiredChunkSize( 16 ), numberOfSlices( 0 ) { - this->values.setName( "tnlChunkedEllpackMatrix::values" ); - this->columnIndexes.setName( "tnlChunkedEllpackMatrix::columnIndexes" ); - rowToChunkMapping.setName( "tnlChunkedEllpackMatrix::rowToChunkMapping" ); - rowToSliceMapping.setName( "tnlChunkedEllpackMatrix::rowToSliceMapping" ); - rowPointers.setName( "tnlChunkedEllpackMatrix::rowPointers" ); - slices.setName( "tnlChunkedEllpackMatrix::slices" ); }; template< typename Real, @@ -353,9 +347,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::operator == ( const tnlChun cerr << "this->getRows() = " << this->getRows() << " matrix.getRows() = " << matrix.getRows() << " this->getColumns() = " << this->getColumns() - << " matrix.getColumns() = " << matrix.getColumns() - << " this->getName() = " << this->getName() - << " matrix.getName() = " << matrix.getName() ); + << " matrix.getColumns() = " << matrix.getColumns() ); // TODO: implement this return false; } @@ -1154,8 +1146,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::performSORIteration( const { tnlAssert( row >=0 && row < this->getRows(), cerr << "row = " << row - << " this->getRows() = " << this->getRows() - << " this->getName() = " << this->getName() << endl ); + << " this->getRows() = " << this->getRows() << endl ); RealType diagonalValue( 0.0 ); RealType sum( 0.0 ); @@ -1176,7 +1167,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::performSORIteration( const } if( diagonalValue == ( Real ) 0.0 ) { - cerr << "There is zero on the diagonal in " << row << "-th row of thge matrix " << this->getName() << ". I cannot perform SOR iteration." << endl; + cerr << "There is zero on the diagonal in " << row << "-th row of a matrix. I cannot perform SOR iteration." << endl; return false; } x. setElement( row, x[ row ] + omega / diagonalValue * ( b[ row ] - sum ) ); @@ -1258,11 +1249,12 @@ void tnlChunkedEllpackMatrix< Real, Device, Index >::print( ostream& str ) const template< typename Real, typename Device, typename Index > -void tnlChunkedEllpackMatrix< Real, Device, Index >::printStructure( ostream& str ) const +void tnlChunkedEllpackMatrix< Real, Device, Index >::printStructure( ostream& str, + const tnlString& name ) const { const IndexType numberOfSlices = this->getNumberOfSlices(); str << "Matrix type: " << getType() << endl - << "Marix name: " << this->getName() << endl + << "Marix name: " << name << endl << "Rows: " << this->getRows() << endl << "Columns: " << this->getColumns() << endl << "Slices: " << numberOfSlices << endl; diff --git a/src/matrices/tnlDenseMatrix_impl.h b/src/matrices/tnlDenseMatrix_impl.h index aa5f316aa027ccc916c7042ac034aaa9e657364c..557070f17207fb357e1b16094cabab3dbcb498ee 100644 --- a/src/matrices/tnlDenseMatrix_impl.h +++ b/src/matrices/tnlDenseMatrix_impl.h @@ -217,8 +217,7 @@ bool tnlDenseMatrix< Real, Device, Index >::setRowFast( const IndexType row, { tnlAssert( elements <= this->getColumns(), cerr << " elements = " << elements - << " this->columns = " << this->getColumns() - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->getColumns() ); for( IndexType i = 0; i < elements; i++ ) this->setElementFast( row, columns[ i ], values[ i ] ); return true; @@ -234,8 +233,7 @@ bool tnlDenseMatrix< Real, Device, Index >::setRow( const IndexType row, { tnlAssert( elements <= this->getColumns(), cerr << " elements = " << elements - << " this->columns = " << this->getColumns() - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->getColumns() ); for( IndexType i = 0; i < elements; i++ ) this->setElement( row, columns[ i ], values[ i ] ); return true; @@ -253,8 +251,7 @@ bool tnlDenseMatrix< Real, Device, Index >::addRowFast( const IndexType row, { tnlAssert( elements <= this->columns, cerr << " elements = " << elements - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->columns ); for( IndexType i = 0; i < elements; i++ ) this->setElementFast( row, columns[ i ], thisRowMultiplicator * this->getElementFast( row, columns[ i ] ) + values[ i ] ); @@ -272,8 +269,7 @@ bool tnlDenseMatrix< Real, Device, Index >::addRow( const IndexType row, { tnlAssert( elements <= this->columns, cerr << " elements = " << elements - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->columns ); for( IndexType i = 0; i < elements; i++ ) this->setElement( row, columns[ i ], thisRowMultiplicator * this->getElement( row, columns[ i ] ) + values[ i ] ); @@ -378,14 +374,10 @@ void tnlDenseMatrix< Real, Device, Index >::vectorProduct( const InVector& inVec { tnlAssert( this->getColumns() == inVector.getSize(), cerr << "Matrix columns: " << this->getColumns() << endl - << "Matrix name: " << this->getName() << endl - << "Vector size: " << inVector.getSize() << endl - << "Vector name: " << inVector.getName() << endl ); + << "Vector size: " << inVector.getSize() << endl ); tnlAssert( this->getRows() == outVector.getSize(), cerr << "Matrix rows: " << this->getRows() << endl - << "Matrix name: " << this->getName() << endl - << "Vector size: " << outVector.getSize() << endl - << "Vector name: " << outVector.getName() << endl ); + << "Vector size: " << outVector.getSize() << endl ); DeviceDependentCode::vectorProduct( *this, inVector, outVector ); } @@ -402,10 +394,8 @@ void tnlDenseMatrix< Real, Device, Index >::addMatrix( const Matrix& matrix, this->getRows() == matrix.getRows(), cerr << "This matrix columns: " << this->getColumns() << endl << "This matrix rows: " << this->getRows() << endl - << "This matrix name: " << this->getName() << endl << "That matrix columns: " << matrix.getColumns() << endl - << "That matrix rows: " << matrix.getRows() << endl - << "That matrix name: " << matrix.getName() << endl ); + << "That matrix rows: " << matrix.getRows() << endl ); if( thisMatrixMultiplicator == 1.0 ) this->values.addVector( matrix.values, matrixMultiplicator ); @@ -526,13 +516,10 @@ void tnlDenseMatrix< Real, Device, Index >::getMatrixProduct( const Matrix1& mat this->getColumns() == matrix2.getColumns(), cerr << "This matrix columns: " << this->getColumns() << endl << "This matrix rows: " << this->getRows() << endl - << "This matrix name: " << this->getName() << endl << "Matrix1 columns: " << matrix1.getColumns() << endl << "Matrix1 rows: " << matrix1.getRows() << endl - << "Matrix1 name: " << matrix1.getName() << endl << "Matrix2 columns: " << matrix2.getColumns() << endl - << "Matrix2 rows: " << matrix2.getRows() << endl - << "Matrix2 name: " << matrix2.getName() << endl ); + << "Matrix2 rows: " << matrix2.getRows() << endl ); if( Device::getDevice() == tnlHostDevice ) for( IndexType i = 0; i < this->getRows(); i += tileDim ) @@ -763,11 +750,9 @@ void tnlDenseMatrix< Real, Device, Index >::getTransposition( const Matrix& matr tnlAssert( this->getColumns() == matrix.getRows() && this->getRows() == matrix.getColumns(), cerr << "This matrix columns: " << this->getColumns() << endl - << "This matrix rows: " << this->getRows() << endl - << "This matrix name: " << this->getName() << endl + << "This matrix rows: " << this->getRows() << endl << "That matrix columns: " << matrix.getColumns() << endl - << "That matrix rows: " << matrix.getRows() << endl - << "That matrix name: " << matrix.getName() << endl ); + << "That matrix rows: " << matrix.getRows() << endl ); if( Device::getDevice() == tnlHostDevice ) { diff --git a/src/matrices/tnlEllpackMatrix_impl.h b/src/matrices/tnlEllpackMatrix_impl.h index 088dd84e404b0663e18f0b53552f1738aa5138f4..410f58b1be0199ccb7a211629466a5e868867cc0 100644 --- a/src/matrices/tnlEllpackMatrix_impl.h +++ b/src/matrices/tnlEllpackMatrix_impl.h @@ -138,9 +138,7 @@ bool tnlEllpackMatrix< Real, Device, Index >::operator == ( const tnlEllpackMatr cerr << "this->getRows() = " << this->getRows() << " matrix.getRows() = " << matrix.getRows() << " this->getColumns() = " << this->getColumns() - << " matrix.getColumns() = " << matrix.getColumns() - << " this->getName() = " << this->getName() - << " matrix.getName() = " << matrix.getName() ); + << " matrix.getColumns() = " << matrix.getColumns() ); // TODO: implement this return false; } @@ -539,8 +537,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: performSORIteration( const Vecto { tnlAssert( row >=0 && row < this->getRows(), cerr << "row = " << row - << " this->getRows() = " << this->getRows() - << " this->getName() = " << this->getName() << endl ); + << " this->getRows() = " << this->getRows() << endl ); RealType diagonalValue( 0.0 ); RealType sum( 0.0 ); @@ -560,7 +557,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: performSORIteration( const Vecto } if( diagonalValue == ( Real ) 0.0 ) { - cerr << "There is zero on the diagonal in " << row << "-th row of thge matrix " << this->getName() << ". I cannot perform SOR iteration." << endl; + cerr << "There is zero on the diagonal in " << row << "-th row of a matrix. I cannot perform SOR iteration." << endl; return false; } x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / diagonalValue * ( b[ row ] - sum ); diff --git a/src/matrices/tnlMultidiagonalMatrix_impl.h b/src/matrices/tnlMultidiagonalMatrix_impl.h index c64660b8f3087ffae4e7876a02f7ffec62cf652d..f425782cfdd10bcee847d548b5178b1852020278 100644 --- a/src/matrices/tnlMultidiagonalMatrix_impl.h +++ b/src/matrices/tnlMultidiagonalMatrix_impl.h @@ -193,9 +193,7 @@ bool tnlMultidiagonalMatrix< Real, Device, Index >::operator == ( const tnlMulti cerr << "this->getRows() = " << this->getRows() << " matrix.getRows() = " << matrix.getRows() << " this->getColumns() = " << this->getColumns() - << " matrix.getColumns() = " << matrix.getColumns() - << " this->getName() = " << this->getName() - << " matrix.getName() = " << matrix.getName() ); + << " matrix.getColumns() = " << matrix.getColumns() ); return ( this->diagonals == matrix.diagonals && this->values == matrix.values ); } @@ -512,14 +510,10 @@ void tnlMultidiagonalMatrix< Real, Device, Index >::vectorProduct( const InVecto { tnlAssert( this->getColumns() == inVector.getSize(), cerr << "Matrix columns: " << this->getColumns() << endl - << "Matrix name: " << this->getName() << endl - << "Vector size: " << inVector.getSize() << endl - << "Vector name: " << inVector.getName() << endl ); + << "Vector size: " << inVector.getSize() << endl ); tnlAssert( this->getRows() == outVector.getSize(), cerr << "Matrix rows: " << this->getRows() << endl - << "Matrix name: " << this->getName() << endl - << "Vector size: " << outVector.getSize() << endl - << "Vector name: " << outVector.getName() << endl ); + << "Vector size: " << outVector.getSize() << endl ); DeviceDependentCode::vectorProduct( *this, inVector, outVector ); } @@ -572,8 +566,7 @@ bool tnlMultidiagonalMatrix< Real, Device, Index > :: performSORIteration( const { tnlAssert( row >=0 && row < this->getRows(), cerr << "row = " << row - << " this->getRows() = " << this->getRows() - << " this->getName() = " << this->getName() << endl ); + << " this->getRows() = " << this->getRows() << endl ); RealType diagonalValue( 0.0 ); RealType sum( 0.0 ); @@ -595,7 +588,7 @@ bool tnlMultidiagonalMatrix< Real, Device, Index > :: performSORIteration( const } if( diagonalValue == ( Real ) 0.0 ) { - cerr << "There is zero on the diagonal in " << row << "-th row of thge matrix " << this->getName() << ". I cannot perform SOR iteration." << endl; + cerr << "There is zero on the diagonal in " << row << "-th row of thge matrix. I cannot perform SOR iteration." << endl; return false; } x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / diagonalValue * ( b[ row ] - sum ); @@ -668,12 +661,10 @@ bool tnlMultidiagonalMatrix< Real, Device, Index >::getElementIndex( const Index { tnlAssert( row >=0 && row < this->rows, cerr << "row = " << row - << " this->rows = " << this->rows - << " this->getName() = " << this->getName() << endl ); + << " this->rows = " << this->rows << endl ); tnlAssert( column >=0 && column < this->columns, cerr << "column = " << column - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() << endl ); + << " this->columns = " << this->columns << endl ); typedef tnlMultidiagonalMatrixDeviceDependentCode< Device > DDCType; IndexType i( 0 ); @@ -699,12 +690,10 @@ bool tnlMultidiagonalMatrix< Real, Device, Index >::getElementIndexFast( const I { tnlAssert( row >=0 && row < this->rows, cerr << "row = " << row - << " this->rows = " << this->rows - << " this->getName() = " << this->getName() << endl ); + << " this->rows = " << this->rows << endl ); tnlAssert( column >=0 && column < this->columns, cerr << "column = " << column - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() << endl ); + << " this->columns = " << this->columns << endl ); typedef tnlMultidiagonalMatrixDeviceDependentCode< Device > DDCType; IndexType i( 0 ); diff --git a/src/matrices/tnlSlicedEllpackMatrix_impl.h b/src/matrices/tnlSlicedEllpackMatrix_impl.h index 0b79139f846b4dd7a515db4ec5f8033451c53350..442ebb514dc38ab251f1aad763afc48630b5dfb9 100644 --- a/src/matrices/tnlSlicedEllpackMatrix_impl.h +++ b/src/matrices/tnlSlicedEllpackMatrix_impl.h @@ -137,9 +137,7 @@ bool tnlSlicedEllpackMatrix< Real, Device, Index, SliceSize >::operator == ( con cerr << "this->getRows() = " << this->getRows() << " matrix.getRows() = " << matrix.getRows() << " this->getColumns() = " << this->getColumns() - << " matrix.getColumns() = " << matrix.getColumns() - << " this->getName() = " << this->getName() - << " matrix.getName() = " << matrix.getName() ); + << " matrix.getColumns() = " << matrix.getColumns() ); // TODO: implement this return false; } @@ -549,8 +547,7 @@ bool tnlSlicedEllpackMatrix< Real, Device, Index, SliceSize >::performSORIterati { tnlAssert( row >=0 && row < this->getRows(), cerr << "row = " << row - << " this->getRows() = " << this->getRows() - << " this->getName() = " << this->getName() << endl ); + << " this->getRows() = " << this->getRows() << endl ); RealType diagonalValue( 0.0 ); RealType sum( 0.0 ); @@ -573,7 +570,7 @@ bool tnlSlicedEllpackMatrix< Real, Device, Index, SliceSize >::performSORIterati } if( diagonalValue == ( Real ) 0.0 ) { - cerr << "There is zero on the diagonal in " << row << "-th row of the matrix " << this->getName() << ". I cannot perform SOR iteration." << endl; + cerr << "There is zero on the diagonal in " << row << "-th row of a matrix. I cannot perform SOR iteration." << endl; return false; } x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / diagonalValue * ( b[ row ] - sum ); diff --git a/src/matrices/tnlTridiagonalMatrix_impl.h b/src/matrices/tnlTridiagonalMatrix_impl.h index 56b7aee702867da7cceec2e106a11ac7819da866..6791f7b48fa5966121e1f0a2e045f1cf95f98506 100644 --- a/src/matrices/tnlTridiagonalMatrix_impl.h +++ b/src/matrices/tnlTridiagonalMatrix_impl.h @@ -247,8 +247,7 @@ bool tnlTridiagonalMatrix< Real, Device, Index >::setRowFast( const IndexType ro { tnlAssert( elements <= this->columns, cerr << " elements = " << elements - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->columns ); return this->addRowFast( row, columns, values, elements, 0.0 ); } @@ -262,8 +261,7 @@ bool tnlTridiagonalMatrix< Real, Device, Index >::setRow( const IndexType row, { tnlAssert( elements <= this->columns, cerr << " elements = " << elements - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->columns ); return this->addRow( row, columns, values, elements, 0.0 ); } @@ -279,8 +277,7 @@ bool tnlTridiagonalMatrix< Real, Device, Index >::addRowFast( const IndexType ro { tnlAssert( elements <= this->columns, cerr << " elements = " << elements - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->columns ); if( elements > 3 ) return false; for( IndexType i = 0; i < elements; i++ ) @@ -304,8 +301,7 @@ bool tnlTridiagonalMatrix< Real, Device, Index >::addRow( const IndexType row, { tnlAssert( elements <= this->columns, cerr << " elements = " << elements - << " this->columns = " << this->columns - << " this->getName() = " << this->getName() ); + << " this->columns = " << this->columns ); if( elements > 3 ) return false; for( IndexType i = 0; i < elements; i++ ) @@ -419,14 +415,10 @@ void tnlTridiagonalMatrix< Real, Device, Index >::vectorProduct( const InVector& { tnlAssert( this->getColumns() == inVector.getSize(), cerr << "Matrix columns: " << this->getColumns() << endl - << "Matrix name: " << this->getName() << endl - << "Vector size: " << inVector.getSize() << endl - << "Vector name: " << inVector.getName() << endl ); + << "Vector size: " << inVector.getSize() << endl ); tnlAssert( this->getRows() == outVector.getSize(), cerr << "Matrix rows: " << this->getRows() << endl - << "Matrix name: " << this->getName() << endl - << "Vector size: " << outVector.getSize() << endl - << "Vector name: " << outVector.getName() << endl ); + << "Vector size: " << outVector.getSize() << endl ); DeviceDependentCode::vectorProduct( *this, inVector, outVector ); } @@ -441,8 +433,7 @@ void tnlTridiagonalMatrix< Real, Device, Index >::addMatrix( const tnlTridiagona { tnlAssert( this->getRows() == matrix.getRows(), cerr << "This matrix columns: " << this->getColumns() << endl - << "This matrix rows: " << this->getRows() << endl - << "This matrix name: " << this->getName() << endl ); + << "This matrix rows: " << this->getRows() << endl ); if( thisMatrixMultiplicator == 1.0 ) this->values.addVector( matrix.values, matrixMultiplicator ); @@ -551,7 +542,7 @@ bool tnlTridiagonalMatrix< Real, Device, Index >::save( tnlFile& file ) const if( ! tnlMatrix< Real, Device, Index >::save( file ) || ! this->values.save( file ) ) { - cerr << "Unable to save the tridiagonal matrix " << this->getName() << "." << endl; + cerr << "Unable to save a tridiagonal matrix." << endl; return false; } return true; @@ -565,7 +556,7 @@ bool tnlTridiagonalMatrix< Real, Device, Index >::load( tnlFile& file ) if( ! tnlMatrix< Real, Device, Index >::load( file ) || ! this->values.load( file ) ) { - cerr << "Unable to save the tridiagonal matrix " << this->getName() << "." << endl; + cerr << "Unable to save a tridiagonal matrix." << endl; return false; } return true; diff --git a/src/mesh/layers/tnlMeshStorageLayer.h b/src/mesh/layers/tnlMeshStorageLayer.h index 405a9799de11082f7dbdb7520d3b5489e5bd57f4..7f580fd1ff4edb770274f111999aace8ed883161 100644 --- a/src/mesh/layers/tnlMeshStorageLayer.h +++ b/src/mesh/layers/tnlMeshStorageLayer.h @@ -70,8 +70,6 @@ class tnlMeshStorageLayer< ConfigTag, tnlMeshStorageLayer() { - this->entities.setName( tnlString( "tnlMeshStorageLayer < " ) + tnlString( DimensionsTraits::value ) + " >::entities" ); - this->sharedEntities.setName( tnlString( "tnlMeshStorageLayer < " ) + tnlString( DimensionsTraits::value ) + " >::sharedEntities" ); } /*~tnlMeshStorageLayer() @@ -198,8 +196,6 @@ class tnlMeshStorageLayer< ConfigTag, tnlMeshStorageLayer() { - this->vertices.setName( tnlString( "tnlMeshStorageLayer < " ) + tnlString( DimensionsTraits::value ) + " >::vertices" ); - this->sharedVertices.setName( tnlString( "tnlMeshStorageLayer < " ) + tnlString( DimensionsTraits::value ) + " >::sharedVertices" ); } /*~tnlMeshStorageLayer() diff --git a/src/mesh/layers/tnlMeshSubentityStorageLayer.h b/src/mesh/layers/tnlMeshSubentityStorageLayer.h index ce7e54c82e714720723afd7aa125134657779056..375ae8e0af05dd53f52b936079401c9764fb5c14 100644 --- a/src/mesh/layers/tnlMeshSubentityStorageLayer.h +++ b/src/mesh/layers/tnlMeshSubentityStorageLayer.h @@ -73,8 +73,6 @@ class tnlMeshSubentityStorageLayer< ConfigTag, { this->subentitiesIndices.setValue( -1 ); this->sharedSubentitiesIndices.bind( this->subentitiesIndices ); - this->sharedSubentitiesIndices.setName( "sharedSubentitiesIndices" ); - //this->subentitiesIndices.setName( "subentitiesIndices" ); } /*~tnlMeshSubentityStorageLayer() diff --git a/src/mesh/layers/tnlMeshSuperentityStorageLayer.h b/src/mesh/layers/tnlMeshSuperentityStorageLayer.h index d7184117c9eff82b5c260307d25f69f2b183bde6..0a7923082352ef2720f14121071baadbc6cb5fa7 100644 --- a/src/mesh/layers/tnlMeshSuperentityStorageLayer.h +++ b/src/mesh/layers/tnlMeshSuperentityStorageLayer.h @@ -79,15 +79,11 @@ class tnlMeshSuperentityStorageLayer< ConfigTag, tnlMeshSuperentityStorageLayer() { - this->superentitiesIndices.setName( tnlString( "tnlMeshSuperentityStorageLayer < " ) + tnlString( DimensionsTraits::value ) + " >::superentitiesIndices" ); - this->sharedSuperentitiesIndices.setName( tnlString( "tnlMeshSuperentityStorageLayer < " ) + tnlString( DimensionsTraits::value ) + " >::sharedSuperentitiesIndices" ); } /*~tnlMeshSuperentityStorageLayer() { cerr << " Destroying " << this->superentitiesIndices.getSize() << " superentities with "<< DimensionsTraits::value << " dimensions." << endl; - cerr << " this->superentitiesIndices.getName() = " << this->superentitiesIndices.getName() << endl; - cerr << " this->sharedSuperentitiesIndices.getName() = " << this->sharedSuperentitiesIndices.getName() << endl; }*/ tnlMeshSuperentityStorageLayer& operator = ( const tnlMeshSuperentityStorageLayer& layer ) diff --git a/src/mesh/tnlGrid1D_impl.h b/src/mesh/tnlGrid1D_impl.h index 61006531c3ce3478c64301de225203d10596c16d..776d9570c502c2bb77372660392ffff94a25a4a1 100644 --- a/src/mesh/tnlGrid1D_impl.h +++ b/src/mesh/tnlGrid1D_impl.h @@ -165,8 +165,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getCellIndex( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); return cellCoordinates.x(); } @@ -179,8 +178,7 @@ tnlGrid< 1, Real, Device, Index > :: getCellCoordinates( const Index cellIndex ) { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return CoordinatesType( cellIndex ); } @@ -192,8 +190,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getVertexIndex( const CoordinatesType { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); return vertexCoordinates.x(); } @@ -206,8 +203,7 @@ tnlGrid< 1, Real, Device, Index > :: getVertexCoordinates( const Index vertexInd { tnlAssert( vertexIndex >= 0 && vertexIndex < this->getNumberOfVertices(), cerr << " vertexIndex = " << vertexIndex - << " this->getNumberOfVertices() = " << this->getNumberOfVertices() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfVertices() = " << this->getNumberOfVertices() ); return CoordinatesType( vertexIndex ); } @@ -222,8 +218,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getCellNextToCell( const IndexType& c cellIndex + dx < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex << " dx = " << dx - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return cellIndex + dx; } @@ -281,8 +276,7 @@ Vertex tnlGrid< 1, Real, Device, Index >::getCellCenter( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ) + << " this->getDimensions().x() = " << this->getDimensions().x() ); return this->origin.x() + ( cellCoordinates.x() + 0.5 ) * this->cellProportions.x(); } @@ -295,8 +289,7 @@ Vertex tnlGrid< 1, Real, Device, Index >::getCellCenter( const IndexType& cellIn { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return this->getCellCenter< VertexType >( this->getCellCoordinates( cellIndex ) ); } @@ -309,8 +302,7 @@ Vertex tnlGrid< 1, Real, Device, Index >::getVertex( const CoordinatesType& vert { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); return Vertex( this->origin.x() + vertexCoordinates.x() * this->cellProportions.x() ); } @@ -340,8 +332,7 @@ bool tnlGrid< 1, Real, Device, Index > :: isBoundaryCell( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); if( cellCoordinates.x() == 0 || cellCoordinates.x() == this->getDimensions().x() - 1 ) return true; return false; @@ -357,8 +348,7 @@ isBoundaryCell( const IndexType& cellIndex ) const { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return this->isBoundaryCell( this->getCellCoordinates( cellIndex ) ); } @@ -370,8 +360,7 @@ bool tnlGrid< 1, Real, Device, Index > :: isBoundaryVertex( const CoordinatesTyp { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); if( vertexCoordinates.x() == 0 || vertexCoordinates.x() == this->getDimensions().x() ) return true; return false; @@ -425,8 +414,7 @@ bool tnlGrid< 1, Real, Device, Index >::save( tnlFile& file ) const ! this->proportions.save( file ) || ! this->dimensions.save( file ) ) { - cerr << "I was not able to save the domain description of the tnlGrid " - << this -> getName() << endl; + cerr << "I was not able to save the domain description of a tnlGrid." << endl; return false; } return true; @@ -444,8 +432,7 @@ bool tnlGrid< 1, Real, Device, Index > :: load( tnlFile& file ) ! this->proportions.load( file ) || ! dimensions.load( file ) ) { - cerr << "I was not able to load the domain description of the tnlGrid " - << this -> getName() << endl; + cerr << "I was not able to load the domain description of a tnlGrid." << endl; return false; } this -> setDimensions( dimensions ); @@ -490,8 +477,9 @@ bool tnlGrid< 1, Real, Device, Index > :: write( const MeshFunction& function, { if( this->getNumberOfCells() != function. getSize() ) { - cerr << "The size ( " << function. getSize() << " ) of the mesh function " << function. getName() - << " does not agree with the DOFs ( " << this -> getNumberOfCells() << " ) of the mesh " << this -> getName() << "." << endl; + cerr << "The size ( " << function. getSize() + << " ) of the mesh function does not agree with the DOFs ( " + << this -> getNumberOfCells() << " ) of a mesh." << endl; return false; } fstream file; diff --git a/src/mesh/tnlGrid2D_impl.h b/src/mesh/tnlGrid2D_impl.h index 632fc6de2c0aef346ae38a4036a291bf466d40dc..000077e05fddc0ed29d0a43a0b5e4d524f7132a5 100644 --- a/src/mesh/tnlGrid2D_impl.h +++ b/src/mesh/tnlGrid2D_impl.h @@ -181,12 +181,10 @@ Index tnlGrid< 2, Real, Device, Index > :: getCellIndex( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( cellCoordinates.y() >= 0 && cellCoordinates.y() < this->getDimensions().y(), cerr << "cellCoordinates.y() = " << cellCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ) + << " this->getDimensions().y() = " << this->getDimensions().y() ) return cellCoordinates.y() * this->dimensions.x() + cellCoordinates.x(); } @@ -200,8 +198,7 @@ tnlGrid< 2, Real, Device, Index >::getCellCoordinates( const Index cellIndex ) c { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return CoordinatesType( cellIndex % this->getDimensions().x(), cellIndex / this->getDimensions().x() ); } @@ -217,22 +214,18 @@ Index tnlGrid< 2, Real, Device, Index >::getFaceIndex( const CoordinatesType& fa { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x() + 1, cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); return faceCoordinates.y() * ( this->getDimensions().x() + 1 ) + faceCoordinates.x(); } tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y() + 1, cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); return this->numberOfNxFaces + faceCoordinates.y() * this->getDimensions().x() + faceCoordinates.x(); } @@ -245,8 +238,7 @@ tnlGrid< 2, Real, Device, Index >::getFaceCoordinates( const Index faceIndex, in { tnlAssert( faceIndex >= 0 && faceIndex < ( this->template getNumberOfFaces< 1, 1 >() ), cerr << " faceIndex = " << faceIndex - << " this->getNumberOfFaces() = " << ( this->template getNumberOfFaces< 1, 1 >() ) - << " this->getName() " << this->getName(); ); + << " this->getNumberOfFaces() = " << ( this->template getNumberOfFaces< 1, 1 >() ) ); if( faceIndex < this->numberOfNxFaces ) { nx = 1; @@ -269,12 +261,10 @@ Index tnlGrid< 2, Real, Device, Index > :: getVertexIndex( const CoordinatesType { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( vertexCoordinates.y() >= 0 && vertexCoordinates.y() < this->getDimensions().y() + 1, cerr << "vertexCoordinates.y() = " << vertexCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); return vertexCoordinates.y() * ( this->dimensions.x() +1 ) + vertexCoordinates.x(); } @@ -287,8 +277,7 @@ tnlGrid< 2, Real, Device, Index > :: getVertexCoordinates( const Index vertexInd { tnlAssert( vertexIndex >= 0 && vertexIndex < this->getNumberOfVertices(), cerr << " vertexIndex = " << vertexIndex - << " this->getNumberOfVertices() = " << this->getNumberOfVertices() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfVertices() = " << this->getNumberOfVertices() ); const IndexType aux = this->dimensions.x() + 1; return CoordinatesType( vertexIndex % aux, vertexIndex / aux ); } @@ -306,8 +295,7 @@ Index tnlGrid< 2, Real, Device, Index >::getCellNextToCell( const IndexType& cel cerr << " cellIndex = " << cellIndex << " dx = " << dx << " dy = " << dy - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return result; } @@ -331,8 +319,7 @@ Index tnlGrid< 2, Real, Device, Index >::getFaceNextToCell( const IndexType& cel cerr << " cellIndex = " << cellIndex << " nx = " << nx << " ny = " << ny - << " this->getNumberOfCells() = " << ( this->getNumberOfCells() ) - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << ( this->getNumberOfCells() ) ); return result; } @@ -474,12 +461,10 @@ Vertex tnlGrid< 2, Real, Device, Index > :: getCellCenter( const CoordinatesType { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( cellCoordinates.y() >= 0 && cellCoordinates.y() < this->getDimensions().y(), cerr << "cellCoordinates.y() = " << cellCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); return Vertex( this->origin.x() + ( cellCoordinates.x() + 0.5 ) * this->cellProportions.x(), this->origin.y() + ( cellCoordinates.y() + 0.5 ) * this->cellProportions.y() ); @@ -494,8 +479,7 @@ Vertex tnlGrid< 2, Real, Device, Index >::getCellCenter( const IndexType& cellIn { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return this->getCellCenter< VertexType >( this->getCellCoordinates( cellIndex ) ); } @@ -511,12 +495,10 @@ Vertex tnlGrid< 2, Real, Device, Index > :: getFaceCenter( const CoordinatesType { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x() + 1, cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); return Vertex( this->origin.x() + faceCoordinates.x() * this->cellProportions.x(), this->origin.y() + ( faceCoordinates.y() + 0.5 ) * this->cellProportions.y() ); } @@ -524,12 +506,10 @@ Vertex tnlGrid< 2, Real, Device, Index > :: getFaceCenter( const CoordinatesType { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y() + 1, cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); return Vertex( this->origin.x() + ( faceCoordinates.x() + 0.5 ) * this->cellProportions.x(), this->origin.y() + faceCoordinates.y() * this->cellProportions.y() ); } @@ -545,12 +525,10 @@ Vertex tnlGrid< 2, Real, Device, Index >::getVertex( const CoordinatesType& vert { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( vertexCoordinates.y() >= 0 && vertexCoordinates.y() < this->getDimensions().y() + 1, cerr << "vertexCoordinates.y() = " << vertexCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); return Vertex( this->origin.x() + vertexCoordinates.x() * this->cellProportions.x(), this->origin.y() + vertexCoordinates.y() * this->cellProportions.y() ); @@ -593,12 +571,10 @@ bool tnlGrid< 2, Real, Device, Index > :: isBoundaryCell( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( cellCoordinates.y() >= 0 && cellCoordinates.y() < this->getDimensions().y(), cerr << "cellCoordinates.y() = " << cellCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); if( cellCoordinates.x() == 0 || cellCoordinates.x() == this->getDimensions().x() - 1 || cellCoordinates.y() == 0 || cellCoordinates.y() == this->getDimensions().y() - 1 ) @@ -617,8 +593,7 @@ isBoundaryCell( const IndexType& cellIndex ) const { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return this->isBoundaryCell( this->getCellCoordinates( cellIndex ) ); } @@ -635,24 +610,20 @@ bool tnlGrid< 2, Real, Device, Index > :: isBoundaryFace( const CoordinatesType& { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x() + 1, cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); if( faceCoordinates.x() == 0 || faceCoordinates.x() == this->getDimensions().x() ) return true; return false; } tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y() + 1, cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); if( faceCoordinates.y() == 0 || faceCoordinates.y() == this->getDimensions().y() ) return true; return false; @@ -667,12 +638,10 @@ bool tnlGrid< 2, Real, Device, Index > :: isBoundaryVertex( const CoordinatesTyp { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( vertexCoordinates.y() >= 0 && vertexCoordinates.y() < this->getDimensions().y() + 1, cerr << "vertexCoordinates.y() = " << vertexCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); if( vertexCoordinates.x() == 0 || vertexCoordinates.x() == this->getDimensions().x() || vertexCoordinates.y() == 0 || vertexCoordinates.y() == this->getDimensions().y() ) @@ -751,8 +720,7 @@ bool tnlGrid< 2, Real, Device, Index > :: save( tnlFile& file ) const ! this->proportions.save( file ) || ! this -> dimensions.save( file ) ) { - cerr << "I was not able to save the domain description of the tnlGrid " - << this -> getName() << endl; + cerr << "I was not able to save the domain description of a tnlGrid." << endl; return false; } return true; @@ -770,8 +738,7 @@ bool tnlGrid< 2, Real, Device, Index > :: load( tnlFile& file ) ! this->proportions.load( file ) || ! dimensions.load( file ) ) { - cerr << "I was not able to load the domain description of the tnlGrid " - << this -> getName() << endl; + cerr << "I was not able to load the domain description of a tnlGrid." << endl; return false; } this -> setDimensions( dimensions ); @@ -914,8 +881,9 @@ bool tnlGrid< 2, Real, Device, Index > :: write( const MeshFunction& function, { if( this->getNumberOfCells() != function. getSize() ) { - cerr << "The size ( " << function. getSize() << " ) of the mesh function " << function. getName() - << " does not agree with the DOFs ( " << this->getNumberOfCells() << " ) of the mesh " << this -> getName() << "." << endl; + cerr << "The size ( " << function. getSize() + << " ) of a mesh function does not agree with the DOFs ( " + << this->getNumberOfCells() << " ) of a mesh." << endl; return false; } fstream file; diff --git a/src/mesh/tnlGrid3D_impl.h b/src/mesh/tnlGrid3D_impl.h index 147f038e595789a7d6ce4d0d4d4b74aa0fb18a4c..377500c4e6f8b4a6b3f23357e55deb0acdd764e7 100644 --- a/src/mesh/tnlGrid3D_impl.h +++ b/src/mesh/tnlGrid3D_impl.h @@ -209,16 +209,13 @@ Index tnlGrid< 3, Real, Device, Index > :: getCellIndex( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( cellCoordinates.y() >= 0 && cellCoordinates.y() < this->getDimensions().y(), cerr << "cellCoordinates.y() = " << cellCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( cellCoordinates.z() >= 0 && cellCoordinates.z() < this->getDimensions().z(), cerr << "cellCoordinates.z() = " << cellCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return ( cellCoordinates.z() * this->dimensions.y() + cellCoordinates.y() ) * this->dimensions.x() + cellCoordinates.x(); } @@ -231,8 +228,7 @@ tnlGrid< 3, Real, Device, Index > :: getCellCoordinates( const Index cellIndex ) { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return CoordinatesType( cellIndex % this->dimensions.x(), ( cellIndex / this->dimensions.x() ) % this->dimensions.y(), @@ -251,32 +247,26 @@ Index tnlGrid< 3, Real, Device, Index >::getFaceIndex( const CoordinatesType& fa { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x() + 1, cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z(), cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return ( faceCoordinates.z() * this->getDimensions().y() + faceCoordinates.y() ) * ( this->getDimensions().x() + 1 ) + faceCoordinates.x(); } if( ny ) { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y() + 1, cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z(), cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return this->numberOfNxFaces + ( faceCoordinates.z() * ( this->getDimensions().y() + 1 ) + faceCoordinates.y() ) * this->getDimensions().x() + faceCoordinates.x(); } @@ -284,16 +274,13 @@ Index tnlGrid< 3, Real, Device, Index >::getFaceIndex( const CoordinatesType& fa { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y()= " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y()= " << this->getDimensions().y() ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z() + 1, cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); return this->numberOfNxAndNyFaces + ( faceCoordinates.z() * this->getDimensions().y() + faceCoordinates.y() ) * this->getDimensions().x() + faceCoordinates.x(); } @@ -308,8 +295,7 @@ tnlGrid< 3, Real, Device, Index >::getFaceCoordinates( const Index faceIndex, in { tnlAssert( faceIndex >= 0 && faceIndex < this->getNumberOfFaces(), cerr << " faceIndex = " << faceIndex - << " this->getNumberOfFaces() = " << this->getNumberOfFaces() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfFaces() = " << this->getNumberOfFaces() ); if( faceIndex < this->numberOfNxFaces ) { nx = 1; @@ -352,32 +338,26 @@ Index tnlGrid< 3, Real, Device, Index > :: getEdgeIndex( const CoordinatesType& { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x(), cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y() + 1, cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z() + 1, cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); return ( edgeCoordinates.z() * ( this->getDimensions().y() + 1 ) + edgeCoordinates.y() ) * this->getDimensions().x() + edgeCoordinates.x(); } if( dy ) { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x() + 1, cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y(), cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z() + 1, cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1; ); return this->numberOfDxEdges + ( edgeCoordinates.z() * this->getDimensions().y() + edgeCoordinates.y() ) * ( this->getDimensions().x() + 1 ) + edgeCoordinates.x(); } @@ -385,16 +365,13 @@ Index tnlGrid< 3, Real, Device, Index > :: getEdgeIndex( const CoordinatesType& { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x() + 1, cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y() + 1, cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z(), cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return this->numberOfDxAndDyEdges + ( edgeCoordinates.z() * ( this->getDimensions().y() + 1 ) + edgeCoordinates.y() ) * ( this->getDimensions().x() + 1 ) + edgeCoordinates.x(); } @@ -409,8 +386,7 @@ tnlGrid< 3, Real, Device, Index > :: getEdgeCoordinates( const Index edgeIndex, { tnlAssert( edgeIndex >= 0 && edgeIndex < this->getNumberOfEdges(), cerr << " edgeIndex = " << edgeIndex - << " this->getNumberOfEdges() = " << this->getNumberOfEdges() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfEdges() = " << this->getNumberOfEdges() ); if( edgeIndex < this->numberOfDxEdges ) { dx = 1; @@ -452,16 +428,13 @@ Index tnlGrid< 3, Real, Device, Index > :: getVertexIndex( const CoordinatesType { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( vertexCoordinates.y() >= 0 && vertexCoordinates.y() < this->getDimensions().y() + 1, cerr << "vertexCoordinates.y() = " << vertexCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( vertexCoordinates.z() >= 0 && vertexCoordinates.z() < this->getDimensions().z() + 1, cerr << "vertexCoordinates.z() = " << vertexCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); return ( vertexCoordinates.z() * ( this->getDimensions().y() + 1 ) + vertexCoordinates.y() ) * ( this->getDimensions().x() + 1 ) + vertexCoordinates.x(); } @@ -475,8 +448,7 @@ tnlGrid< 3, Real, Device, Index > :: getVertexCoordinates( const Index vertexInd { tnlAssert( vertexIndex >= 0 && vertexIndex < this->getNumberOfVertices(), cerr << " vertexIndex = " << vertexIndex - << " this->getNumberOfVertices() = " << this->getNumberOfVertices() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfVertices() = " << this->getNumberOfVertices() ); const IndexType auxX = this->getDimensions().x() + 1; const IndexType auxY = this->getDimensions().y() + 1; const IndexType auxZ = this->getDimensions().z() + 1; @@ -502,8 +474,7 @@ Index tnlGrid< 3, Real, Device, Index > :: getCellNextToCell( const IndexType& c << " dx = " << dx << " dy = " << dy << " dz = " << dz - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return cellIndex + dx + dy * this->getDimensions().x() + dz * this->cellZNeighboursStep; @@ -533,8 +504,7 @@ Index tnlGrid< 3, Real, Device, Index >::getFaceNextToCell( const IndexType& cel << " nx = " << nx << " ny = " << ny << " nz = " << nz - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return result; } @@ -582,8 +552,7 @@ Index tnlGrid< 3, Real, Device, Index >::getCellNextToFace( const IndexType& fac << " nx = " << nx << " ny = " << ny << " nz = " << nz - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return result; } @@ -768,16 +737,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getCellCenter( const CoordinatesType { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( cellCoordinates.y() >= 0 && cellCoordinates.y() < this->getDimensions().y(), cerr << "cellCoordinates.y() = " << cellCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( cellCoordinates.z() >= 0 && cellCoordinates.z() < this->getDimensions().z(), cerr << "cellCoordinates.z() = " << cellCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return Vertex( this->origin.x() + ( cellCoordinates.x() + 0.5 ) * this->cellProportions.x(), @@ -794,8 +760,7 @@ Vertex tnlGrid< 3, Real, Device, Index >::getCellCenter( const IndexType& cellIn { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return this->getCellCenter< VertexType >( this->getCellCoordinates( cellIndex ) ); } @@ -811,16 +776,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getFaceCenter( const CoordinatesType { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x() + 1, cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z(), cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return Vertex( this->origin.x() + faceCoordinates.x() * this->cellProportions().x(), this->origin.y() + ( faceCoordinates.y() + 0.5 ) * this->cellProportions().y(), this->origin.z() + ( faceCoordinates.y() + 0.5 ) * this->cellProportions().z() ); @@ -829,16 +791,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getFaceCenter( const CoordinatesType { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y() + 1, cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z(), cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return Vertex( this->origin.x() + ( faceCoordinates.x() + 0.5 ) * this->cellProportions().x(), this->origin.y() + faceCoordinates.y() * this->cellProportions().y(), @@ -848,16 +807,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getFaceCenter( const CoordinatesType { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y()= " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y()= " << this->getDimensions().y() ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z() + 1, cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); return Vertex( this->origin.x() + ( faceCoordinates.x() + 0.5 ) * this->cellProportions().x(), this->origin.y() + ( faceCoordinates.y() + 0.5 ) * this->cellProportions().y(), this->origin.z() + faceCoordinates.z() * this->cellProportions().z() ); @@ -876,16 +832,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getEdgeCenter( const CoordinatesType { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x(), cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y() + 1, cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z() + 1, cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); return Vertex( this->origin.x() + ( edgeCoordinates.x() + 0.5 ) * this->cellProportions().x(), this->origin.y() + edgeCoordinates.y() * this->cellProportions().y(), this->origin.z() + edgeCoordinates.z() * this->cellProportions().z() ); @@ -894,16 +847,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getEdgeCenter( const CoordinatesType { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x() + 1, cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y(), cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z() + 1, cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); return Vertex( this->origin.x() + edgeCoordinates.x() * this->cellProportions().x(), this->origin.y() + ( edgeCoordinates.y() + 0.5 ) * this->cellProportions().y(), this->origin.z() + edgeCoordinates.z() * this->cellProportions().z() ); @@ -912,16 +862,13 @@ Vertex tnlGrid< 3, Real, Device, Index > :: getEdgeCenter( const CoordinatesType { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x() + 1, cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y() + 1, cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z(), cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return Vertex( this->origin.x() + edgeCoordinates.x() * this->cellProportions().x(), this->origin.y() + edgeCoordinates.y() * this->cellProportions().y(), this->origin.z() + ( edgeCoordinates.z() + 0.5 ) * this->cellProportions().z() ); @@ -937,16 +884,13 @@ Vertex tnlGrid< 3, Real, Device, Index >::getVertex( const CoordinatesType& vert { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( vertexCoordinates.y() >= 0 && vertexCoordinates.y() < this->getDimensions().y() + 1, cerr << "vertexCoordinates.y() = " << vertexCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( vertexCoordinates.z() >= 0 && vertexCoordinates.z() < this->getDimensions().z() + 1, cerr << "vertexCoordinates.z() = " << vertexCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); return Vertex( this->origin.x() + vertexCoordinates.x() * this->cellProportions.x(), this->origin.y() + vertexCoordinates.y() * this->cellProportions.y(), @@ -1003,16 +947,13 @@ bool tnlGrid< 3, Real, Device, Index > :: isBoundaryCell( const CoordinatesType& { tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(), cerr << "cellCoordinates.x() = " << cellCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( cellCoordinates.y() >= 0 && cellCoordinates.y() < this->getDimensions().y(), cerr << "cellCoordinates.y() = " << cellCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( cellCoordinates.z() >= 0 && cellCoordinates.z() < this->getDimensions().z(), cerr << "cellCoordinates.z() = " << cellCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); if( cellCoordinates.x() == 0 || cellCoordinates.x() == this->getDimensions().x() - 1 || @@ -1032,8 +973,7 @@ isBoundaryCell( const IndexType& cellIndex ) const { tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(), cerr << " cellIndex = " << cellIndex - << " this->getNumberOfCells() = " << this->getNumberOfCells() - << " this->getName() " << this->getName(); ); + << " this->getNumberOfCells() = " << this->getNumberOfCells() ); return this->isBoundaryCell( this->getCellCoordinates( cellIndex ) ); } @@ -1049,12 +989,10 @@ bool tnlGrid< 3, Real, Device, Index > :: isBoundaryFace( const CoordinatesType& { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x() + 1, cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); if( faceCoordinates.x() == 0 || faceCoordinates.x() == this->getDimensions().y() ) return true; return false; @@ -1063,12 +1001,10 @@ bool tnlGrid< 3, Real, Device, Index > :: isBoundaryFace( const CoordinatesType& { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y() + 1, cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); if( faceCoordinates.y() == 0 || faceCoordinates.y() == this->getDimensions().y() ) return true; return false; @@ -1077,16 +1013,13 @@ bool tnlGrid< 3, Real, Device, Index > :: isBoundaryFace( const CoordinatesType& { tnlAssert( faceCoordinates.x() >= 0 && faceCoordinates.x() < this->getDimensions().x(), cerr << "faceCoordinates.x() = " << faceCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( faceCoordinates.y() >= 0 && faceCoordinates.y() < this->getDimensions().y(), cerr << "faceCoordinates.y() = " << faceCoordinates.y() - << " this->getDimensions().y()= " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y()= " << this->getDimensions().y() ); tnlAssert( faceCoordinates.z() >= 0 && faceCoordinates.z() < this->getDimensions().z() + 1, cerr << "faceCoordinates.z() = " << faceCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); if( faceCoordinates.z() == 0 || faceCoordinates.z() == this->getDimensions().z() ) return true; return false; @@ -1105,16 +1038,13 @@ bool tnlGrid< 3, Real, Device, Index >::isBoundaryEdge( const CoordinatesType& e { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x(), cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y() + 1, cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z() + 1, cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); if( edgeCoordinates.y() == 0 || edgeCoordinates.y() == this->getDimensions().y() || edgeCoordinates.z() == 0 || edgeCoordinates.z() == this->getDimensions().z() ) return true; @@ -1124,16 +1054,13 @@ bool tnlGrid< 3, Real, Device, Index >::isBoundaryEdge( const CoordinatesType& e { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x() + 1, cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y(), cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() = " << this->getDimensions().y() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() = " << this->getDimensions().y() ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z() + 1, cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); if( edgeCoordinates.x() == 0 || edgeCoordinates.x() == this->getDimensions().x() || edgeCoordinates.z() == 0 || edgeCoordinates.z() == this->getDimensions().z() ) return true; @@ -1144,16 +1071,13 @@ bool tnlGrid< 3, Real, Device, Index >::isBoundaryEdge( const CoordinatesType& e { tnlAssert( edgeCoordinates.x() >= 0 && edgeCoordinates.x() < this->getDimensions().x() + 1, cerr << "edgeCoordinates.x() = " << edgeCoordinates.x() - << " this->getDimensions().x() = " << this->getDimensions().x() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() = " << this->getDimensions().x() ); tnlAssert( edgeCoordinates.y() >= 0 && edgeCoordinates.y() < this->getDimensions().y() + 1, cerr << "edgeCoordinates.y() = " << edgeCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( edgeCoordinates.z() >= 0 && edgeCoordinates.z() < this->getDimensions().z(), cerr << "edgeCoordinates.z() = " << edgeCoordinates.z() - << " this->getDimensions().z() = " << this->getDimensions().z() - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() = " << this->getDimensions().z() ); if( edgeCoordinates.x() == 0 || edgeCoordinates.x() == this->getDimensions().x() || edgeCoordinates.y() == 0 || edgeCoordinates.y() == this->getDimensions().y() ) return true; @@ -1169,16 +1093,13 @@ bool tnlGrid< 3, Real, Device, Index > :: isBoundaryVertex( const CoordinatesTyp { tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1, cerr << "vertexCoordinates.x() = " << vertexCoordinates.x() - << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().x() + 1 = " << this->getDimensions().x() + 1 ); tnlAssert( vertexCoordinates.y() >= 0 && vertexCoordinates.y() < this->getDimensions().y() + 1, cerr << "vertexCoordinates.y() = " << vertexCoordinates.y() - << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().y() + 1 = " << this->getDimensions().y() + 1 ); tnlAssert( vertexCoordinates.z() >= 0 && vertexCoordinates.z() < this->getDimensions().z() + 1, cerr << "vertexCoordinates.z() = " << vertexCoordinates.z() - << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 - << " this->getName() = " << this->getName(); ); + << " this->getDimensions().z() + 1 = " << this->getDimensions().z() + 1 ); if( vertexCoordinates.x() == 0 || vertexCoordinates.x() == this->getDimensions().x() || vertexCoordinates.y() == 0 || vertexCoordinates.y() == this->getDimensions().y() || @@ -1269,8 +1190,7 @@ bool tnlGrid< 3, Real, Device, Index > :: save( tnlFile& file ) const ! this->proportions.save( file ) || ! this->dimensions.save( file ) ) { - cerr << "I was not able to save the domain description of the tnlGrid " - << this -> getName() << endl; + cerr << "I was not able to save the domain description of a tnlGrid." << endl; return false; } return true; @@ -1288,8 +1208,7 @@ bool tnlGrid< 3, Real, Device, Index > :: load( tnlFile& file ) ! this->proportions.load( file ) || ! dimensions.load( file ) ) { - cerr << "I was not able to load the domain description of the tnlGrid " - << this -> getName() << endl; + cerr << "I was not able to load the domain description of a tnlGrid." << endl; return false; } this->setDimensions( dimensions ); @@ -1332,8 +1251,8 @@ bool tnlGrid< 3, Real, Device, Index > :: write( const MeshFunction& function, { if( this -> getNumberOfCells() != function. getSize() ) { - cerr << "The size ( " << function. getSize() << " ) of the mesh function " << function. getName() - << " does not agree with the DOFs ( " << this -> getNumberOfCells() << " ) of the mesh " << this -> getName() << "." << endl; + cerr << "The size ( " << function. getSize() + << " ) of a mesh function does not agree with the DOFs ( " << this -> getNumberOfCells() << " ) of a mesh." << endl; return false; } fstream file; diff --git a/src/mesh/tnlMesh.h b/src/mesh/tnlMesh.h index 6455c7d03ec37827c8b53239f7247adbac1a0c9c..7eec5cd0baf4a8795c9a75a0b38a2f185c3fba67 100644 --- a/src/mesh/tnlMesh.h +++ b/src/mesh/tnlMesh.h @@ -35,7 +35,7 @@ class tnlMesh : public tnlObject, /*~tnlMesh() { - cerr << "Destroying mesh " << this->getName() << endl; + cerr << "Destroying mesh." << endl; }*/ static tnlString getType() diff --git a/src/operators/euler/fvm/tnlLaxFridrichs_impl.h b/src/operators/euler/fvm/tnlLaxFridrichs_impl.h index e38cd028f3de8d7a70ccc0dbd46957333f07ace1..c5b014ee6fa4d709e6487fca2357eb7f910bfa09 100644 --- a/src/operators/euler/fvm/tnlLaxFridrichs_impl.h +++ b/src/operators/euler/fvm/tnlLaxFridrichs_impl.h @@ -31,9 +31,6 @@ tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, mesh( 0 ), pressureGradient( 0 ) { - rho. setName( "Lax-Fridrichs:rho" ); - rho_u1. setName( "Lax-Fridrichs:rho_u1" ); - rho_u2. setName( "Lax-Fridrichs:rho_u2" ); } template< typename Real, @@ -99,7 +96,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, PressureGradient > :: setRho( Vector& rho ) { this->rho.bind( rho ); - this->rho.setName( tnlString( "bind Of " ) + rho. getName() ); } template< typename Real, @@ -111,7 +107,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, PressureGradient > :: setRhoU1( Vector& rho_u1 ) { this -> rho_u1. bind( rho_u1 ); - this -> rho_u1. setName( tnlString( "bind Of " ) + rho_u1. getName() ); } template< typename Real, @@ -123,7 +118,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, PressureGradient > :: setRhoU2( Vector& rho_u2 ) { this -> rho_u2. bind( rho_u2 ); - this -> rho_u2. setName( tnlString( "bind Of " ) + rho_u2. getName() ); } template< typename Real, @@ -135,7 +129,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, PressureGradient > :: setE( Vector& e ) { this->e.bind( e ); - this->e.setName( tnlString( "bind Of " ) + e.getName() ); } template< typename Real, @@ -349,7 +342,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry >, PressureGradient > :: setRho( Vector& rho ) { this -> rho. bind( rho ); - this -> rho. setName( tnlString( "bind Of " ) + rho. getName() ); } template< typename Real, @@ -360,7 +352,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry >, PressureGradient > :: setRhoU1( Vector& rho_u1 ) { this -> rho_u1. bind( rho_u1 ); - this -> rho_u1. setName( tnlString( "bind Of " ) + rho_u1. getName() ); } template< typename Real, @@ -371,7 +362,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry >, PressureGradient > :: setRhoU2( Vector& rho_u2 ) { this -> rho_u2. bind( rho_u2 ); - this -> rho_u2. setName( tnlString( "bind Of " ) + rho_u2. getName() ); } template< typename Real, @@ -382,7 +372,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry >, PressureGradient > :: setE( Vector& e ) { this->energy.bind( e ); - this->energy.setName( tnlString( "bind Of " ) + e.getName() ); } template< typename Real, @@ -393,7 +382,6 @@ template< typename Real, void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry >, PressureGradient > :: setP( Vector& p ) { this->p.bind( p ); - this->p.setName( tnlString( "bind Of " ) + p.getName() ); } template< typename Real, diff --git a/src/operators/gradient/tnlCentralFDMGradient_impl.h b/src/operators/gradient/tnlCentralFDMGradient_impl.h index d8cc6bd3b9dc2696855601ede5f7612d3e0bbee9..41eac268a450bd5f87f17b4f66a56314553cfaa4 100644 --- a/src/operators/gradient/tnlCentralFDMGradient_impl.h +++ b/src/operators/gradient/tnlCentralFDMGradient_impl.h @@ -44,7 +44,6 @@ template< typename Real, void tnlCentralFDMGradient< tnlGrid< 2, Real, Device, Index, GridGeometry > > :: setFunction( Vector& f ) { this -> f. bind( f ); - this -> f. setName( tnlString( "bind Of " ) + f. getName() ); } template< typename Real, @@ -115,7 +114,6 @@ template< typename Real, typename Device, typename Index > void tnlCentralFDMGradient< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry > > :: setFunction( Vector& f ) { this -> f. bind( f ); - this -> f. setName( tnlString( "bind Of " ) + f. getName() ); } template< typename Real, typename Device, typename Index > diff --git a/src/solvers/cfd/navier-stokes/tnlNavierStokesSolver_impl.h b/src/solvers/cfd/navier-stokes/tnlNavierStokesSolver_impl.h index ff67a95f6aa12f93863a04afbc7750014a36ab35..085eadf14febf6d65334361dbd2d5b16693c51f9 100644 --- a/src/solvers/cfd/navier-stokes/tnlNavierStokesSolver_impl.h +++ b/src/solvers/cfd/navier-stokes/tnlNavierStokesSolver_impl.h @@ -33,11 +33,6 @@ tnlNavierStokesSolver< AdvectionScheme, DiffusionScheme, BoundaryConditions >::t R( 0.0 ), T( 0.0 ) { - this->rho.setName( "navier-stokes-rho" ); - this->u1.setName( "navier-stokes-u1"); - this->u2.setName( "navier-stokes-u2" ); - this->p.setName( "navier-stokes-p" ); - this->energy.setName( "navier-stokes-energy" ); } template< typename AdvectionScheme, diff --git a/src/solvers/linear/krylov/tnlGMRESSolver_impl.h b/src/solvers/linear/krylov/tnlGMRESSolver_impl.h index cbf970a2297203cbd94c2f2f4f8d44ff7c3e2e26..13582c94a8bfba630dd6d368a8a6fb3491f7dc38 100644 --- a/src/solvers/linear/krylov/tnlGMRESSolver_impl.h +++ b/src/solvers/linear/krylov/tnlGMRESSolver_impl.h @@ -21,16 +21,7 @@ template< typename Matrix, typename Preconditioner > tnlGMRESSolver< Matrix, Preconditioner > :: tnlGMRESSolver() -: tnlObject( "no-name" ), - _r( "tnlGMRESSolver::_r" ), - _w( "tnlGMRESSolver::_w" ), - _v( "tnlGMRESSolver::_v" ), - _M_tmp( "tnlGMRESSolver::_M_tmp" ), - _s( "tnlGMRESSolver::_s" ), - _cs( "tnlGMRESSolver::_cs" ), - _sn( "tnlGMRESSolver::_sn" ), - _H( "tnlGMRESSolver:_H" ), - size( 0 ), +: size( 0 ), restarting( 10 ), matrix( 0 ), preconditioner( 0 ) @@ -159,10 +150,7 @@ bool tnlGMRESSolver< Matrix, Preconditioner > :: solve( const Vector& b, Vector& this->resetIterations(); this->setResidue( beta / normb ); - tnlSharedVector< RealType, DeviceType, IndexType > vi; - //vi. setName( "tnlGMRESSolver::vi" ); - tnlSharedVector< RealType, DeviceType, IndexType > vk; - //vk. setName( "tnlGMRESSolver::vk" ); + tnlSharedVector< RealType, DeviceType, IndexType > vi, vk; while( this->nextIteration() ) { const IndexType m = restarting; @@ -321,15 +309,13 @@ void tnlGMRESSolver< Matrix, Preconditioner > :: update( IndexType k, tnlVector< RealType, DeviceType, IndexType >& v, Vector& x ) { - //dbgFunctionName( "tnlGMRESSolver", "Update" ); - tnlVector< RealType, tnlHost, IndexType > y( "tnlGMRESSolver::update:y" ); + tnlVector< RealType, tnlHost, IndexType > y; y. setSize( m + 1 ); IndexType i, j; for( i = 0; i <= m ; i ++ ) y[ i ] = s[ i ]; - //dbgCout_ARRAY( y, m + 1 ); // Backsolve: for( i = k; i >= 0; i--) { @@ -337,10 +323,8 @@ void tnlGMRESSolver< Matrix, Preconditioner > :: update( IndexType k, for( j = i - 1; j >= 0; j--) y[ j ] -= H[ j + i * ( m + 1 ) ] * y[ i ]; } - //dbgCout_ARRAY( y, m + 1 ); tnlSharedVector< RealType, DeviceType, IndexType > vi; - vi. setName( "tnlGMRESSolver::update:vi" ); for( i = 0; i <= k; i++) { vi. bind( &( v. getData()[ i * this->size ] ), x. getSize() ); diff --git a/src/solvers/ode/tnlEulerSolver_impl.h b/src/solvers/ode/tnlEulerSolver_impl.h index ad83fe96893c7f91e1ab5ed569e16ad697029e74..e2258b39dd9b1410599e4d447ea8921b754c811f 100644 --- a/src/solvers/ode/tnlEulerSolver_impl.h +++ b/src/solvers/ode/tnlEulerSolver_impl.h @@ -30,10 +30,8 @@ __global__ void updateUEuler( const Index size, template< typename Problem > tnlEulerSolver< Problem > :: tnlEulerSolver() -: k1( "tnlEulerSolver:k1" ), - cflCondition( 0.0 ) +: cflCondition( 0.0 ) { - //this->setName( "EulerSolver" ); }; template< typename Problem > diff --git a/src/solvers/ode/tnlMersonSolver_impl.h b/src/solvers/ode/tnlMersonSolver_impl.h index 95241e39acf21bc1868a09115d3a50fdf7b1bac5..bc512effd6a874b3458860ad78de26ebc8893bd2 100644 --- a/src/solvers/ode/tnlMersonSolver_impl.h +++ b/src/solvers/ode/tnlMersonSolver_impl.h @@ -89,13 +89,7 @@ __global__ void updateUMerson( const Index size, template< typename Problem > tnlMersonSolver< Problem > :: tnlMersonSolver() -: k1( "tnlMersonSolver:k1" ), - k2( "tnlMersonSolver:k2" ), - k3( "tnlMersonSolver:k3" ), - k4( "tnlMersonSolver:k4" ), - k5( "tnlMersonSolver:k5" ), - kAux( "tnlMersonSolver:kAux" ), - adaptivity( 0.00001 ) +: adaptivity( 0.00001 ) { }; diff --git a/src/solvers/pde/tnlPDESolver_impl.h b/src/solvers/pde/tnlPDESolver_impl.h index b289344ab6f26a459906247d40da533d52052aeb..8c1cf924762dca784d7637213106a247fdd84002 100644 --- a/src/solvers/pde/tnlPDESolver_impl.h +++ b/src/solvers/pde/tnlPDESolver_impl.h @@ -34,8 +34,6 @@ tnlPDESolver() ioCpuTimer( 0 ), computeCpuTimer( 0 ) { - this->dofs.setName( "dofs" ); - this->meshDependentData.setName( "meshDependentData" ); } template< typename Problem, @@ -321,13 +319,13 @@ tnlPDESolver< Problem, TimeStepper >:: solve() { tnlAssert( timeStepper != 0, - cerr << "No time stepper was set in tnlPDESolver with name " << this -> getName() ); + cerr << "No time stepper was set in tnlPDESolver." ); tnlAssert( problem != 0, - cerr << "No problem was set in tnlPDESolver with name " << this -> getName() ); + cerr << "No problem was set in tnlPDESolver." ); if( snapshotPeriod == 0 ) { - cerr << "No snapshot tau was set in tnlPDESolver " << this -> getName() << "." << endl; + cerr << "No snapshot tau was set in tnlPDESolver." << endl; return false; } RealType t( this->initialTime ); diff --git a/src/solvers/tnlFastBuildConfigTag.h b/src/solvers/tnlFastBuildConfigTag.h index 23b603cf7a24e19262c6b9b0dba8dc02319b93b0..119c378f315c053867a59e7fa8e26d8e9dac4fc4 100644 --- a/src/solvers/tnlFastBuildConfigTag.h +++ b/src/solvers/tnlFastBuildConfigTag.h @@ -1,5 +1,5 @@ /*************************************************************************** - tnlFastBuildConfig.h - description + tnlFastBuildConfigTag.h - description ------------------- begin : Jul 7, 2014 copyright : (C) 2014 by Tomas Oberhuber @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef TNLFASTBUILDCONFIG_H_ -#define TNLFASTBUILDCONFIG_H_ +#ifndef TNLFASTBUILDCONFIGTAG_H_ +#define TNLFASTBUILDCONFIGTAG_H_ #include <solvers/tnlBuildConfigTags.h> @@ -61,4 +61,4 @@ template<> struct tnlConfigTagTimeDiscretisation< tnlFastBuildConfig, tnlImplici */ template<> struct tnlConfigTagExplicitSolver< tnlFastBuildConfig, tnlExplicitEulerSolverTag >{ enum { enabled = false }; }; -#endif /* TNLDEFAULTCONFIG_H_ */ +#endif /* TNLFASTBUILDCONFIGTAG_H_ */ diff --git a/src/solvers/tnlSolverStarter_impl.h b/src/solvers/tnlSolverStarter_impl.h index 09e61c33e25d96b0d63cbe30891d21b274f7a296..140465d5c7cb4f44e0a62b378e193f22e6d165cf 100644 --- a/src/solvers/tnlSolverStarter_impl.h +++ b/src/solvers/tnlSolverStarter_impl.h @@ -467,7 +467,6 @@ bool tnlSolverStarter< ConfigTag > :: setDiscreteSolver( Problem& problem, typename Problem :: DiscreteSolverPreconditioner > DiscreteSolver; DiscreteSolver solver; double omega = parameters. getParameter< double >( "sor-omega" ); - solver. setName( "sor-solver" ); solver. setOmega( omega ); //solver. setVerbose( this -> verbose ); return setSemiImplicitTimeDiscretisation< Problem >( problem, parameters, solver ); @@ -478,7 +477,6 @@ bool tnlSolverStarter< ConfigTag > :: setDiscreteSolver( Problem& problem, typedef tnlCGSolver< typename Problem :: DiscreteSolverMatrixType, typename Problem :: DiscreteSolverPreconditioner > DiscreteSolver; DiscreteSolver solver; - solver. setName( "cg-solver" ); //solver. setVerbose( this -> verbose ); return setSemiImplicitTimeDiscretisation< Problem >( problem, parameters, solver ); } @@ -488,7 +486,6 @@ bool tnlSolverStarter< ConfigTag > :: setDiscreteSolver( Problem& problem, typedef tnlBICGStabSolver< typename Problem :: DiscreteSolverMatrixType, typename Problem :: DiscreteSolverPreconditioner > DiscreteSolver; DiscreteSolver solver; - solver. setName( "bicg-solver" ); //solver. setVerbose( this -> verbose ); return setSemiImplicitTimeDiscretisation< Problem >( problem, parameters, solver ); } @@ -499,7 +496,6 @@ bool tnlSolverStarter< ConfigTag > :: setDiscreteSolver( Problem& problem, typename Problem :: DiscreteSolverPreconditioner > DiscreteSolver; DiscreteSolver solver; int restarting = parameters. getParameter< int >( "gmres-restarting" ); - solver. setName( "gmres-solver" ); solver. setRestarting( restarting ); //solver. setVerbose( this -> verbose ); return setSemiImplicitTimeDiscretisation< Problem >( problem, parameters, solver ); diff --git a/tests/unit-tests/core/arrays/tnlArrayTester.h b/tests/unit-tests/core/arrays/tnlArrayTester.h index e9dedf9999dd0361d7bef7a64cd867baf1f67dbd..2b8ea2120b006d097f1677d1fd6804908377116b 100644 --- a/tests/unit-tests/core/arrays/tnlArrayTester.h +++ b/tests/unit-tests/core/arrays/tnlArrayTester.h @@ -91,7 +91,7 @@ class tnlArrayTester : public CppUnit :: TestCase void testSetGetElement() { - tnlArray< ElementType, Device, IndexType > u( "tnlArrayTester :: u" ); + tnlArray< ElementType, Device, IndexType > u; u. setSize( 10 ); for( int i = 0; i < 10; i ++ ) u. setElement( i, i ); @@ -120,9 +120,9 @@ class tnlArrayTester : public CppUnit :: TestCase void testComparisonOperator() { - tnlArray< ElementType, Device, IndexType > u( "tnlArrayTester :: u" ); - tnlArray< ElementType, Device, IndexType > v( "tnlArrayTester :: v" ); - tnlArray< ElementType, Device, IndexType > w( "tnlArrayTester :: w" ); + tnlArray< ElementType, Device, IndexType > u; + tnlArray< ElementType, Device, IndexType > v; + tnlArray< ElementType, Device, IndexType > w; u. setSize( 10 ); v. setSize( 10 ); w. setSize( 10 ); @@ -142,8 +142,6 @@ class tnlArrayTester : public CppUnit :: TestCase { tnlArray< ElementType, Device, IndexType > u; tnlArray< ElementType, Device, IndexType > v; - u. setName( "tnlArrayTester :: testAssignmentOperator :: u" ); - v. setName( "tnlArrayTester :: testAssignmentOperator :: v" ); u. setSize( 10 ); v. setSize( 10 ); for( int i = 0; i < 10; i ++ ) @@ -170,7 +168,7 @@ class tnlArrayTester : public CppUnit :: TestCase void testGetSize() { - tnlArray< ElementType, Device, IndexType > u( "tnlArrayTester :: testSetSize - u" ); + tnlArray< ElementType, Device, IndexType > u; const int maxSize = 10; for( int i = 0; i < maxSize; i ++ ) u. setSize( i ); @@ -180,7 +178,7 @@ class tnlArrayTester : public CppUnit :: TestCase void testReset() { - tnlArray< ElementType, Device, IndexType > u( "tnlArrayTester :: testReset - u" ); + tnlArray< ElementType, Device, IndexType > u; u. setSize( 100 ); CPPUNIT_ASSERT( u. getSize() == 100 ); u. reset(); @@ -196,14 +194,14 @@ class tnlArrayTester : public CppUnit :: TestCase { for( int i = 0; i < 100; i ++ ) { - tnlArray< ElementType, Device, IndexType > u( "tnlArrayTester :: testSetSizeAndDestructor - u" ); + tnlArray< ElementType, Device, IndexType > u; u. setSize( i ); } } void testSaveAndLoad() { - tnlArray< ElementType, Device, IndexType > v( "test-array-v" ); + tnlArray< ElementType, Device, IndexType > v; v. setSize( 100 ); for( int i = 0; i < 100; i ++ ) v. setElement( i, 3.14147 ); @@ -211,7 +209,7 @@ class tnlArrayTester : public CppUnit :: TestCase file. open( "test-file.tnl", tnlWriteMode ); v. save( file ); file. close(); - tnlArray< ElementType, Device, IndexType > u( "test-array-u" ); + tnlArray< ElementType, Device, IndexType > u; file. open( "test-file.tnl", tnlReadMode ); u. load( file ); file. close(); @@ -220,7 +218,7 @@ class tnlArrayTester : public CppUnit :: TestCase void testUnusualStructures() { - tnlArray< testingClassForArrayTester >u ( "test-array" ); + tnlArray< testingClassForArrayTester >u; }; }; diff --git a/tests/unit-tests/core/arrays/tnlMultiArrayTester.h b/tests/unit-tests/core/arrays/tnlMultiArrayTester.h index d8df75763ed8341b2f9c6bb7b5288f5d8d47d800..be799d741dd9b96f4ebd7129e3f7df4db8005d64 100644 --- a/tests/unit-tests/core/arrays/tnlMultiArrayTester.h +++ b/tests/unit-tests/core/arrays/tnlMultiArrayTester.h @@ -138,7 +138,7 @@ class tnlMultiArrayTester : public CppUnit :: TestCase void testSetGetElement() { - tnlMultiArray< Dimensions, ElementType, Device, IndexType > u( "tnlMultiArrayTester :: u" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > u; u. setDimensions( 10 ); if( Device::getDevice() == tnlHostDevice ) { @@ -161,9 +161,7 @@ class tnlMultiArrayTester : public CppUnit :: TestCase void testComparisonOperator() { - tnlMultiArray< Dimensions, ElementType, Device, IndexType > u( "tnlMultiArrayTester :: u" ); - tnlMultiArray< Dimensions, ElementType, Device, IndexType > v( "tnlMultiArrayTester :: v" ); - tnlMultiArray< Dimensions, ElementType, Device, IndexType > w( "tnlMultiArrayTester :: w" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > u, v, w; u.setDimensions( 10 ); v.setDimensions( 10 ); w.setDimensions( 10 ); @@ -186,8 +184,6 @@ class tnlMultiArrayTester : public CppUnit :: TestCase { tnlMultiArray< Dimensions, ElementType, Device, IndexType > u; tnlMultiArray< Dimensions, ElementType, Device, IndexType > v; - u. setName( "tnlMultiArrayTester :: testEquivalenceOperator :: u" ); - v. setName( "tnlMultiArrayTester :: testEquivalenceOperator :: v" ); u. setDimensions( 10 ); v. setDimensions( 10 ); for( int i = 0; i < 10; i ++ ) @@ -199,7 +195,7 @@ class tnlMultiArrayTester : public CppUnit :: TestCase void testGetSize() { - tnlMultiArray< Dimensions, ElementType, Device, IndexType > u( "tnlMultiArrayTester :: testSetSize - u" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > u; const int maxSize = 10; for( int i = 1; i < maxSize; i ++ ) u. setDimensions( i ); @@ -209,7 +205,7 @@ class tnlMultiArrayTester : public CppUnit :: TestCase void testReset() { - tnlMultiArray< Dimensions, ElementType, Device, IndexType > u( "tnlMultiArrayTester :: testReset - u" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > u; u.setDimensions( 100 ); CPPUNIT_ASSERT( u. getDimensions().x() == 100 ); u.reset(); @@ -225,14 +221,14 @@ class tnlMultiArrayTester : public CppUnit :: TestCase { for( int i = 1; i < 100; i ++ ) { - tnlMultiArray< Dimensions, ElementType, Device, IndexType > u( "tnlMultiArrayTester :: testSetSizeAndDestructor - u" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > u; u. setDimensions( i ); } } void testSaveAndLoad() { - tnlMultiArray< Dimensions, ElementType, Device, IndexType > v( "test-multi-array-v" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > v; const int size( 10 ); CPPUNIT_ASSERT( v. setDimensions( size ) ); for( int i = 0; i < size; i ++ ) @@ -241,7 +237,7 @@ class tnlMultiArrayTester : public CppUnit :: TestCase file. open( "test-file.tnl", tnlWriteMode ); CPPUNIT_ASSERT( v. save( file ) ); file. close(); - tnlMultiArray< Dimensions, ElementType, Device, IndexType > u( "test-multi-array-u" ); + tnlMultiArray< Dimensions, ElementType, Device, IndexType > u; file. open( "test-file.tnl", tnlReadMode ); CPPUNIT_ASSERT( u. load( file ) ); file. close(); diff --git a/tests/unit-tests/core/arrays/tnlSharedArrayTester.h b/tests/unit-tests/core/arrays/tnlSharedArrayTester.h index 668203944b6fb5d17d04c4a35d7941006ebe06e0..20153f05fc2a3b4361130e90d419189a6235eaea 100644 --- a/tests/unit-tests/core/arrays/tnlSharedArrayTester.h +++ b/tests/unit-tests/core/arrays/tnlSharedArrayTester.h @@ -69,12 +69,7 @@ class tnlSharedArrayTester : public CppUnit :: TestCase void testComparisonOperator() { - tnlSharedArray< ElementType, Device, IndexType > u; - u. setName( "tnlSharedArrayTester :: u" ); - tnlSharedArray< ElementType, Device, IndexType > v; - v. setName( "tnlSharedArrayTester :: v" ); - tnlSharedArray< ElementType, Device, IndexType > w; - w. setName( "tnlSharedArrayTester :: w" ); + tnlSharedArray< ElementType, Device, IndexType > u, v, w; ElementType uData[ 10 ], vData[ 10 ], wData[ 10 ]; u. bind( uData, 10 ); v. bind( vData, 10 ); @@ -93,10 +88,7 @@ class tnlSharedArrayTester : public CppUnit :: TestCase void testAssignmentOperator() { - tnlSharedArray< ElementType, Device, IndexType > u; - tnlSharedArray< ElementType, Device, IndexType > v; - u. setName( "tnlSharedArrayTester :: u" ); - v. setName( "tnlSharedArrayTester :: v" ); + tnlSharedArray< ElementType, Device, IndexType > u, v; ElementType uData[ 10 ], vData[ 10 ]; u. bind( uData, 10 ); v. bind( vData, 10 ); diff --git a/tests/unit-tests/core/vectors/tnlVectorOperationsTester.h b/tests/unit-tests/core/vectors/tnlVectorOperationsTester.h index 2732fe86aadac54698169ec71df48066bb414b19..f452b8b10b875d98b65aa62822a72b05c33f401c 100644 --- a/tests/unit-tests/core/vectors/tnlVectorOperationsTester.h +++ b/tests/unit-tests/core/vectors/tnlVectorOperationsTester.h @@ -375,7 +375,6 @@ class tnlVectorOperationsTester : public CppUnit :: TestCase const int size( 10000 ); tnlVector< Real, Device > v; v.setSize( size ); - v.setName( "prefixSumTest::v" ); setOnesSequence( v ); v.computePrefixSum(); @@ -399,7 +398,6 @@ class tnlVectorOperationsTester : public CppUnit :: TestCase const int size( 10000 ); tnlVector< Real, Device > v; v.setSize( size ); - v.setName( "exclusivePrefixSumTest::v" ); setOnesSequence( v ); v.computeExclusivePrefixSum(); diff --git a/tests/unit-tests/matrices/tnlDenseMatrixTester.h b/tests/unit-tests/matrices/tnlDenseMatrixTester.h index e14257a4cbbd8de7846f33f19e6d7e87ffddc7d0..a4ea8c6cc6e4cf271284c8144a9ea133483c7240 100644 --- a/tests/unit-tests/matrices/tnlDenseMatrixTester.h +++ b/tests/unit-tests/matrices/tnlDenseMatrixTester.h @@ -176,7 +176,6 @@ class tnlDenseMatrixTester : public CppUnit :: TestCase m.setElement( i, i, i ); tnlVector< IndexType, tnlHost, IndexType > columns; - columns.setName( "tnlDenseMatrixTester:columns" ); tnlVector< RealType, tnlHost, IndexType > values; columns.setSize( 10 ); values.setSize( 10 ); @@ -209,7 +208,6 @@ class tnlDenseMatrixTester : public CppUnit :: TestCase m.setElement( i, i, i ); tnlVector< IndexType, Device, IndexType > columns; - columns.setName( "tnlDenseMatrixTester:columns" ); tnlVector< RealType, Device, IndexType > values; columns.setSize( 10 ); values.setSize( 10 ); diff --git a/tests/unit-tests/matrices/tnlRgCSRMatrixTester.h b/tests/unit-tests/matrices/tnlRgCSRMatrixTester.h index 4978d8e7c16ab8e1cc4caac36c9239fe94ef09d6..6b24cbb1b2a04e7837a4a28f0ea18963dcdff30d 100644 --- a/tests/unit-tests/matrices/tnlRgCSRMatrixTester.h +++ b/tests/unit-tests/matrices/tnlRgCSRMatrixTester.h @@ -94,8 +94,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 12; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:Empty" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:Empty" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setEmptyMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); @@ -111,8 +110,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 12; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:Diagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:Diagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setDiagonalMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); @@ -127,8 +125,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, void ifTriDiagonalMatrixIsStoredProperly() { tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:Tridiagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:Tridiagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; int size = 12; this -> setTridiagonalMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); @@ -145,8 +142,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, void ifUpperTriangularMatrixIsStoredProperly() { tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:upperTriangular" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:upperTriangular" ); + tnlRgCSRMatrix< T > argcsrMatrix; const int size = 12; this -> setUpperTriangularMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); @@ -163,8 +159,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, void ifFullMatrixIsStoredProperly() { tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:upperTriangular" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:upperTriangular" ); + tnlRgCSRMatrix< T > argcsrMatrix; const int size = 12; this -> setUpperTriangularMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); @@ -181,8 +176,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, void ifBcsstk20MatrixIsStoredProperly() { tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:upperTriangular" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:upperTriangular" ); + tnlRgCSRMatrix< T > argcsrMatrix; const int size = 12; this -> setBcsstk20Matrix( csrMatrix ); argcsrMatrix. copyFrom( csrMatrix ); @@ -200,12 +194,11 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 35; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:Diagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:Diagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setEmptyMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); - tnlVector< T > x( "x" ), b1( "b1" ), b2( "b2" ); + tnlVector< T > x, b1, b2; x. setSize( size ); b1. setSize( size ); b2. setSize( size ); @@ -220,12 +213,11 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 35; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:Diagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:Diagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setDiagonalMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); - tnlVector< T > x( "x" ), b1( "b1" ), b2( "b2" ); + tnlVector< T > x, b1, b2; x. setSize( size ); b1. setSize( size ); b2. setSize( size ); @@ -240,12 +232,11 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 12; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:TriDiagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:TriDiagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setTridiagonalMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); - tnlVector< T > x( "x" ), b1( "b1" ), b2( "b2" ); + tnlVector< T > x, b1, b2; x. setSize( size ); b1. setSize( size ); b2. setSize( size ); @@ -260,12 +251,11 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 12; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:TriDiagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:TriDiagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setUpperTriangularMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); - tnlVector< T > x( "x" ), b1( "b1" ), b2( "b2" ); + tnlVector< T > x, b1, b2; x. setSize( size ); b1. setSize( size ); b2. setSize( size ); @@ -280,12 +270,11 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, { const int size = 12; tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:TriDiagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:TriDiagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setFullMatrix( csrMatrix, size ); argcsrMatrix. copyFrom( csrMatrix ); - tnlVector< T > x( "x" ), b1( "b1" ), b2( "b2" ); + tnlVector< T > x, b1, b2; x. setSize( size ); b1. setSize( size ); b2. setSize( size ); @@ -299,8 +288,7 @@ template< class T > class tnlRgCSRMatrixTester : public CppUnit :: TestCase, void ifSpmvWithBcsstk20MatrixWorks() { tnlCSRMatrix< T > csrMatrix; - csrMatrix.setName( "test-matrix:TriDiagonal" ); - tnlRgCSRMatrix< T > argcsrMatrix( "test-matrix:TriDiagonal" ); + tnlRgCSRMatrix< T > argcsrMatrix; this -> setBcsstk20Matrix( csrMatrix ); argcsrMatrix. copyFrom( csrMatrix ); const int size = csrMatrix. getRows(); diff --git a/tests/unit-tests/mesh/tnlMeshTester.h b/tests/unit-tests/mesh/tnlMeshTester.h index efc5858d7fcfa1a4c8dfd9e458ad4b33021e29f8..64df322ec60515140d684ed6f866a9bae684d6e6 100644 --- a/tests/unit-tests/mesh/tnlMeshTester.h +++ b/tests/unit-tests/mesh/tnlMeshTester.h @@ -156,7 +156,6 @@ class tnlMeshTester : public CppUnit :: TestCase */ tnlMesh< TestTriangleMeshConfig > mesh, mesh2; - mesh.setName( "mesh" ); mesh.setNumberOfVertices( 4 ); mesh.setVertex( 0, PointType( 0.0, 0.0 ) ); mesh.setVertex( 1, PointType( 1.0, 0.0 ) ); @@ -182,7 +181,6 @@ class tnlMeshTester : public CppUnit :: TestCase CPPUNIT_ASSERT( mesh2.load( "mesh.tnl" ) ); CPPUNIT_ASSERT( mesh == mesh2 ); - //mesh2.setName( "mesh2" ); //mesh.print( cout ); //mesh2.print( cout ); diff --git a/tools/src/tnl-grid-setup.h b/tools/src/tnl-grid-setup.h index fdbc5d784068db8cbe12e2801e859fb85df3d95a..bd4521d2bea09ca094406d5adb4b6b1472658a09 100644 --- a/tools/src/tnl-grid-setup.h +++ b/tools/src/tnl-grid-setup.h @@ -41,7 +41,6 @@ bool setupGrid( const tnlParameterContainer& parameters ) typedef typename GridType::VertexType VertexType; typedef typename GridType::CoordinatesType CoordinatesType; GridType grid; - grid.setName( gridName ); grid.setDomain( VertexType( originX ), VertexType( proportionsX ) ); grid.setDimensions( CoordinatesType( sizeX ) ); if( ! grid.save( outputFile ) ) @@ -65,7 +64,6 @@ bool setupGrid( const tnlParameterContainer& parameters ) typedef typename GridType::VertexType VertexType; typedef typename GridType::CoordinatesType CoordinatesType; GridType grid; - grid.setName( gridName ); grid.setDomain( VertexType( originX, originY ), VertexType( proportionsX, proportionsY ) ); grid.setDimensions( CoordinatesType( sizeX, sizeY ) ); if( ! grid.save( outputFile ) ) @@ -92,7 +90,6 @@ bool setupGrid( const tnlParameterContainer& parameters ) typedef typename GridType::VertexType VertexType; typedef typename GridType::CoordinatesType CoordinatesType; GridType grid; - grid.setName( gridName ); grid.setDomain( VertexType( originX, originY, originZ ), VertexType( proportionsX, proportionsY, proportionsZ ) ); grid.setDimensions( CoordinatesType( sizeX, sizeY, sizeZ ) ); if( ! grid.save( outputFile ) ) diff --git a/tools/tnl-quickstart/tnl-quickstart.py b/tools/tnl-quickstart/tnl-quickstart.py index bed01df046ada91ed847b1d4294493f448da9c91..75683a95b07f05a089dd9bd45be7974749c2e681 100644 --- a/tools/tnl-quickstart/tnl-quickstart.py +++ b/tools/tnl-quickstart/tnl-quickstart.py @@ -57,8 +57,7 @@ def generateMain( problemName, problemBaseName, operatorName ): file = open( problemBaseName + ".h", "w" ) file.write( "#include <tnlConfig.h>\n" ) file.write( "#include <solvers/tnlSolver.h>\n" ) - file.write( "#include <solvers/tnlConfigTags.h>\n" ) - file.write( "#include <solvers/tnlFastBuildConfig.h>\n" ) + file.write( "#include <solvers/tnlBuildConfigTags.h>\n" ) file.write( "#include <operators/tnlAnalyticDirichletBoundaryConditions.h>\n" ) file.write( "#include <operators/tnlDirichletBoundaryConditions.h>\n" ) file.write( "#include <operators/tnlAnalyticNeumannBoundaryConditions.h>\n" ) @@ -66,9 +65,10 @@ def generateMain( problemName, problemBaseName, operatorName ): file.write( "#include <functors/tnlConstantFunction.h>\n" ) file.write( "#include \"" + problemBaseName + "Problem.h\"\n" ) file.write( "#include \"" + operatorName + ".h\"\n" ) - file.write( "#include \"" + problemBaseName + "Rhs.h\"\n" ) + file.write( "#include \"" + problemBaseName + "Rhs.h\"\n" ) + file.write( "#include \"" + problemBaseName + "BuildConfigTag.h\"\n" ) file.write( "\n" ) - file.write( "typedef tnlFastBuildConfig BuildConfig;\n" ) + file.write( "typedef " + problemBaseName + "BuildConfigTag BuildConfig;\n" ) file.write( "\n" ) file.write( "/****\n" ) file.write( " * Uncoment the following (and comment the previous line) for the complete build.\n" ) @@ -375,17 +375,17 @@ def generateProblem( problemName, problemBaseName ): file.write( " Matrix& matrix )\n" ) file.write( "{\n" ) file.write( " const IndexType dofs = this->getDofs( mesh );\n" ) - file.write( " typedef typename Matrix::RowLengthsVector RowLengthsVectorType;\n" ) - file.write( " RowLengthsVectorType rowLengths;\n" ) + file.write( " typedef typename Matrix::CompressedRowsLengthsVector CompressedRowsLengthsVectorType;\n" ) + file.write( " CompressedRowsLengthsVectorType rowLengths;\n" ) file.write( " if( ! rowLengths.setSize( dofs ) )\n" ) file.write( " return false;\n" ) - file.write( " tnlMatrixSetter< MeshType, DifferentialOperator, BoundaryCondition, RowLengthsVectorType > matrixSetter;\n" ) - file.write( " matrixSetter.template getRowLengths< Mesh::Dimensions >( mesh,\n" ) - file.write( " differentialOperator,\n" ) - file.write( " boundaryCondition,\n" ) - file.write( " rowLengths );\n" ) + file.write( " tnlMatrixSetter< MeshType, DifferentialOperator, BoundaryCondition, CompressedRowsLengthsVectorType > matrixSetter;\n" ) + file.write( " matrixSetter.template getCompressedRowsLengths< Mesh::Dimensions >( mesh,\n" ) + file.write( " differentialOperator,\n" ) + file.write( " boundaryCondition,\n" ) + file.write( " rowLengths );\n" ) file.write( " matrix.setDimensions( dofs, dofs );\n" ) - file.write( " if( ! matrix.setRowLengths( rowLengths ) )\n" ) + file.write( " if( ! matrix.setCompressedRowsLengths( rowLengths ) )\n" ) file.write( " return false;\n" ) file.write( " return true;\n" ) file.write( "}\n" ) @@ -731,6 +731,54 @@ def generateRhs( problemBaseName ): file.write( "#endif /* " + problemBaseName + "RHS_H_ */\n" ) file.close() +def generateBuildConfigTags( problemBaseName ): + file = open( problemBaseName + "BuildConfigTag.h", "w" ) + file.write( "#ifndef " + problemBaseName + "BUILDCONFIGTAG_H_\n" ) + file.write( "#define " + problemBaseName + "BUILDCONFIGTAG_H_\n" ) + file.write( "\n" ) + file.write( "#include <solvers/tnlBuildConfigTags.h>\n" ) + file.write( "\n" ) + file.write( "class " + problemBaseName + "BuildConfigTag{};\n" ) + file.write( "\n" ) + file.write( "/****\n" ) + file.write( " * Turn off support for float and long double.\n" ) + file.write( " */\n" ) + file.write( "template<> struct tnlConfigTagReal< " + problemBaseName + "BuildConfigTag, float > { enum { enabled = false }; };\n" ) + file.write( "template<> struct tnlConfigTagReal< " + problemBaseName + "BuildConfigTag, long double > { enum { enabled = false }; };\n" ) + file.write( "\n" ) + file.write( "/****\n" ) + file.write( " * Turn off support for short int and long int indexing.\n" ) + file.write( " */\n" ) + file.write( "template<> struct tnlConfigTagIndex< " + problemBaseName + "BuildConfigTag, short int >{ enum { enabled = false }; };\n" ) + file.write( "template<> struct tnlConfigTagIndex< " + problemBaseName + "BuildConfigTag, long int >{ enum { enabled = false }; };\n" ) + file.write( "\n" ) + file.write( "/****\n" ) + file.write( " * Use of tnlGrid is enabled for allowed dimensions and Real, Device and Index types.\n" ) + file.write( " */\n" ) + file.write( "\n" ) + file.write( "template< int Dimensions, typename Real, typename Device, typename Index >\n" ) + file.write( " struct tnlConfigTagMesh< " + problemBaseName + "BuildConfigTag, tnlGrid< Dimensions, Real, Device, Index > >\n" ) + file.write( " { enum { enabled = tnlConfigTagDimensions< " + problemBaseName + "BuildConfigTag, Dimensions >::enabled &&\n" ) + file.write( " tnlConfigTagReal< " + problemBaseName + "BuildConfigTag, Real >::enabled &&\n" ) + file.write( " tnlConfigTagDevice< " + problemBaseName + "BuildConfigTag, Device >::enabled &&\n" ) + file.write( " tnlConfigTagIndex< " + problemBaseName + "BuildConfigTag, Index >::enabled }; };\n" ) + file.write( "\n" ) + file.write( "/****\n" ) + file.write( " * Please, chose your preferred time discretisation here.\n" ) + file.write( " */\n" ) + file.write( "template<> struct tnlConfigTagTimeDiscretisation< " + problemBaseName + "BuildConfigTag, tnlExplicitTimeDiscretisationTag >{ enum { enabled = true }; };\n" ) + file.write( "template<> struct tnlConfigTagTimeDiscretisation< " + problemBaseName + "BuildConfigTag, tnlSemiImplicitTimeDiscretisationTag >{ enum { enabled = true }; };\n" ) + file.write( "template<> struct tnlConfigTagTimeDiscretisation< " + problemBaseName + "BuildConfigTag, tnlImplicitTimeDiscretisationTag >{ enum { enabled = false }; };\n" ) + file.write( "\n" ) + file.write( "/****\n" ) + file.write( " * Only the Runge-Kutta-Merson solver is enabled by default.\n" ) + file.write( " */\n" ) + file.write( "template<> struct tnlConfigTagExplicitSolver< " + problemBaseName + "BuildConfigTag, tnlExplicitEulerSolverTag >{ enum { enabled = false }; };\n" ) + file.write( "\n" ) + file.write( "#endif /* " + problemBaseName + "BUILDCONFIGTAG_H_ */\n" ) + file.close() + + def generateRunScript( problemBaseName ): file = open( "run-" + problemBaseName, "w" ) file.write( "#!/usr/bin/env bash\n" ) @@ -764,4 +812,5 @@ generateMain( problemName, problemBaseName, operatorName ) generateProblem( problemName, problemBaseName ) generateOperator( operatorName ) generateRhs( problemBaseName ) +generateBuildConfigTags( problemBaseName ) generateRunScript( problemBaseName ) \ No newline at end of file