diff --git a/examples/advection/advectionProblem.h b/examples/advection/advectionProblem.h index c853d23af61deb088013c4b3b4f9313ab8f5ab7c..f72121b35a170d9262e4a0e9b503600b80f76a1f 100644 --- a/examples/advection/advectionProblem.h +++ b/examples/advection/advectionProblem.h @@ -29,7 +29,7 @@ class advectionProblem: int dimension; tnlString choice; RealType size; - int step = 0; + long step = 0; MeshFunctionType analyt; RealType speedX; RealType speedY; diff --git a/examples/advection/advectionProblem_impl.h b/examples/advection/advectionProblem_impl.h index cf4b364700324f06b1578d022e61d41ba4638059..bccdeccdfcb44928f4dc961e24981d561638af76 100644 --- a/examples/advection/advectionProblem_impl.h +++ b/examples/advection/advectionProblem_impl.h @@ -290,6 +290,7 @@ makeSnapshot( const RealType& time, FileNameBaseNumberEnding( "a-", step, 5, ".tnl", fileName ); if( ! this->analyt.save( fileName ) ) return false; +cin.ignore(); return true; } @@ -310,6 +311,8 @@ getExplicitRHS( const RealType& time, typedef typename MeshType::Cell Cell; double count = mesh.template getEntitiesCount< Cell >(); double inverseSquareCount = sqrt(count); + if (tau > 10e-9) + { if (this->choice == "square") { if (dimension == 1) @@ -409,6 +412,12 @@ getExplicitRHS( const RealType& time, }; }; }; + }; +/* + cout << step << endl; + cout << tau << endl; + cout << this->speedX << endl; + cout << step * 10 * tau * this->speedX<< endl;*/ this->bindDofs( mesh, _u ); tnlExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide > explicitUpdater; MeshFunctionType u( mesh, _u ); diff --git a/examples/inviscid-flow/2d/eulerProblem_impl.h b/examples/inviscid-flow/2d/eulerProblem_impl.h index 86b591b6e6cd33012942a7b7954eb2c2b3924404..60bca6d92ccf8d298dc266bf2a0f0d7d14c80520 100644 --- a/examples/inviscid-flow/2d/eulerProblem_impl.h +++ b/examples/inviscid-flow/2d/eulerProblem_impl.h @@ -143,7 +143,7 @@ setInitialCondition( const tnlParameterContainer& parameters, uRho[j*sqrt(size)+i] = rhoLd; uRhoVelocityX[j*sqrt(size)+i] = rhoLd * velLdX; uRhoVelocityY[j*sqrt(size)+i] = rhoLd * velLdY; - uEnergy[j*sqrt(size)+i] = eL; + uEnergy[j*sqrt(size)+i] = eLd; velocity[j*sqrt(size)+i] = sqrt(pow(velLdX,2)+pow(velLdY,2)); velocityX[j*sqrt(size)+i] = velLdX; velocityY[j*sqrt(size)+i] = velLdY; @@ -153,8 +153,8 @@ setInitialCondition( const tnlParameterContainer& parameters, if ((i >= x0 * sqrt(size))&&(j < x0 * sqrt(size)) ) { uRho[j*sqrt(size)+i] = rhoLu; - uRhoVelocityX[j*sqrt(size)+i] = rhoLu * velLXu; - uRhoVelocityY[j*sqrt(size)+i] = rhoLu * velLYu; + uRhoVelocityX[j*sqrt(size)+i] = rhoLu * velLuX; + uRhoVelocityY[j*sqrt(size)+i] = rhoLu * velLuY; uEnergy[j*sqrt(size)+i] = eLu; velocity[j*sqrt(size)+i] = sqrt(pow(velLuX,2)+pow(velLuY,2)); velocityX[j*sqrt(size)+i] = velLuX; @@ -164,7 +164,7 @@ setInitialCondition( const tnlParameterContainer& parameters, else if ((i >= x0 * sqrt(size))&&(j >= x0 * sqrt(size)) ) { - uRho[j*sqrt(size)+i] = rhoR; + uRho[j*sqrt(size)+i] = rhoRu; uRhoVelocityX[j*sqrt(size)+i] = rhoRu * velRuX; uRhoVelocityY[j*sqrt(size)+i] = rhoRu * velRuY; uEnergy[j*sqrt(size)+i] = eRu;