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 @@
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
examples/heat-equation/heatEquationSolver_impl.h
+
16
−
26
View file @
25efbf59
...
@@ -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
)
{
{
...
...
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