Skip to content
Snippets Groups Projects
Commit 25efbf59 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Refactoring the heat equation.

parent 93f7af2a
No related branches found
No related tags found
No related merge requests found
...@@ -32,9 +32,7 @@ ...@@ -32,9 +32,7 @@
template< typename Mesh, template< typename Mesh,
typename Diffusion, typename Diffusion,
typename BoundaryCondition, typename BoundaryCondition,
typename RightHandSide, typename RightHandSide >
typename TimeFunction,
typename AnalyticSpaceFunction>
class heatEquationSolver class heatEquationSolver
{ {
public: public:
...@@ -44,8 +42,6 @@ class heatEquationSolver ...@@ -44,8 +42,6 @@ class heatEquationSolver
typedef typename Diffusion::IndexType IndexType; typedef typename Diffusion::IndexType IndexType;
typedef Mesh MeshType; typedef Mesh MeshType;
typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType; typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType;
typedef tnlCSRMatrix< RealType, DeviceType, IndexType > DiscreteSolverMatrixType;
typedef tnlDummyPreconditioner< RealType, DeviceType, IndexType > DiscreteSolverPreconditioner;
static tnlString getTypeStatic(); static tnlString getTypeStatic();
...@@ -90,13 +86,16 @@ class heatEquationSolver ...@@ -90,13 +86,16 @@ class heatEquationSolver
tnlExplicitUpdater< Mesh, DofVectorType, BoundaryCondition, Diffusion > explicitUpdater; tnlExplicitUpdater< Mesh, DofVectorType, BoundaryCondition, Diffusion > explicitUpdater;
AnalyticSpaceFunction analyticSpaceFunction; //AnalyticSpaceFunction analyticSpaceFunction;
TimeFunction timeFunction; //TimeFunction timeFunction;
AnalyticSolution< MeshType, RealType, IndexType > analyticSolution; //AnalyticSolution< MeshType, RealType, IndexType > analyticSolution;
BoundaryCondition boundaryCondition; BoundaryCondition boundaryCondition;
Diffusion diffusion; Diffusion diffusion;
RightHandSide RHS; RightHandSide RHS;
IndexType ifLaplaceCompare, ifSolutionCompare; //IndexType ifLaplaceCompare, ifSolutionCompare;
}; };
#include "heatEquationSolver_impl.h" #include "heatEquationSolver_impl.h"
......
...@@ -22,34 +22,30 @@ ...@@ -22,34 +22,30 @@
#include "heatEquationSolver.h" #include "heatEquationSolver.h"
template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide, template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide >
typename TimeFunction, typename AnalyticSpaceFunction> tnlString heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >
tnlString heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction>
::getTypeStatic() ::getTypeStatic()
{ {
return tnlString( "heatEquationSolver< " ) + Mesh :: getTypeStatic() + " >"; return tnlString( "heatEquationSolver< " ) + Mesh :: getTypeStatic() + " >";
} }
template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide, template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide >
typename TimeFunction, typename AnalyticSpaceFunction> tnlString heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >
tnlString heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction>
:: getPrologHeader() const :: getPrologHeader() const
{ {
return tnlString( "Heat equation" ); return tnlString( "Heat equation" );
} }
template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide, template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide >
typename TimeFunction, typename AnalyticSpaceFunction> void heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >
void heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction>
:: writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const :: writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const
{ {
//logger. WriteParameter< tnlString >( "Problem name:", "problem-name", parameters ); //logger. WriteParameter< tnlString >( "Problem name:", "problem-name", parameters );
//logger. WriteParameter< int >( "Simple parameter:", 1 ); //logger. WriteParameter< int >( "Simple parameter:", 1 );
} }
template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide, template< typename Mesh, typename Diffusion, typename BoundaryCondition, typename RightHandSide >
typename TimeFunction, typename AnalyticSpaceFunction> bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >
bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction>
:: init( const tnlParameterContainer& parameters ) :: init( const tnlParameterContainer& parameters )
{ {
analyticSpaceFunction.init(parameters); analyticSpaceFunction.init(parameters);
...@@ -71,11 +67,9 @@ bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunc ...@@ -71,11 +67,9 @@ bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunc
template< typename Mesh, template< typename Mesh,
typename Diffusion, typename Diffusion,
typename BoundaryCondition, typename BoundaryCondition,
typename RightHandSide, typename RightHandSide >
typename TimeFunction, typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::IndexType
typename AnalyticSpaceFunction > heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::getDofs( const Mesh& mesh ) const
typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction >::IndexType
heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction >::getDofs( const Mesh& mesh ) const
{ {
/**** /****
* Set-up DOFs and supporting grid functions * Set-up DOFs and supporting grid functions
...@@ -86,11 +80,9 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,Time ...@@ -86,11 +80,9 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,Time
template< typename Mesh, template< typename Mesh,
typename Diffusion, typename Diffusion,
typename BoundaryCondition, typename BoundaryCondition,
typename RightHandSide, typename RightHandSide >
typename TimeFunction, typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::IndexType
typename AnalyticSpaceFunction > heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::getAuxiliaryDofs( const Mesh& mesh ) const
typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction >::IndexType
heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction >::getAuxiliaryDofs( const Mesh& mesh ) const
{ {
/**** /****
* Set-up DOFs and supporting grid functions which will not appear in the discrete solver * Set-up DOFs and supporting grid functions which will not appear in the discrete solver
...@@ -101,11 +93,9 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,Time ...@@ -101,11 +93,9 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,Time
template< typename Mesh, template< typename Mesh,
typename Diffusion, typename Diffusion,
typename BoundaryCondition, typename BoundaryCondition,
typename RightHandSide, typename RightHandSide >
typename TimeFunction,
typename AnalyticSpaceFunction >
void void
heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunction,AnalyticSpaceFunction >:: heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::
bindDofs( const MeshType& mesh, bindDofs( const MeshType& mesh,
DofVectorType& dofVector ) DofVectorType& dofVector )
{ {
......
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