Skip to content
Snippets Groups Projects
Commit 9d10a9b0 authored by Felix Schindler's avatar Felix Schindler
Browse files

Revert "began use of pdelab and localfucntions, 2.1 snapshot"

This reverts commit 0ca8f68f997b66c11c5b1647f86e2bfdc172ebec.

git-svn-id: https://dune.mathematik.uni-freiburg.de/svn/dune-fem-functionals/trunk@205 4028485c-44d9-4cde-a312-5a4635ee2db9
parent e05a96c9
No related branches found
No related tags found
No related merge requests found
...@@ -101,7 +101,7 @@ ADD_CXX_FLAGS( -I${ALUGRID_BASE_PATH}/include ...@@ -101,7 +101,7 @@ ADD_CXX_FLAGS( -I${ALUGRID_BASE_PATH}/include
# #
# ENDIF ( ENABLE_PARALELL ) # ENDIF ( ENABLE_PARALELL )
ADD_DUNE_MODULES( common istl grid localfunctions pdelab fem fem-tools) ADD_DUNE_MODULES( common istl grid fem fem-tools)
LINK_DIRECTORIES( "/usr/lib" "${ALUGRID_BASE_PATH}/lib" ) LINK_DIRECTORIES( "/usr/lib" "${ALUGRID_BASE_PATH}/lib" )
ADD_CXX_FLAGS( ${CUSTOM_FLAGS} ) ADD_CXX_FLAGS( ${CUSTOM_FLAGS} )
...@@ -112,22 +112,19 @@ ADD_CXX_FLAGS( ${CUSTOM_FLAGS} ) ...@@ -112,22 +112,19 @@ ADD_CXX_FLAGS( ${CUSTOM_FLAGS} )
FILE( GLOB_RECURSE common "../dune-common/dune/common/*.hh" ) FILE( GLOB_RECURSE common "../dune-common/dune/common/*.hh" )
FILE( GLOB_RECURSE grid "../dune-grid/dune/grid/*.hh" ) FILE( GLOB_RECURSE grid "../dune-grid/dune/grid/*.hh" )
FILE( GLOB_RECURSE istl "../dune-istl/dune/istl/*.hh" ) FILE( GLOB_RECURSE istl "../dune-istl/dune/istl/*.hh" )
FILE( GLOB_RECURSE pdelab "../dune-pdelab/dune/pdelab/*.hh" )
FILE( GLOB_RECURSE localfunctions "../dune-localfunctions/dune/localfunctions/*.hh" )
FILE( GLOB_RECURSE pdelabhowto "../dune-pdelab-howto/src/*.hh" )
FILE( GLOB_RECURSE femhowto "../dune-fem-howto/dune/fem-howto/*.hh" ) FILE( GLOB_RECURSE femhowto "../dune-fem-howto/dune/fem-howto/*.hh" )
FILE( GLOB_RECURSE fem "../dune-fem/dune/fem/*.hh" ) FILE( GLOB_RECURSE fem "../dune-fem/dune/fem/*.hh" )
FILE( GLOB_RECURSE femtools "../dune-fem-tools/dune/fem-tools/*.hh" ) FILE( GLOB_RECURSE femtools "../dune-fem-tools/dune/fem-tools/*.hh" )
FILE( GLOB_RECURSE functionals "../dune-fem-functionals/dune/functionals/*.hh" ) FILE( GLOB_RECURSE functionals "../dune-fem-functionals/dune/functionals/*.hh" )
set_source_files_properties( ${common} ${grid} ${istl} ${localfunctions} ${pdelab} ${pdelabhowto} ${fem} ${femhowto} ${femtools} ${functionals} PROPERTIES HEADER_FILE_ONLY 1 ) set_source_files_properties( ${common} ${grid} ${istl} ${fem} ${femhowto} ${femtools} ${functionals} PROPERTIES HEADER_FILE_ONLY 1 )
set( COMMON_LIBS "fem" "grid" "common" ${BLAS_LIB} "alugrid" "GL" ) set( COMMON_LIBS "fem" "grid" "common" ${BLAS_LIB} "alugrid" "GL" )
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory tests) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory tests)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory examples) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory examples)
execute_process(COMMAND ln -s ${CMAKE_CURRENT_SOURCE_DIR}/examples/macrogrids .) execute_process(COMMAND ln -s ${CMAKE_CURRENT_SOURCE_DIR}/examples/macrogrids .)
ADD_EXECUTABLE( examples/elliptic_finite_element_example "examples/elliptic_finite_element/main.cc" ${common} ${grid} ${localfunctions} ${pdelab} ${pdelabhowto} ${istl} ${fem} ${femhowto} ${femtools} ${functionals} ) ADD_EXECUTABLE( examples/elliptic_finite_element_example "examples/elliptic_finite_element/main.cc" ${common} ${grid} ${istl} ${fem} ${femhowto} ${femtools} ${functionals} )
TARGET_LINK_LIBRARIES( examples/elliptic_finite_element_example ${COMMON_LIBS} ) TARGET_LINK_LIBRARIES( examples/elliptic_finite_element_example ${COMMON_LIBS} )
......
Module: dune-fem-functionals Module: dune-fem-functionals
Version: 0.1 Version: 0.1
Maintainer: felix.albrecht@uni-muenster.de Maintainer: felix.albrecht@uni-muenster.de
Depends: dune-common dune-grid dune-fem dune-istl dune-fem-tools dune-pdelab Depends: dune-common dune-grid dune-fem dune-istl dune-fem-tools
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
// dune-fem includes // dune-fem includes
#include <dune/fem/space/lagrangespace.hh> #include <dune/fem/space/lagrangespace.hh>
// dune-pdelab includes
#include <dune/pdelab/finiteelementmap/p1fem.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
// dune-functionals includes // dune-functionals includes
#include <dune/functionals/common/localbasefunctionset.hh> #include <dune/functionals/common/localbasefunctionset.hh>
...@@ -19,133 +15,121 @@ namespace DiscreteFunctionSpace { ...@@ -19,133 +15,121 @@ namespace DiscreteFunctionSpace {
namespace Continuous { namespace Continuous {
template <class FunctionSpaceImp, class GridViewImp, int polOrder> template <class FunctionSpaceImp, class GridPartImp, int polOrder>
class Lagrange class Lagrange
{ {
public: public:
typedef FunctionSpaceImp FunctionSpaceType; typedef FunctionSpaceImp FunctionSpaceType;
typedef GridViewImp GridViewType; typedef GridPartImp GridPartType;
typedef Lagrange<FunctionSpaceType, GridViewType, polOrder> ThisType; typedef Lagrange<FunctionSpaceType, GridPartType, polOrder> ThisType;
typedef typename FunctionSpaceType::DomainType DomainType; typedef Dune::LagrangeDiscreteFunctionSpace<FunctionSpaceType, GridPartType, polOrder> HostSpaceType;
typedef typename FunctionSpaceType::DomainFieldType DomainFieldType; typedef Dune::Functionals::Common::LocalBaseFunctionSet<ThisType> LocalBaseFunctionSetType;
typedef typename FunctionSpaceType::RangeFieldType RangeFieldType; typedef typename HostSpaceType::EntityType EntityType;
typedef typename FunctionSpaceType::RangeType RangeType; typedef typename HostSpaceType::DomainType DomainType;
typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType; typedef typename HostSpaceType::DomainFieldType DomainFieldType;
typedef typename FunctionSpaceType::HessianRangeType HessianRangeType; typedef typename HostSpaceType::RangeFieldType RangeFieldType;
static const unsigned int dimDomain = FunctionSpaceType::dimDomain; typedef typename HostSpaceType::RangeType RangeType;
static const unsigned int dimRange = FunctionSpaceType::dimRange; typedef typename HostSpaceType::JacobianRangeType JacobianRangeType;
private: typedef typename HostSpaceType::HessianRangeType HessianRangeType;
typedef Dune::PDELab::P1LocalFiniteElementMap<DomainFieldType, RangeFieldType, dimDomain> LocalFiniteElementMapType;
public: /**
// typedef Dune::LagrangeDiscreteFunctionSpace< FunctionSpaceType, GridPartType, polOrder > \defgroup dune-fem related
// HostSpaceType; \{
**/
typedef typename HostSpaceType::BaseFunctionSetType BaseFunctionSetType;
typedef Dune::PDELab::GridFunctionSpace<GridViewType, LocalFiniteElementMapType> HostSpaceType; typedef typename HostSpaceType::IteratorType IteratorType;
/**
\}
**/
typedef Dune::Functionals::Common::LocalBaseFunctionSet<ThisType> LocalBaseFunctionSetType; static const unsigned int dimDomain = FunctionSpaceType::dimDomain;
typedef typename GridViewType::template Codim<0>::Entity EntityType; static const unsigned int dimRange = FunctionSpaceType::dimRange;
// /** Lagrange(GridPartType& gridPart)
// \defgroup dune-fem related : gridPart_(gridPart)
// \{ , hostSpace_(gridPart)
// **/ , numMaxLocalDoFs_(-1)
// typedef typename HostSpaceType::BaseFunctionSetType {
// BaseFunctionSetType; // in the simple case, there should be the same number of dofs on each entity
const IteratorType entityIterator = begin();
const EntityType& entity = *entityIterator;
numMaxLocalDoFs_ = hostSpace_.baseFunctionSet(entity).numBaseFunctions();
}
// typedef typename HostSpaceType::IteratorType const GridPartType& gridPart() const
// IteratorType; {
// /** return gridPart_;
// \} }
// **/
const HostSpaceType& hostSpace() const
{
return hostSpace_;
}
Lagrange(GridViewType& gridView) const LocalBaseFunctionSetType localBaseFunctionSet(const EntityType& entity) const
: gridView_(gridView)
, localFiniteElementMap_()
, hostSpace_(gridView_, localFiniteElementMap_) /*,
numMaxLocalDoFs_( -1 )*/
{ {
// // in the simple case, there should be the same number of dofs on each entity return LocalBaseFunctionSetType(*this, entity);
// const IteratorType entityIterator = begin();
// const EntityType& entity = *entityIterator;
// numMaxLocalDoFs_ = hostSpace_.baseFunctionSet( entity ).numBaseFunctions();
} }
// const GridPartType& gridPart() const const unsigned int size() const
// { {
// return gridPart_; return hostSpace_.size();
// } }
// const HostSpaceType& hostSpace() const const int numMaxLocalDoFs() const
// { {
// return hostSpace_; return numMaxLocalDoFs_;
// } }
// const LocalBaseFunctionSetType localBaseFunctionSet( const EntityType& entity ) const const int order() const
// { {
// return LocalBaseFunctionSetType( *this, entity ); return hostSpace_.order();
// } }
const unsigned int size() const /**
\defgroup dune-fem related
\{
**/
IteratorType begin() const
{ {
return hostSpace_.size(); return hostSpace_.begin();
} }
// const int numMaxLocalDoFs() const const IteratorType end() const
// { {
// return numMaxLocalDoFs_; return hostSpace_.end();
// } }
// const int order() const const BaseFunctionSetType baseFunctionSet(const EntityType& entity) const
// { {
// return hostSpace_.order(); return hostSpace_.baseFunctionSet(entity);
// } }
// /** int mapToGlobal(const EntityType& entity, const int localDof) const
// \defgroup dune-fem related {
// \{ return hostSpace_.mapToGlobal(entity, localDof);
// **/ }
// IteratorType begin() const /**
// { \}
// return hostSpace_.begin(); **/
// }
// const IteratorType end() const
// {
// return hostSpace_.end();
// }
// const BaseFunctionSetType baseFunctionSet( const EntityType& entity ) const
// {
// return hostSpace_.baseFunctionSet( entity );
// }
// int mapToGlobal( const EntityType& entity, const int localDof) const
// {
// return hostSpace_.mapToGlobal( entity, localDof);
// }
// /**
// \}
// **/
private: private:
const GridViewType& gridView_; const GridPartType& gridPart_;
const LocalFiniteElementMapType localFiniteElementMap_;
const HostSpaceType hostSpace_; const HostSpaceType hostSpace_;
// unsigned int numMaxLocalDoFs_; unsigned int numMaxLocalDoFs_;
}; // end class Lagrange }; // end class Lagrange
......
GRIDDIM=2 GRIDDIM=1
GRIDTYPE=YASPGRID GRIDTYPE=YASPGRID
POLORDER=1 POLORDER=1
......
...@@ -239,18 +239,13 @@ int main(int argc, char** argv) ...@@ -239,18 +239,13 @@ int main(int argc, char** argv)
typedef Dune::GridSelector::GridType GridType; typedef Dune::GridSelector::GridType GridType;
// typedef Dune::AdaptiveLeafGridPart< GridType > typedef Dune::AdaptiveLeafGridPart<GridType> GridPartType;
// GridPartType;
typedef typename GridType::LeafGridView GridViewType;
const std::string dgfFilename = "../macrogrids/unitcube" + Dune::FemTools::String::toString(GRIDDIM) + ".dgf"; const std::string dgfFilename = "../macrogrids/unitcube" + Dune::FemTools::String::toString(GRIDDIM) + ".dgf";
Dune::GridPtr<GridType> gridPtr(dgfFilename); Dune::GridPtr<GridType> gridPtr(dgfFilename);
// GridPartType gridPart( *gridPtr ); GridPartType gridPart(*gridPtr);
const GridViewType gridView = gridPtr->leafView();
// function space // function space
...@@ -260,43 +255,37 @@ int main(int argc, char** argv) ...@@ -260,43 +255,37 @@ int main(int argc, char** argv)
// discrete function space // discrete function space
typedef DiscreteFunctionSpace::Continuous::Lagrange<FunctionSpaceType, GridViewType, polOrder> DiscreteH1Type; typedef DiscreteFunctionSpace::Continuous::Lagrange<FunctionSpaceType, GridPartType, polOrder> DiscreteH1Type;
// const DiscreteH1Type discreteH1( gridPart ); const DiscreteH1Type discreteH1(gridPart);
// typedef DiscreteFunctionSpace::Subspace::Linear::Dirichlet< DiscreteH1Type > typedef DiscreteFunctionSpace::Subspace::Linear::Dirichlet<DiscreteH1Type> DiscreteH10Type;
// DiscreteH10Type;
// const DiscreteH10Type discreteH10( discreteH1 ); const DiscreteH10Type discreteH10(discreteH1);
// typedef DiscreteFunctionSpace::Subspace::Affine::Dirichlet< DiscreteH10Type > typedef DiscreteFunctionSpace::Subspace::Affine::Dirichlet<DiscreteH10Type> DiscreteH1GType;
// DiscreteH1GType;
// const DiscreteH1GType discreteH1G( discreteH10, "[x+y;y;z]" ); const DiscreteH1GType discreteH1G(discreteH10, "[x+y;y;z]");
// local evaluation // local evaluation
// typedef ProductEvaluation< FunctionSpaceType > typedef ProductEvaluation<FunctionSpaceType> ProductEvaluationType;
// ProductEvaluationType;
// ProductEvaluationType productEvaluation( "[1.0;1.0;1.0]" ); ProductEvaluationType productEvaluation("[1.0;1.0;1.0]");
// typedef EllipticEvaluation< FunctionSpaceType > typedef EllipticEvaluation<FunctionSpaceType> EllipticEvaluationType;
// EllipticEvaluationType;
// EllipticEvaluationType ellipticEvaluation( "[1.0;1.0;1.0]" ); EllipticEvaluationType ellipticEvaluation("[1.0;1.0;1.0]");
// operator and functional // operator and functional
// typedef DiscreteOperator::Local::Codim0::Integral< EllipticEvaluationType > typedef DiscreteOperator::Local::Codim0::Integral<EllipticEvaluationType> LocalEllipticOperatorType;
// LocalEllipticOperatorType;
// const LocalEllipticOperatorType localEllipticOperator( ellipticEvaluation ); const LocalEllipticOperatorType localEllipticOperator(ellipticEvaluation);
// typedef DiscreteFunctional::Local::Codim0::Integral< ProductEvaluationType > typedef DiscreteFunctional::Local::Codim0::Integral<ProductEvaluationType> LocalL2FunctionalType;
// LocalL2FunctionalType;
// const LocalL2FunctionalType localL2Functional( productEvaluation ); const LocalL2FunctionalType localL2Functional(productEvaluation);
// typedef typename LocalEllipticOperatorType::LocalFunctional< typename DiscreteH1GType::AffineShiftType >::Type // typedef typename LocalEllipticOperatorType::LocalFunctional< typename DiscreteH1GType::AffineShiftType >::Type
// LocalAffineShiftFunctionalType; // LocalAffineShiftFunctionalType;
...@@ -305,47 +294,38 @@ int main(int argc, char** argv) ...@@ -305,47 +294,38 @@ int main(int argc, char** argv)
// discreteH1G.affineShift() ); // discreteH1G.affineShift() );
// matrix, rhs and solution storage // matrix, rhs and solution storage
// typedef Container::Matrix::Defaults< RangeFieldType, dimRange, dimRange >::BCRSMatrix typedef Container::Matrix::Defaults<RangeFieldType, dimRange, dimRange>::BCRSMatrix MatrixFactory;
// MatrixFactory;
// typedef typename MatrixFactory::AutoPtrType typedef typename MatrixFactory::AutoPtrType MatrixPtrType;
// MatrixPtrType;
// //! \todo the matrix factory should get two spaces (ansatz and test) //! \todo the matrix factory should get two spaces (ansatz and test)
// MatrixPtrType A = MatrixFactory::create( discreteH1 ); MatrixPtrType A = MatrixFactory::create(discreteH1);
// typedef Container::Vector::Defaults< RangeFieldType, dimRange >::BlockVector typedef Container::Vector::Defaults<RangeFieldType, dimRange>::BlockVector VectorFactory;
// VectorFactory;
// typedef typename VectorFactory::AutoPtrType typedef typename VectorFactory::AutoPtrType VectorPtrType;
// VectorPtrType;
// VectorPtrType F = VectorFactory::create( discreteH1 ); VectorPtrType F = VectorFactory::create(discreteH1);
// VectorPtrType G = VectorFactory::create( discreteH1 ); VectorPtrType G = VectorFactory::create(discreteH1);
// VectorPtrType u0 = VectorFactory::create( discreteH1 ); VectorPtrType u0 = VectorFactory::create(discreteH1);
// assembler // assembler
// typedef Assembler::Local::Codim0::Matrix< LocalEllipticOperatorType > typedef Assembler::Local::Codim0::Matrix<LocalEllipticOperatorType> LocalMatrixAssemblerType;
// LocalMatrixAssemblerType;
// const LocalMatrixAssemblerType localMatrixAssembler( localEllipticOperator ); const LocalMatrixAssemblerType localMatrixAssembler(localEllipticOperator);
// typedef Assembler::Local::Codim0::Vector< LocalL2FunctionalType > typedef Assembler::Local::Codim0::Vector<LocalL2FunctionalType> LocalVectorAssemblerType;
// LocalVectorAssemblerType;
// const LocalVectorAssemblerType localVectorAssembler( localL2Functional ); const LocalVectorAssemblerType localVectorAssembler(localL2Functional);
// typedef Assembler::System::Affine< DiscreteH1GType, DiscreteH10Type > typedef Assembler::System::Affine<DiscreteH1GType, DiscreteH10Type> SystemAssemblerType;
// SystemAssemblerType;
// SystemAssemblerType systemAssembler( discreteH1G, discreteH10 ); SystemAssemblerType systemAssembler(discreteH1G, discreteH10);
// systemAssembler.assembleSystem( localMatrixAssembler, *A, systemAssembler.assembleSystem(localMatrixAssembler, *A, localVectorAssembler, *F, *G);
// localVectorAssembler, *F,
// *G );
// // preconditioner and solver // // preconditioner and solver
...@@ -377,13 +357,12 @@ int main(int argc, char** argv) ...@@ -377,13 +357,12 @@ int main(int argc, char** argv)
// postprocessing // postprocessing
// typedef Dune::AdaptiveDiscreteFunction< typename DiscreteH1Type::HostSpaceType > typedef Dune::AdaptiveDiscreteFunction<typename DiscreteH1Type::HostSpaceType> DiscreteFunctionType;
// DiscreteFunctionType;
// DiscreteFunctionType boundaryData = Dune::FemTools::Function::createFromVector< DiscreteFunctionType >( DiscreteFunctionType boundaryData = Dune::FemTools::Function::createFromVector<DiscreteFunctionType>(
// discreteH1.hostSpace(), discreteH1G.affineShift().storage() ); discreteH1.hostSpace(), discreteH1G.affineShift().storage());
// Dune::FemTools::Function::writeToVTK( boundaryData, "boundaryData" ); Dune::FemTools::Function::writeToVTK(boundaryData, "boundaryData");
// DiscreteFunctionType solution = Dune::FemTools::Function::createFromVector< DiscreteFunctionType >( // DiscreteFunctionType solution = Dune::FemTools::Function::createFromVector< DiscreteFunctionType >(
// discreteH1.hostSpace(), *u0 ); // discreteH1.hostSpace(), *u0 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment