Loading examples/inviscid-flow/1d/LaxFridrichsContinuity_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ operator()( const MeshFunction& u, const IndexType& east = neighbourEntities.template getEntityIndex< 1 >(); const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) - 0.5 * hxInverse * ( u[ west ] * this->velocity[ west ] - u[ east ] * this->velocity[ east ] ); - 0.5 * hxInverse * ( u[ east ] * this->velocity[ east ] - u[ west ] * this->velocity[ west ] ); } template< typename MeshReal, Loading examples/inviscid-flow/1d/LaxFridrichsEnergy_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -48,8 +48,8 @@ operator()( const MeshFunction& u, const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) - 0.5 * hxInverse * (( u[ west ] + this->pressure[ west ] ) * velocity[ west ] - (u[ east ] + this->pressure[ east ] ) * velocity[ east ] ); (( u[ east ] + this->pressure[ east ] ) * velocity[ east ] -( u[ west ] + this->pressure[ west ] ) * velocity[ west ] ); } template< typename MeshReal, Loading examples/inviscid-flow/1d/LaxFridrichsMomentum_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,8 @@ operator()( const MeshFunction& u, const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) - 0.5 * hxInverse * (( u[ west ] * this -> velocity[ west ] + this -> pressure [ west ] ) - (u[ east ] * this -> velocity[ east ] + this -> pressure [ east ] )); (( u[ east ] * this -> velocity[ east ] + this -> pressure [ east ] ) -( u[ west ] * this -> velocity[ west ] + this -> pressure [ west ] )); } template< typename MeshReal, Loading examples/inviscid-flow/1d/euler.h +17 −5 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include <functions/tnlConstantFunction.h> #include "eulerProblem.h" #include "LaxFridrichs.h" #include "tnlMyMixedBoundaryConditions.h" #include "eulerRhs.h" #include "eulerBuildConfigTag.h" Loading @@ -31,6 +32,7 @@ template< typename ConfigTag >class eulerConfig config.addEntry< tnlString >( "boundary-conditions-type", "Choose the boundary conditions type.", "dirichlet"); config.addEntryEnum< tnlString >( "dirichlet" ); config.addEntryEnum< tnlString >( "neumann" ); config.addEntryEnum< tnlString >( "mymixed" ); config.addEntry< double >( "boundary-conditions-constant", "This sets a value in case of the constant boundary conditions." ); config.addEntry< double >( "left-density", "This sets a value of left density." ); config.addEntry< double >( "left-velocity", "This sets a value of left velocity." ); Loading Loading @@ -98,11 +100,21 @@ class eulerSetter SolverStarter solverStarter; return solverStarter.template run< Problem >( parameters ); } if( boundaryConditionsType == "mymixed" ) { typedef tnlMyMixedBoundaryConditions< MeshType, MeshFunction, MeshType::getMeshDimensions(), Real, Index > BoundaryConditions; typedef eulerProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem; SolverStarter solverStarter; return solverStarter.template run< Problem >( parameters ); } if( boundaryConditionsType == "neumann" ) { typedef tnlNeumannBoundaryConditions< MeshType, MeshFunction, Real, Index > BoundaryConditions; typedef eulerProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem; SolverStarter solverStarter; return solverStarter.template run< Problem >( parameters ); } } }; Loading examples/inviscid-flow/2d/EulerVelGetter.h +1 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ class EulerVelGetter static tnlString getType(); EulerVelGetter( const MeshFunctionType& rhoX, EulerVelGetter( const MeshFunctionType& rho, const MeshFunctionType& rhoVelX, const MeshFunctionType& rhoVelY) : rho( rho ), rhoVelX( rhoVelX ), rhoVelY( rhoVelY ) Loading @@ -37,7 +37,6 @@ class EulerVelGetter __cuda_callable__ Real operator[]( const IndexType& idx ) const { cout << idx << endl; if (this->rho[ idx ]==0) return 0; else return sqrt( pow( this->rhoVelX[ idx ] / this->rho[ idx ], 2) + pow( this->rhoVelY[ idx ] / this->rho[ idx ], 2) ) ; } Loading Loading
examples/inviscid-flow/1d/LaxFridrichsContinuity_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ operator()( const MeshFunction& u, const IndexType& east = neighbourEntities.template getEntityIndex< 1 >(); const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) - 0.5 * hxInverse * ( u[ west ] * this->velocity[ west ] - u[ east ] * this->velocity[ east ] ); - 0.5 * hxInverse * ( u[ east ] * this->velocity[ east ] - u[ west ] * this->velocity[ west ] ); } template< typename MeshReal, Loading
examples/inviscid-flow/1d/LaxFridrichsEnergy_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -48,8 +48,8 @@ operator()( const MeshFunction& u, const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) - 0.5 * hxInverse * (( u[ west ] + this->pressure[ west ] ) * velocity[ west ] - (u[ east ] + this->pressure[ east ] ) * velocity[ east ] ); (( u[ east ] + this->pressure[ east ] ) * velocity[ east ] -( u[ west ] + this->pressure[ west ] ) * velocity[ west ] ); } template< typename MeshReal, Loading
examples/inviscid-flow/1d/LaxFridrichsMomentum_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,8 @@ operator()( const MeshFunction& u, const IndexType& west = neighbourEntities.template getEntityIndex< -1 >(); return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) - 0.5 * hxInverse * (( u[ west ] * this -> velocity[ west ] + this -> pressure [ west ] ) - (u[ east ] * this -> velocity[ east ] + this -> pressure [ east ] )); (( u[ east ] * this -> velocity[ east ] + this -> pressure [ east ] ) -( u[ west ] * this -> velocity[ west ] + this -> pressure [ west ] )); } template< typename MeshReal, Loading
examples/inviscid-flow/1d/euler.h +17 −5 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include <functions/tnlConstantFunction.h> #include "eulerProblem.h" #include "LaxFridrichs.h" #include "tnlMyMixedBoundaryConditions.h" #include "eulerRhs.h" #include "eulerBuildConfigTag.h" Loading @@ -31,6 +32,7 @@ template< typename ConfigTag >class eulerConfig config.addEntry< tnlString >( "boundary-conditions-type", "Choose the boundary conditions type.", "dirichlet"); config.addEntryEnum< tnlString >( "dirichlet" ); config.addEntryEnum< tnlString >( "neumann" ); config.addEntryEnum< tnlString >( "mymixed" ); config.addEntry< double >( "boundary-conditions-constant", "This sets a value in case of the constant boundary conditions." ); config.addEntry< double >( "left-density", "This sets a value of left density." ); config.addEntry< double >( "left-velocity", "This sets a value of left velocity." ); Loading Loading @@ -98,11 +100,21 @@ class eulerSetter SolverStarter solverStarter; return solverStarter.template run< Problem >( parameters ); } if( boundaryConditionsType == "mymixed" ) { typedef tnlMyMixedBoundaryConditions< MeshType, MeshFunction, MeshType::getMeshDimensions(), Real, Index > BoundaryConditions; typedef eulerProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem; SolverStarter solverStarter; return solverStarter.template run< Problem >( parameters ); } if( boundaryConditionsType == "neumann" ) { typedef tnlNeumannBoundaryConditions< MeshType, MeshFunction, Real, Index > BoundaryConditions; typedef eulerProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem; SolverStarter solverStarter; return solverStarter.template run< Problem >( parameters ); } } }; Loading
examples/inviscid-flow/2d/EulerVelGetter.h +1 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ class EulerVelGetter static tnlString getType(); EulerVelGetter( const MeshFunctionType& rhoX, EulerVelGetter( const MeshFunctionType& rho, const MeshFunctionType& rhoVelX, const MeshFunctionType& rhoVelY) : rho( rho ), rhoVelX( rhoVelX ), rhoVelY( rhoVelY ) Loading @@ -37,7 +37,6 @@ class EulerVelGetter __cuda_callable__ Real operator[]( const IndexType& idx ) const { cout << idx << endl; if (this->rho[ idx ]==0) return 0; else return sqrt( pow( this->rhoVelX[ idx ] / this->rho[ idx ], 2) + pow( this->rhoVelY[ idx ] / this->rho[ idx ], 2) ) ; } Loading