...
 
Commits (2)
......@@ -137,7 +137,7 @@ namespace Dune
public:
//! dot product for ISTL solvers
virtual field_type dot (const BlockVectorType& x,
virtual real_type dot (const BlockVectorType& x,
const BlockVectorType& y) const
{
return dotProduct( x, y );
......
......@@ -86,8 +86,16 @@ namespace Dune
public:
inline ~FlOpCounter ()
{
reset();
}
unsigned long reset()
{
FlOpSummary< FloatImp > :: instance( FloatImp::typeName() ).add( count_, thread_ );
unsigned long count = count_;
count_ = 0;
return count;
}
inline ThisType &operator++ ()
......@@ -130,6 +138,8 @@ namespace Dune
}
public:
unsigned long reset () { return 0; }
inline ThisType &operator++ ()
{
return *this;
......@@ -370,6 +380,11 @@ namespace Dune
return "Double";
}
static unsigned long reset()
{
return FlOpCounterType :: instance().reset();
}
protected:
static inline void flOp ()
{
......
......@@ -159,9 +159,10 @@ namespace Dune
: v_(other.v_), scalar_(other.scalar_), scaleIt_(other.scaleIt_) { }
term(const MappingType &mapping, RangeFieldType scalar ) : v_(&mapping), scalar_(scalar), scaleIt_( true ) {
if ( scalar_ == 1. ) {
//if ( std::abs( scalar_ == 1. ) {
scaleIt_ = false;
}
std::abort();
//}
}
void apply(const DomainType &arg, RangeType &dest) const
......@@ -179,6 +180,8 @@ namespace Dune
RangeType tmp( dest );
v_->apply( arg, tmp );
std::abort();
/*
if ( scalar_ == 1. )
{
dest += tmp;
......@@ -192,6 +195,7 @@ namespace Dune
tmp *= scalar_;
dest += tmp;
}
*/
}
protected:
......
......@@ -16,6 +16,12 @@
#include <dune/common/exceptions.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/simd/simd.hh>
#if HAVE_DUNE_VECTORCLASS
#include <dune/vectorclass/vectorclass.hh>
#endif
//- Dune istl includes
#include <dune/istl/bvector.hh>
#include <dune/istl/bcrsmatrix.hh>
......@@ -655,7 +661,23 @@ namespace Dune
enum { littleCols = DomainSpaceType :: localBlockSize };
enum { littleRows = RangeSpaceType :: localBlockSize };
typedef FieldMatrix<typename DomainSpaceType :: RangeFieldType, littleRows, littleCols> LittleBlockType;
template <int d, class Scalar>
struct ExtractScalar
{
typedef Scalar Type;
};
#if HAVE_DUNE_VECTORCLASS
/*
template <int d>
struct ExtractScalar<d, Vec4d >
{
typedef double Type;
};
*/
#endif
typedef FieldMatrix< typename ExtractScalar<0, typename DomainSpaceType :: RangeFieldType> :: Type,
littleRows, littleCols> LittleBlockType;
typedef LittleBlockType block_type;
typedef LittleBlockType MatrixBlockType;
......
......@@ -60,6 +60,10 @@
#include <dune/fem/solver/spqrsolver.hh>
#endif // HAVE_SUITESPARSE_SPQR
#if HAVE_DUNE_VECTORCLASS
#include <dune/vectorclass/vectorclass.hh>
#endif
#include <dune/fem/solver/amgxsolver.hh>
// local includes
......@@ -104,6 +108,7 @@ struct Algorithm
using LinearOperatorType = LinearOperator;
using DiscreteFunctionType = typename InverseOperatorType::DomainFunctionType;
using DiscreteFunctionSpaceType = typename DiscreteFunctionType::DiscreteFunctionSpaceType;
using MassOperatorType = MassOperator< DiscreteFunctionType, LinearOperatorType >;
using AffineMassOperatorType = AffineMassOperator< DiscreteFunctionType, LinearOperatorType >;
......@@ -117,7 +122,7 @@ struct Algorithm
const double eps = 5e-6;
GridPartType gridPart( grid );
DiscreteSpaceType space( gridPart );
DiscreteFunctionSpaceType space( gridPart );
DiscreteFunctionType u( "u", space );
DiscreteFunctionType rhs( "rhs", space );
......@@ -381,6 +386,21 @@ int main(int argc, char** argv)
pass &= Algorithm< InverseOperator, LinearOperator >::apply( grid, designation, verboseSolver );
}
#if HAVE_DUNE_VECTORCLASS
// ISTLInverseOperator< ISTLRestartedGMRes > + SparseRowLinearOperator
{
using SpaceType = Dune::Fem::FunctionSpace< FieldType, Vec4d, dim, 1 >;
using DiscreteSpaceType = Dune::Fem::LagrangeDiscreteFunctionSpace< SpaceType, GridPartType, polOrder >;
using DiscreteFunction = Dune::Fem::ISTLBlockVectorDiscreteFunction< DiscreteSpaceType>;
using LinearOperator = Dune::Fem::ISTLLinearOperator< DiscreteFunction, DiscreteFunction >;
using InverseOperator = Dune::Fem::ISTLInverseOperator< DiscreteFunction, Dune::Fem::ISTLRestartedGMRes >;
std::string designation(" === ISTLInverseOperator< ISTLRestartedGMRes > + SparseRowLinearOperator === ");
pass &= Algorithm< InverseOperator, LinearOperator >::apply( grid, designation, verboseSolver );
}
#endif
#if 0 // the inverse linear operator ignores all verbosity setting
// ISTL::InverseOperator< LinearOperator > + ISTLLinearOperator
{
......
......@@ -3,7 +3,7 @@ DGF
Interval
0 0 % p0
1 1 % p1
128 128 % nx ny
256 256 % nx ny
#
BoundaryDomain
......
......@@ -3,7 +3,7 @@ DGF
Interval
0 0 0 % p0
1 1 1 % p1
32 32 32 % nx ny nz
48 48 48 % nx ny nz
#
BoundaryDomain
......
if( NOT GRIDTYPE )
set( GRIDTYPE ALUGRID_CUBE )
set( GRIDTYPE SPGRID )
endif()
if( NOT GRIDDIM )
set( GRIDDIM 2 )
set( GRIDDIM 3 )
endif()
# copy data to build source to make tests work
......@@ -15,7 +15,7 @@ configure_file(3dgrid_8.dgf ${CMAKE_CURRENT_BINARY_DIR}/3dgrid_8.dgf COPYONLY)
configure_file(parameter ${CMAKE_CURRENT_BINARY_DIR}/parameter COPYONLY)
# the default compiler flags
set( DEFAULTFLAGS "GRIDDIM=${GRIDDIM};${GRIDTYPE};DIMRANGE=3;POLORDER=2;WANT_GRAPE=0" )
set( DEFAULTFLAGS "MAX_VECTOR_SIZE=512;GRIDDIM=${GRIDDIM};${GRIDTYPE};DIMRANGE=3;POLORDER=2;WANT_GRAPE=0" )
set( TESTS
adapt
......@@ -53,6 +53,11 @@ COMPILE_DEFINITIONS "${DEFAULTFLAGS};USE_BASEFUNCTIONSET_CODEGEN"
LINK_LIBRARIES dunefem )
target_include_directories(l2projection_optim PRIVATE "./" "${CMAKE_CURRENT_BINARY_DIR}")
# dgcomm tests should run on GRIDDIM=3 meshes
dune_add_test( NAME l2projection_flops SOURCES l2projection.cc
COMPILE_DEFINITIONS "${DEFAULTFLAGS};COUNT_FLOPS"
LINK_LIBRARIES dunefem )
# dgcomm tests should run on GRIDDIM=3 meshes
dune_add_test( NAME dgcomm SOURCES dgcomm.cc
COMPILE_DEFINITIONS "GRIDDIM=3;WORLDDIM=3;${GRIDTYPE};DIMRANGE=3;POLORDER=2;WANT_GRAPE=0;WANT_CACHED_COMM_MANAGER=0"
......
This diff is collapsed.