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

Merge branch 'master' into diffusion

parents cc01a847 d57744c7
No related branches found
No related tags found
No related merge requests found
...@@ -6,8 +6,6 @@ set( tnl_heat_equation_SOURCES ...@@ -6,8 +6,6 @@ set( tnl_heat_equation_SOURCES
tnl-heat-equation-eoc.cpp tnl-heat-equation-eoc.cpp
heatEquationSolver_impl.h heatEquationSolver_impl.h
heatEquationSolver.h heatEquationSolver.h
heatEquationScheme_impl.h
heatEquationScheme.h
tnlHeatEquationEocRhs.h ) tnlHeatEquationEocRhs.h )
ADD_EXECUTABLE(tnl-heat-equation${debugExt} tnl-heat-equation.cpp) ADD_EXECUTABLE(tnl-heat-equation${debugExt} tnl-heat-equation.cpp)
......
/***************************************************************************
heatEquationScheme.h - description
-------------------
begin : Aug 05, 2014
copyright : (C) 2014 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef HEATEQUATIONSCHEME_H_
#define HEATEQUATIONSCHEME_H_
template< typename Mesh,
typename DifferentialOperator,
typename RightHandSide >
class heatEquationScheme
{
public:
typedef Mesh MeshType;
typedef typename MeshType::CoordinatesType CoordinatesType;
typedef typename MeshType::VertexType VertexType;
typedef typename MeshType::DeviceType DeviceType;
typedef typename DifferentialOperator::RealType RealType;
typedef typename DifferentialOperator::IndexType IndexType;
template< typename Vector >
#ifdef HAVE_CUDA
__device__ __host__
#endif
void explicitUpdate( const RealType& time,
const RealType& tau,
const MeshType& mesh,
const IndexType cellIndex,
const CoordinatesType& coordinates,
Vector& u,
Vector& fu );
protected:
DifferentialOperator differentialOperator;
RightHandSide rightHandSide;
};
#include "heatEquationScheme_impl.h"
#endif /* HEATEQUATIONSCHEME_H_ */
/***************************************************************************
heatEquationScheme_impl.h - description
-------------------
begin : Aug 05, 2014
copyright : (C) 2014 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef HEATEQUATIONSCHEME_IMPL_H_
#define HEATEQUATIONSCHEME_IMPL_H_
template< typename Mesh,
typename DifferentialOperator,
typename RightHandSide >
template< typename Vector >
#ifdef HAVE_CUDA
__device__ __host__
#endif
void
heatEquationScheme< Mesh, DifferentialOperator, RightHandSide >::
explicitUpdate( const RealType& time,
const RealType& tau,
const MeshType& mesh,
const IndexType cellIndex,
const CoordinatesType& coordinates,
Vector& u,
Vector& fu )
{
this->differentialOperator.explicitUpdate( time, tau, mesh, cellIndex, coordinates, u, fu );
VertexType vertex = mesh.getCellCenter( coordinates );
fu[ cellIndex ] += this->rightHandSide.getValue( time, vertex );
}
#endif /* HEATEQUATIONSCHEME_IMPL_H_ */
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <core/vectors/tnlSharedVector.h> #include <core/vectors/tnlSharedVector.h>
#include <solvers/pde/tnlExplicitUpdater.h> #include <solvers/pde/tnlExplicitUpdater.h>
#include "heatEquationSolver.h" #include "heatEquationSolver.h"
#include "heatEquationScheme.h"
template< typename Mesh, template< typename Mesh,
...@@ -42,7 +41,6 @@ class heatEquationSolver ...@@ -42,7 +41,6 @@ class heatEquationSolver
typedef typename DifferentialOperator::IndexType IndexType; typedef typename DifferentialOperator::IndexType IndexType;
typedef Mesh MeshType; typedef Mesh MeshType;
typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType; typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType;
typedef heatEquationScheme< Mesh, DifferentialOperator, RightHandSide > Scheme;
static tnlString getTypeStatic(); static tnlString getTypeStatic();
......
...@@ -77,7 +77,6 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::I ...@@ -77,7 +77,6 @@ typename heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >::I
/**** /****
* 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
*/ */
return 3*mesh.getNumberOfCells();
} }
template< typename Mesh, template< typename Mesh,
...@@ -110,12 +109,12 @@ bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide > ...@@ -110,12 +109,12 @@ bool heatEquationSolver< Mesh,Diffusion,BoundaryCondition,RightHandSide >
:: setInitialCondition( const tnlParameterContainer& parameters, :: setInitialCondition( const tnlParameterContainer& parameters,
const MeshType& mesh ) const MeshType& mesh )
{ {
const tnlString& initialConditionFile = parameters.GetParameter< tnlString >( "initial-condition" ); /*const tnlString& initialConditionFile = parameters.GetParameter< tnlString >( "initial-condition" );
if( ! this->solution.load( initialConditionFile ) ) if( ! this->solution.load( initialConditionFile ) )
{ {
cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." << endl; cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." << endl;
return false; return false;
} }*/
return true; return true;
} }
......
...@@ -33,7 +33,7 @@ tnl-grid-setup --dimensions ${dimension} \ ...@@ -33,7 +33,7 @@ tnl-grid-setup --dimensions ${dimension} \
--size-y ${dofSize} \ --size-y ${dofSize} \
--size-z ${dofSize} \ --size-z ${dofSize} \
tnl-discrete --mesh mesh.tnl \ tnl-init --mesh mesh.tnl \
--function ${analyticFunction} \ --function ${analyticFunction} \
--output-file u-ini.tnl \ --output-file u-ini.tnl \
--amplitude ${amplitude} \ --amplitude ${amplitude} \
......
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