Commit afc7f13d authored by Jan Schäfer's avatar Jan Schäfer
Browse files

dodelana analyticke reseni a vzresen problem s tau

parent 7affe081
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ class advectionProblem:
      int dimension;
      tnlString choice;
      RealType size;
      int step = 0;
      long step = 0;
      MeshFunctionType analyt;
      RealType speedX;
      RealType speedY;
+9 −0
Original line number Diff line number Diff line
@@ -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 ); 
+4 −4
Original line number Diff line number Diff line
@@ -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;