Commit 1187b1be authored by Tomáš Oberhuber's avatar Tomáš Oberhuber

Adding operator function.

Removing parameter mesh from method getValue in operators.
parent 99f2203b
* tnlBoundaryConditionsSetter was implemented
- it allows to set boundary conditions to given function
- in explicit solvers, it must be called explicitly now after calling tnlExplicitUpdater
2015-12-25 Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
* significant changes in grids
- the central structure is now grid entity rather than grid itself
......
/***************************************************************************
tnlOperatorFunction.h - description
-------------------
begin : Dec 31, 2015
copyright : (C) 2015 by 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 TNLOPERATORFUNCTION_H
#define TNLOPERATORFUNCTION_H
#include <type_traits>
#include <core/tnlCuda.h>
template< typename Operator,
typename MeshFunction,
typename BoundaryConditions >
class tnlOperatorFunction
{
static_assert( std::is_same< typename Operator::MeshType, typename MeshFunction::MeshType >::value,
"Operator and MeshFunction have different mesh type." );
static_assert( std::is_same< typename Operator::MeshType, typename BoundaryConditions::MeshType >::value,
"Operator and BoundaryConditions have different mesh type." );
public:
typedef Operator OperatorType;
typedef MeshFunction MeshFunctionType;
typedef BoundaryConditions BoundaryConditionsType;
typedef typename OperatorType::MeshType MeshType;
typedef typename OperatorType::RealType RealType;
typedef typename OperatorType::DeviceType DeviceType;
typedef typename OperatorType::IndexType IndexType;
tnlOperatorFunction(
const OperatorType& operator_,
const MeshFunctionType& function,
const BoundaryConditionsType& boundaryConditions );
template< typename MeshEntity >
__cuda_callable__
RealType operator()(
const MeshEntity& meshEntity,
const RealType& time );
protected:
const Operator& operator_;
const MeshFunction& function;
const BoundaryConditions& boundaryConditions;
};
#endif /* TNLOPERATORFUNCTION_H */
/***************************************************************************
tnlOperatorFunction_impl.h - description
-------------------
begin : Dec 31, 2015
copyright : (C) 2015 by 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 TNLOPERATORFUNCTION_IMPL_H
#define TNLOPERATORFUNCTION_IMPL_H
template< typename Operator,
typename Function >
tnlOperatorFunction< Operator, Function >::
tnlOperatorFunction(
const OperatorType& operator_,
const MeshFunctionType& function,
const BoundaryConditionsType& boundaryConditions )
: operator_( operator_ ),
function( function ),
boundaryConditions( boundaryConditions )
{
}
template< typename Operator,
typename Function >
template< typename MeshEntity >
__cuda_callable__
typename tnlOperatorFunction< Operator, Function >::RealType
tnlOperatorFunction< Operator, Function >::operator()(
const MeshEntity& meshEntity,
const RealType& time )
{
static_assert( MeshEntity::entityDimensions == Function::getMeshEntityDimensions(), "Wrong mesh entity dimensions." );
if( meshEntity.isBoundaryEntity() )
return boundaryConditions.getValue( meshEntity, function.getData(), time );
return operator_.getValue( meshEntity, function.getData(), time );
}
#endif /* TNLOPERATORFUNCTION_IMPL_H */
......@@ -51,6 +51,7 @@ class tnlGridEntity< tnlGrid< Dimensions, Real, Device, Index >, EntityDimension
public:
typedef tnlGrid< Dimensions, Real, Device, Index > GridType;
typedef GridType MeshType;
typedef typename GridType::IndexType IndexType;
typedef typename GridType::CoordinatesType CoordinatesType;
typedef Config ConfigType;
......@@ -168,6 +169,7 @@ class tnlGridEntity< tnlGrid< Dimensions, Real, Device, Index >, Dimensions, Con
public:
typedef tnlGrid< Dimensions, Real, Device, Index > GridType;
typedef GridType MeshType;
typedef typename GridType::IndexType IndexType;
typedef typename GridType::CoordinatesType CoordinatesType;
typedef typename GridType::VertexType VertexType;
......@@ -278,7 +280,8 @@ class tnlGridEntity< tnlGrid< Dimensions, Real, Device, Index >, 0, Config >
{
public:
typedef tnlGrid< Dimensions, Real, Device, Index > GridType;
typedef tnlGrid< Dimensions, Real, Device, Index > GridType;
typedef GridType MeshType;
typedef typename GridType::IndexType IndexType;
typedef typename GridType::CoordinatesType CoordinatesType;
typedef typename GridType::VertexType VertexType;
......
......@@ -31,8 +31,7 @@ processBoundaryEntities( const GridType& grid,
/****
* Boundary cells
*/
const int CellDimensions = GridType::meshDimensions;
//typename GridType::template GridEntity< CellDimensions > entity( grid );
static_assert( GridEntity::entityDimensions == 1, "The entity has wrong dimensions." );
GridEntity entity( grid );
CoordinatesType& coordinates = entity.getCoordinates();
......@@ -58,8 +57,7 @@ processInteriorEntities( const GridType& grid,
/****
* Interior cells
*/
const int CellDimensions = GridType::meshDimensions;
//typename GridType::template GridEntity< CellDimensions > cell( grid );
static_assert( GridEntity::entityDimensions == 1, "The entity has wrong dimensions." );
GridEntity cell( grid );
const IndexType& xSize = grid.getDimensions().x();
......@@ -85,8 +83,7 @@ processBoundaryEntities( const GridType& grid,
/****
* Boundary vertices
*/
const int VerticesDimensions = 0;
//typename GridType::template GridEntity< VerticesDimensions > entity( grid );
static_assert( GridEntity::entityDimensions == 0, "The entity has wrong dimensions." );
GridEntity entity( grid );
CoordinatesType& coordinates = entity.getCoordinates();
......@@ -112,10 +109,9 @@ processInteriorEntities( const GridType& grid,
/****
* Interior vertices
*/
const int VerticesDimensions = 0;
//typename GridType::template GridEntity< VerticesDimensions > entity( grid );
GridEntity entity( grid );
static_assert( GridEntity::entityDimensions == 0, "The entity has wrong dimensions." );
GridEntity entity( grid );
CoordinatesType& coordinates = entity.getCoordinates();
const IndexType& xSize = grid.getDimensions().x();
for( coordinates.x() = 1; coordinates.x() < xSize; coordinates.x() ++ )
......@@ -134,6 +130,7 @@ processInteriorEntities( const GridType& grid,
#ifdef HAVE_CUDA
template< typename Real,
typename Index,
typename GridEntity,
typename UserData,
typename EntitiesProcessor,
bool processAllEntities,
......@@ -142,11 +139,10 @@ __global__ void tnlTraverserGrid1DCells( const tnlGrid< 1, Real, tnlCuda, Index
UserData* userData,
Index gridXIdx )
{
typedef tnlGrid< 1, Real, tnlCuda, Index > GridType;
const int CellDimensions = GridType::meshDimensions;
//typename GridType::template GridEntity< CellDimensions > entity( *grid );
GridEntity entity( *grid );
typedef tnlGrid< 1, Real, tnlCuda, Index > GridType;
typedef typename GridType::CoordinatesType CoordinatesType;
GridEntity entity( *grid );
CoordinatesType& coordinates = entity.getCoordinates();
const Index index = ( gridXIdx * tnlCuda::getMaxGridSize() + blockIdx.x ) * blockDim.x + threadIdx.x;
......@@ -178,6 +174,7 @@ processBoundaryEntities( const GridType& grid,
/****
* Boundary conditions
*/
static_assert( GridEntity::entityDimensions == 1, "The entity has wrong dimensions." );
GridType* kernelGrid = tnlCuda::passToDevice( grid );
UserData* kernelUserData = tnlCuda::passToDevice( userData );
......@@ -187,7 +184,7 @@ processBoundaryEntities( const GridType& grid,
const IndexType cudaXGrids = tnlCuda::getNumberOfGrids( cudaBlocks.x );
for( IndexType gridXIdx = 0; gridXIdx < cudaXGrids; gridXIdx ++ )
tnlTraverserGrid1DCells< Real, Index, UserData, EntitiesProcessor, false, true >
tnlTraverserGrid1DCells< Real, Index, GridEntity, UserData, EntitiesProcessor, false, true >
<<< cudaBlocks, cudaBlockSize >>>
( kernelGrid,
kernelUserData,
......@@ -213,6 +210,7 @@ processInteriorEntities( const GridType& grid,
/****
* Interior cells
*/
static_assert( GridEntity::entityDimensions == 1, "The entity has wrong dimensions." );
checkCudaDevice;
GridType* kernelGrid = tnlCuda::passToDevice( grid );
UserData* kernelUserData = tnlCuda::passToDevice( userData );
......@@ -227,7 +225,7 @@ processInteriorEntities( const GridType& grid,
{
if( gridXIdx == cudaXGrids - 1 )
cudaGridSize.x = cudaBlocks.x % tnlCuda::getMaxGridSize();
tnlTraverserGrid1DCells< Real, Index, UserData, EntitiesProcessor, false, false >
tnlTraverserGrid1DCells< Real, Index, GridEntity, UserData, EntitiesProcessor, false, false >
<<< cudaGridSize, cudaBlockSize >>>
( kernelGrid,
kernelUserData,
......@@ -243,6 +241,7 @@ processInteriorEntities( const GridType& grid,
#ifdef HAVE_CUDA
template< typename Real,
typename Index,
typename GridEntity,
typename UserData,
typename EntitiesProcessor,
bool processAllEntities,
......@@ -252,7 +251,6 @@ __global__ void tnlTraverserGrid1DVertices( const tnlGrid< 1, Real, tnlCuda, Ind
Index gridXIdx )
{
typedef tnlGrid< 1, Real, tnlCuda, Index > GridType;
//typename GridType::template GridEntity< GridType::Vertices > vertex;
GridEntity vertex( *grid );
const Index& xSize = grid->getDimensions().x();
......@@ -290,6 +288,7 @@ processBoundaryEntities( const GridType& grid,
/****
* Boundary vertices
*/
static_assert( GridEntity::entityDimensions == 0, "The entity has wrong dimensions." );
GridType* kernelGrid = tnlCuda::passToDevice( grid );
UserData* kernelUserData = tnlCuda::passToDevice( userData );
......@@ -299,7 +298,7 @@ processBoundaryEntities( const GridType& grid,
const IndexType cudaXGrids = tnlCuda::getNumberOfGrids( cudaBlocks.x );
for( IndexType gridXIdx = 0; gridXIdx < cudaXGrids; gridXIdx ++ )
tnlTraverserGrid1DVertices< Real, Index, UserData, EntitiesProcessor, false, true >
tnlTraverserGrid1DVertices< Real, Index, GridEntity, UserData, EntitiesProcessor, false, true >
<<< cudaBlocks, cudaBlockSize >>>
( kernelGrid,
kernelUserData,
......@@ -327,6 +326,7 @@ processInteriorEntities( const GridType& grid,
/****
* Interior vertices
*/
static_assert( GridEntity::entityDimensions == 0, "The entity has wrong dimensions." );
checkCudaDevice;
GridType* kernelGrid = tnlCuda::passToDevice( grid );
UserData* kernelUserData = tnlCuda::passToDevice( userData );
......@@ -341,7 +341,7 @@ processInteriorEntities( const GridType& grid,
{
if( gridXIdx == cudaXGrids - 1 )
cudaGridSize.x = cudaBlocks.x % tnlCuda::getMaxGridSize();
tnlTraverserGrid1DVertices< Real, Index, UserData, EntitiesProcessor, false, false >
tnlTraverserGrid1DVertices< Real, Index, GridEntity, UserData, EntitiesProcessor, false, false >
<<< cudaGridSize, cudaBlockSize >>>
( kernelGrid,
kernelUserData,
......
This diff is collapsed.
This diff is collapsed.
......@@ -37,8 +37,7 @@ class tnlFiniteVolumeNonlinearOperator< tnlGrid< 1,MeshReal, Device, MeshIndex >
template< typename MeshEntity,
typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......@@ -90,8 +89,7 @@ class tnlFiniteVolumeNonlinearOperator< tnlGrid< 2, MeshReal, Device, MeshIndex
template< typename MeshEntity,
typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......@@ -143,8 +141,7 @@ class tnlFiniteVolumeNonlinearOperator< tnlGrid< 3, MeshReal, Device, MeshIndex
template< typename MeshEntity,
typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......
......@@ -37,8 +37,7 @@ class tnlOneSideDiffNonlinearOperator< tnlGrid< 1,MeshReal, Device, MeshIndex >,
template< typename Vector,
typename MeshEntity >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......@@ -90,8 +89,7 @@ class tnlOneSideDiffNonlinearOperator< tnlGrid< 2, MeshReal, Device, MeshIndex >
template< typename Vector,
typename MeshEntity >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......@@ -142,8 +140,7 @@ class tnlOneSideDiffNonlinearOperator< tnlGrid< 3, MeshReal, Device, MeshIndex >
template< typename Vector,
typename MeshEntity >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......
......@@ -51,8 +51,7 @@ class tnlLinearDiffusion< tnlGrid< 1,MeshReal, Device, MeshIndex >, Real, Index
template< typename MeshEntity,
typename Vector >
__cuda_callable__
inline Real getValue( const MeshType& mesh,
const MeshEntity& entity,
inline Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time ) const;
......@@ -99,8 +98,7 @@ class tnlLinearDiffusion< tnlGrid< 2, MeshReal, Device, MeshIndex >, Real, Index
template< typename EntityType,
typename Vector >
__cuda_callable__
inline Real getValue( const MeshType& mesh,
const EntityType& entity,
inline Real getValue( const EntityType& entity,
const Vector& u,
const Real& time ) const;
......@@ -146,8 +144,7 @@ class tnlLinearDiffusion< tnlGrid< 3, MeshReal, Device, MeshIndex >, Real, Index
template< typename EntityType,
typename Vector >
__cuda_callable__
inline Real getValue( const MeshType& mesh,
const EntityType& entity,
inline Real getValue( const EntityType& entity,
const Vector& u,
const Real& time ) const;
......
......@@ -47,13 +47,12 @@ __cuda_callable__
inline
Real
tnlLinearDiffusion< tnlGrid< 1, MeshReal, Device, MeshIndex >, Real, Index >::
getValue( const MeshType& mesh,
const MeshEntity& entity,
getValue( const MeshEntity& entity,
const Vector& u,
const Real& time ) const
{
const typename MeshEntity::template NeighbourEntities< 1 >& neighbourEntities = entity.getNeighbourEntities();
const RealType& hxSquareInverse = mesh.template getSpaceStepsProducts< - 2 >();
const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< - 2 >();
return ( u[ neighbourEntities.template getEntityIndex< -1 >() ]
- 2.0 * u[ entity.getIndex() ]
+ u[ neighbourEntities.template getEntityIndex< 1 >() ] ) * hxSquareInverse;
......@@ -149,14 +148,13 @@ __cuda_callable__
inline
Real
tnlLinearDiffusion< tnlGrid< 2, MeshReal, Device, MeshIndex >, Real, Index >::
getValue( const MeshType& mesh,
const EntityType& entity,
getValue( const EntityType& entity,
const Vector& u,
const Real& time ) const
{
const typename EntityType::template NeighbourEntities< 2 >& neighbourEntities = entity.getNeighbourEntities();
const RealType& hxSquareInverse = mesh.template getSpaceStepsProducts< -2, 0 >();
const RealType& hySquareInverse = mesh.template getSpaceStepsProducts< 0, -2 >();
const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0 >();
const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2 >();
return ( u[ neighbourEntities.template getEntityIndex< -1, 0 >() ]
+ u[ neighbourEntities.template getEntityIndex< 1, 0 >() ] ) * hxSquareInverse +
( u[ neighbourEntities.template getEntityIndex< 0, -1 >() ]
......@@ -223,15 +221,14 @@ __cuda_callable__
inline
Real
tnlLinearDiffusion< tnlGrid< 3, MeshReal, Device, MeshIndex >, Real, Index >::
getValue( const MeshType& mesh,
const EntityType& entity,
getValue( const EntityType& entity,
const Vector& u,
const Real& time ) const
{
const typename EntityType::template NeighbourEntities< 3 >& neighbourEntities = entity.getNeighbourEntities();
const RealType& hxSquareInverse = mesh.template getSpaceStepsProducts< -2, 0, 0 >();
const RealType& hySquareInverse = mesh.template getSpaceStepsProducts< 0, -2, 0 >();
const RealType& hzSquareInverse = mesh.template getSpaceStepsProducts< 0, 0, -2 >();
const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0, 0 >();
const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2, 0 >();
const RealType& hzSquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, 0, -2 >();
return ( u[ neighbourEntities.template getEntityIndex< -1, 0, 0 >() ]
+ u[ neighbourEntities.template getEntityIndex< 1, 0, 0 >() ] ) * hxSquareInverse +
( u[ neighbourEntities.template getEntityIndex< 0, -1, 0 >() ]
......
......@@ -37,8 +37,7 @@ class tnlNonlinearDiffusion< tnlGrid< 1,MeshReal, Device, MeshIndex >, Nonlinear
template< typename MeshEntity,
typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
......@@ -90,13 +89,12 @@ class tnlNonlinearDiffusion< tnlGrid< 2, MeshReal, Device, MeshIndex >, Nonlinea
template< typename MeshEntity,
typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
__cuda_callable__
template< typename MeshEntity >
__cuda_callable__
Index getLinearSystemRowLength( const MeshType& mesh,
const IndexType& index,
const MeshEntity& entity ) const;
......@@ -142,13 +140,12 @@ class tnlNonlinearDiffusion< tnlGrid< 3, MeshReal, Device, MeshIndex >, Nonlinea
template< typename MeshEntity,
typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
const MeshEntity& entity,
Real getValue( const MeshEntity& entity,
const Vector& u,
const RealType& time) const;
__cuda_callable__
template< typename MeshEntity >
__cuda_callable__
Index getLinearSystemRowLength( const MeshType& mesh,
const IndexType& index,
const MeshEntity& entity ) const;
......
......@@ -34,12 +34,11 @@ template< typename MeshEntity,
__cuda_callable__
Real
tnlNonlinearDiffusion< tnlGrid< 1, MeshReal, Device, MeshIndex >, NonlinearDiffusionOperator, Real, Index >::
getValue( const MeshType& mesh,
const MeshEntity& entity,
getValue( const MeshEntity& entity,
const Vector& u,
const Real& time ) const
{
return nonlinearDiffusionOperator.getValue( mesh, entity, u, time );
return nonlinearDiffusionOperator.getValue( entity, u, time );
}
template< typename MeshReal,
......@@ -111,12 +110,11 @@ template< typename MeshEntity,
__cuda_callable__
Real
tnlNonlinearDiffusion< tnlGrid< 2, MeshReal, Device, MeshIndex >, NonlinearDiffusionOperator, Real, Index >::
getValue( const MeshType& mesh,
const MeshEntity& entity,
getValue( const MeshEntity& entity,
const Vector& u,
const Real& time ) const
{
return nonlinearDiffusionOperator.getValue( mesh, entity, u, time );
return nonlinearDiffusionOperator.getValue( entity, u, time );
}
template< typename MeshReal,
......@@ -188,12 +186,11 @@ template< typename MeshEntity,
__cuda_callable__
Real
tnlNonlinearDiffusion< tnlGrid< 3, MeshReal, Device, MeshIndex >, NonlinearDiffusionOperator, Real, Index >::
getValue( const MeshType& mesh,
const MeshEntity& entity,
getValue( const MeshEntity& entity,
const Vector& u,
const Real& time ) const
{
return nonlinearDiffusionOperator.getValue( mesh, entity, u, time );
return nonlinearDiffusionOperator.getValue( entity, u, time );
}
template< typename MeshReal,
......
......@@ -58,7 +58,6 @@ class tnlFiniteVolumeOperatorQ< tnlGrid< 1,MeshReal, Device, MeshIndex >, Real,
__cuda_callable__
Real
boundaryDerivative(
const MeshType& mesh,
const MeshEntity& entity,
const Vector& u,
const Real& time,
......@@ -98,7 +97,6 @@ class tnlFiniteVolumeOperatorQ< tnlGrid< 2,MeshReal, Device, MeshIndex >, Real,
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValue(
const MeshType& mesh,
const MeshEntity& entity,
const Vector& u,
const Real& time,
......@@ -151,7 +149,7 @@ class tnlFiniteVolumeOperatorQ< tnlGrid< 3,MeshReal, Device, MeshIndex >, Real,
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
Real getValue(
const MeshEntity& entity,
const Vector& u,
const Real& time,
......
......@@ -80,8 +80,7 @@ template< typename MeshEntity, typename Vector, int AxeX, int AxeY, int AxeZ >
__cuda_callable__
Real
tnlFiniteVolumeOperatorQ< tnlGrid< 1, MeshReal, Device, MeshIndex >, Real, Index, 0 >::
boundaryDerivative( const MeshType& mesh,
const MeshEntity& entity,
boundaryDerivative( const MeshEntity& entity,
const Vector& u,
const Real& time,
const IndexType& dx,
......@@ -222,12 +221,12 @@ bind( Vector& u)
return 0;
}
__cuda_callable__
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real,
typename Index >
__cuda_callable__
void
tnlFiniteVolumeOperatorQ< tnlGrid< 2, MeshReal, Device, MeshIndex >, Real, Index, 1 >::
update( const MeshType& mesh, const RealType& time )
......@@ -304,15 +303,15 @@ template< typename MeshEntity, typename Vector >
__cuda_callable__
Real
tnlFiniteVolumeOperatorQ< tnlGrid< 2, MeshReal, Device, MeshIndex >, Real, Index, 0 >::
getValue( const MeshType& mesh,
const MeshEntity& entity,
getValue( const MeshEntity& entity,
const Vector& u,
const Real& time,
const IndexType& dx,
const IndexType& dy,
const IndexType& dz ) const
{
const typename MeshEntity::template NeighbourEntities< 2 >& neighbourEntities = entity.getNeighbourEntities();
const typename MeshEntity::template NeighbourEntities< 2 >& neighbourEntities = entity.getNeighbourEntities();
const typename MeshEntity::MeshType& mesh = entity.getMesh();
const IndexType& cellIndex = entity.getIndex();
if ( ( dx == 0 ) && ( dy == 0 ) && ( dz == 0 ) )
return sqrt( this->eps + ( u[ neighbourEntities.template getEntityIndex< 0,1 >() ] - u[ cellIndex ] ) *
......@@ -433,12 +432,12 @@ bind( Vector& u)
return 0;
}
__cuda_callable__
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real,
typename Index >
__cuda_callable__
void
tnlFiniteVolumeOperatorQ< tnlGrid< 3, MeshReal, Device, MeshIndex >, Real, Index, 1 >::
update( const MeshType& mesh, const RealType& time )
......@@ -554,7 +553,6 @@ __cuda_callable__
Real
tnlFiniteVolumeOperatorQ< tnlGrid< 3, MeshReal, Device, MeshIndex >, Real, Index, 0 >::
getValue(
const MeshType& mesh,
const MeshEntity& entity,
const Vector& u,
const Real& time,
......@@ -563,6 +561,7 @@ getValue(
const IndexType& dz ) const
{
const typename MeshEntity::template NeighbourEntities< 3 >& neighbourEntities = entity.getNeighbourEntities();
const typename MeshEntity::MeshType& mesh = entity.getMesh();
const IndexType& cellIndex = entity.getIndex();
if ( ( dx == 0 ) && ( dy == 0 ) && ( dz == 0 ) )
return sqrt( this->eps + ( u[ neighbourEntities.template getEntityIndex< 0,1,0 >() ] - u[ cellIndex ] ) *
......
......@@ -42,14 +42,14 @@ class tnlOneSideDiffOperatorQ< tnlGrid< 1,MeshReal, Device, MeshIndex >, Real, I
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
Real getValue(
const MeshEntity& entity,
const Vector& u,
const Real& time ) const;
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValueStriped( const MeshType& mesh,
Real getValueStriped(
const MeshEntity& entity,
const Vector& u,
const Real& time )const;
......@@ -89,14 +89,14 @@ class tnlOneSideDiffOperatorQ< tnlGrid< 2,MeshReal, Device, MeshIndex >, Real, I
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
Real getValue(
const MeshEntity& entity,
const Vector& u,
const Real& time ) const;
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValueStriped( const MeshType& mesh,
Real getValueStriped(
const MeshEntity& entity,
const Vector& u,
const Real& time )const;
......@@ -136,14 +136,14 @@ class tnlOneSideDiffOperatorQ< tnlGrid< 3,MeshReal, Device, MeshIndex >, Real, I
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
Real getValue(
const MeshEntity& entity,
const Vector& u,
const Real& time ) const;
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValueStriped( const MeshType& mesh,
Real getValueStriped(
const MeshEntity& entity,
const Vector& u,
const Real& time ) const;
......@@ -181,15 +181,14 @@ class tnlOneSideDiffOperatorQ< tnlGrid< 1,MeshReal, Device, MeshIndex >, Real, I
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValue( const MeshType& mesh,
Real getValue(
const MeshEntity& entity,
const Vector& u,
const Real& time ) const;
template< typename MeshEntity, typename Vector >
__cuda_callable__
Real getValueStriped( const MeshType& mesh,
const IndexType cellIndex,
Real getValueStriped(
const MeshEntity& entity,