Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
25efbf59
There was an error fetching the commit references. Please try again later.
Commit
25efbf59
authored
10 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring the heat equation.
parent
93f7af2a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/heat-equation/heatEquationSolver.h
+8
-9
8 additions, 9 deletions
examples/heat-equation/heatEquationSolver.h
examples/heat-equation/heatEquationSolver_impl.h
+16
-26
16 additions, 26 deletions
examples/heat-equation/heatEquationSolver_impl.h
with
24 additions
and
35 deletions
examples/heat-equation/heatEquationSolver.h
+
8
−
9
View file @
25efbf59
...
...
@@ -32,9 +32,7 @@
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
typename
RightHandSide
>
class
heatEquationSolver
{
public:
...
...
@@ -44,8 +42,6 @@ class heatEquationSolver
typedef
typename
Diffusion
::
IndexType
IndexType
;
typedef
Mesh
MeshType
;
typedef
tnlVector
<
RealType
,
DeviceType
,
IndexType
>
DofVectorType
;
typedef
tnlCSRMatrix
<
RealType
,
DeviceType
,
IndexType
>
DiscreteSolverMatrixType
;
typedef
tnlDummyPreconditioner
<
RealType
,
DeviceType
,
IndexType
>
DiscreteSolverPreconditioner
;
static
tnlString
getTypeStatic
();
...
...
@@ -90,13 +86,16 @@ class heatEquationSolver
tnlExplicitUpdater
<
Mesh
,
DofVectorType
,
BoundaryCondition
,
Diffusion
>
explicitUpdater
;
AnalyticSpaceFunction
analyticSpaceFunction
;
TimeFunction
timeFunction
;
AnalyticSolution
<
MeshType
,
RealType
,
IndexType
>
analyticSolution
;
//AnalyticSpaceFunction analyticSpaceFunction;
//TimeFunction timeFunction;
//AnalyticSolution< MeshType, RealType, IndexType > analyticSolution;
BoundaryCondition
boundaryCondition
;
Diffusion
diffusion
;
RightHandSide
RHS
;
IndexType
ifLaplaceCompare
,
ifSolutionCompare
;
//
IndexType ifLaplaceCompare, ifSolutionCompare;
};
#include
"heatEquationSolver_impl.h"
...
...
This diff is collapsed.
Click to expand it.
examples/heat-equation/heatEquationSolver_impl.h
+
16
−
26
View file @
25efbf59
...
...
@@ -22,34 +22,30 @@
#include
"heatEquationSolver.h"
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
tnlString
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
>
tnlString
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>
::
getTypeStatic
()
{
return
tnlString
(
"heatEquationSolver< "
)
+
Mesh
::
getTypeStatic
()
+
" >"
;
}
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
tnlString
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
>
tnlString
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>
::
getPrologHeader
()
const
{
return
tnlString
(
"Heat equation"
);
}
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
void
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
>
void
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>
::
writeProlog
(
tnlLogger
&
logger
,
const
tnlParameterContainer
&
parameters
)
const
{
//logger. WriteParameter< tnlString >( "Problem name:", "problem-name", parameters );
//logger. WriteParameter< int >( "Simple parameter:", 1 );
}
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
bool
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
>
bool
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>
::
init
(
const
tnlParameterContainer
&
parameters
)
{
analyticSpaceFunction
.
init
(
parameters
);
...
...
@@ -71,11 +67,9 @@ bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,TimeFunc
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
typename
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>::
IndexType
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>::
getDofs
(
const
Mesh
&
mesh
)
const
typename
RightHandSide
>
typename
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>::
IndexType
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>::
getDofs
(
const
Mesh
&
mesh
)
const
{
/****
* Set-up DOFs and supporting grid functions
...
...
@@ -86,11 +80,9 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide,Time
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
typename
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>::
IndexType
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>::
getAuxiliaryDofs
(
const
Mesh
&
mesh
)
const
typename
RightHandSide
>
typename
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>::
IndexType
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>::
getAuxiliaryDofs
(
const
Mesh
&
mesh
)
const
{
/****
* 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
template
<
typename
Mesh
,
typename
Diffusion
,
typename
BoundaryCondition
,
typename
RightHandSide
,
typename
TimeFunction
,
typename
AnalyticSpaceFunction
>
typename
RightHandSide
>
void
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
,
TimeFunction
,
AnalyticSpaceFunction
>::
heatEquationSolver
<
Mesh
,
Diffusion
,
BoundaryCondition
,
RightHandSide
>::
bindDofs
(
const
MeshType
&
mesh
,
DofVectorType
&
dofVector
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment