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
6d78d9f9
There was an error fetching the commit references. Please try again later.
Commit
6d78d9f9
authored
8 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Fixing tnl-quickstart.
parent
1520b3d8
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
src/Tools/tnl-quickstart/problem.h.in
+16
-13
16 additions, 13 deletions
src/Tools/tnl-quickstart/problem.h.in
src/Tools/tnl-quickstart/problem_impl.h.in
+24
-24
24 additions, 24 deletions
src/Tools/tnl-quickstart/problem_impl.h.in
with
40 additions
and
37 deletions
src/Tools/tnl-quickstart/problem.h.in
+
16
−
13
View file @
6d78d9f9
...
...
@@ -20,6 +20,9 @@ class {problemBaseName}Problem:
typedef typename DifferentialOperator::IndexType IndexType;
typedef TNL::Functions::MeshFunction< Mesh > MeshFunctionType;
typedef TNL::Problems::PDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;
typedef TNL::SharedPointer< DifferentialOperator > DifferentialOperatorPointer;
typedef TNL::SharedPointer< BoundaryCondition > BoundaryConditionPointer;
typedef TNL::SharedPointer< RightHandSide, DeviceType > RightHandSidePointer;
using typename BaseType::MeshType;
using typename BaseType::MeshPointer;
...
...
@@ -42,17 +45,17 @@ class {problemBaseName}Problem:
bool setInitialCondition( const TNL::Config::ParameterContainer& parameters,
const MeshPointer& mesh,
DofVector
Type
& dofs,
DofVector
Pointer
& dofs,
MeshDependentDataType& meshDependentData );
template< typename Matrix >
template< typename Matrix
Pointer
>
bool setupLinearSystem( const MeshPointer& mesh,
Matrix& matrix );
Matrix
Pointer
& matrix
Pointer
);
bool makeSnapshot( const RealType& time,
const IndexType& step,
const MeshPointer& mesh,
DofVector
Type
& dofs,
DofVector
Pointer
& dofs,
MeshDependentDataType& meshDependentData );
IndexType getDofs( const MeshPointer& mesh ) const;
...
...
@@ -63,24 +66,24 @@ class {problemBaseName}Problem:
void getExplicitRHS( const RealType& time,
const RealType& tau,
const MeshPointer& mesh,
DofVector
Type
& _u,
DofVector
Type
& _fu,
DofVector
Pointer
& _u,
DofVector
Pointer
& _fu,
MeshDependentDataType& meshDependentData );
template< typename Matrix >
template< typename Matrix
Pointer
>
void assemblyLinearSystem( const RealType& time,
const RealType& tau,
const MeshPointer& mesh,
DofVector
Type
& dofs,
Matrix& matrix,
DofVector
Type
& rightHandSide,
DofVector
Pointer
& dofs,
Matrix
Pointer
& matrix
Pointer
,
DofVector
Pointer
& rightHandSide,
MeshDependentDataType& meshDependentData );
protected:
DifferentialOperator differentialOperator;
BoundaryCondition boundaryCondition;
RightHandSide rightHandSide;
DifferentialOperator
Pointer
differentialOperator;
BoundaryCondition
Pointer
boundaryCondition;
RightHandSide
Pointer
rightHandSide;
}};
#include "{problemBaseName}Problem_impl.h"
This diff is collapsed.
Click to expand it.
src/Tools/tnl-quickstart/problem_impl.h.in
+
24
−
24
View file @
6d78d9f9
...
...
@@ -53,7 +53,7 @@ setup( const MeshPointer& meshPointer,
const TNL::Config::ParameterContainer& parameters,
const TNL::String& prefix )
{{
if( ! this->boundaryCondition.setup( parameters, "boundary-conditions-" ) ||
if( ! this->boundaryCondition.setup(
meshPointer,
parameters, "boundary-conditions-" ) ||
! this->rightHandSide.setup( parameters, "right-hand-side-" ) )
return false;
return true;
...
...
@@ -71,7 +71,7 @@ getDofs( const MeshPointer& mesh ) const
* Return number of DOFs (degrees of freedom) i.e. number
* of unknowns to be resolved by the main solver.
*/
return mesh
.
template getEntitiesCount< typename MeshType::Cell >();
return mesh
->
template getEntitiesCount< typename MeshType::Cell >();
}}
template< typename Mesh,
...
...
@@ -93,7 +93,7 @@ bool
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::
setInitialCondition( const TNL::Config::ParameterContainer& parameters,
const MeshPointer& mesh,
DofVector
Type
& dofs,
DofVector
Pointer
& dofs,
MeshDependentDataType& meshDependentData )
{{
const TNL::String& initialConditionFile = parameters.getParameter< TNL::String >( "initial-condition" );
...
...
@@ -110,24 +110,24 @@ template< typename Mesh,
typename BoundaryCondition,
typename RightHandSide,
typename DifferentialOperator >
template< typename Matrix >
template< typename Matrix
Pointer
>
bool
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::
setupLinearSystem( const MeshPointer& mesh,
Matrix& matrix )
setupLinearSystem( const MeshPointer& mesh
Pointer
,
Matrix
Pointer
& matrix
Pointer
)
{{
const IndexType dofs = this->getDofs( mesh );
typedef typename Matrix::CompressedRowsLengthsVector CompressedRowsLengthsVectorType;
CompressedRowsLengthsVectorType rowLengths;
if( ! rowLengths
.
setSize( dofs ) )
const IndexType dofs = this->getDofs( mesh
Pointer
);
typedef typename Matrix
Pointer::ObjectType
::CompressedRowsLengthsVector CompressedRowsLengthsVectorType;
TNL::SharedPointer<
CompressedRowsLengthsVectorType
>
rowLengths
Pointer
;
if( ! rowLengths
Pointer->
setSize( dofs ) )
return false;
TNL::Matrices::MatrixSetter< MeshType, DifferentialOperator, BoundaryCondition, CompressedRowsLengthsVectorType > matrixSetter;
matrixSetter.template getCompressedRowsLengths< typename Mesh::Cell >( mesh,
matrixSetter.template getCompressedRowsLengths< typename Mesh::Cell >( mesh
Pointer
,
differentialOperator,
boundaryCondition,
rowLengths );
matrix
.
setDimensions( dofs, dofs );
if( ! matrix
.
setCompressedRowsLengths( rowLengths ) )
rowLengths
Pointer
);
matrix
Pointer->
setDimensions( dofs, dofs );
if( ! matrix
Pointer->
setCompressedRowsLengths(
*
rowLengths
Pointer
) )
return false;
return true;
}}
...
...
@@ -141,7 +141,7 @@ bool
makeSnapshot( const RealType& time,
const IndexType& step,
const MeshPointer& mesh,
DofVector
Type
& dofs,
DofVector
Pointer
& dofs,
MeshDependentDataType& meshDependentData )
{{
std::cout << std::endl << "Writing output at time " << time << " step " << step << "." << std::endl;
...
...
@@ -150,7 +150,7 @@ makeSnapshot( const RealType& time,
fileName.setFileNameBase( "u-" );
fileName.setExtension( "tnl" );
fileName.setIndex( step );
if( ! dofs
.
save( fileName.getFileName() ) )
if( ! dofs
->
save( fileName.getFileName() ) )
return false;
return true;
}}
...
...
@@ -164,8 +164,8 @@ void
getExplicitRHS( const RealType& time,
const RealType& tau,
const MeshPointer& mesh,
DofVector
Type
& _u,
DofVector
Type
& _fu,
DofVector
Pointer
& _u,
DofVector
Pointer
& _fu,
MeshDependentDataType& meshDependentData )
{{
/****
...
...
@@ -199,15 +199,15 @@ template< typename Mesh,
typename BoundaryCondition,
typename RightHandSide,
typename DifferentialOperator >
template< typename Matrix >
template< typename Matrix
Pointer
>
void
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::
assemblyLinearSystem( const RealType& time,
const RealType& tau,
const MeshPointer& mesh,
DofVector
Type
& _u,
Matrix& matrix,
DofVector
Type
& b,
DofVector
Pointer
& _u,
Matrix
Pointer
& matrix
Pointer
,
DofVector
Pointer
& b,
MeshDependentDataType& meshDependentData )
{{
TNL::Solvers::PDE::LinearSystemAssembler< Mesh,
...
...
@@ -216,7 +216,7 @@ assemblyLinearSystem( const RealType& time,
BoundaryCondition,
RightHandSide,
TNL::Solvers::PDE::BackwardTimeDiscretisation,
Matrix
,
typename MatrixPointer::ObjectType
,
DofVectorType > systemAssembler;
TNL::Functions::MeshFunction< Mesh > u( mesh, _u );
...
...
@@ -227,6 +227,6 @@ assemblyLinearSystem( const RealType& time,
this->boundaryCondition,
this->rightHandSide,
u,
matrix,
matrix
Pointer
,
b );
}}
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