From: michael Date: Wed, 24 Nov 2021 15:06:38 +0000 (+0100) Subject: Improved message displays X-Git-Tag: V9_8_0~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=031f7c8f95afa0b915db4c89a54f7999175a996e;p=tools%2Fsolverlab.git Improved message displays --- diff --git a/CoreFlows/Models/src/DiffusionEquation.cxx b/CoreFlows/Models/src/DiffusionEquation.cxx index 51c78ea..4c4a718 100755 --- a/CoreFlows/Models/src/DiffusionEquation.cxx +++ b/CoreFlows/Models/src/DiffusionEquation.cxx @@ -72,7 +72,7 @@ DiffusionEquation::DiffusionEquation(int dim, bool FECalculation,double rho,doub /* Control input value are acceptable */ if(rho<_precision or cp<_precision) { - PetscPrintf(PETSC_COMM_WORLD,"rho = %.2f, cp = %.2f, precision = %.2f\n",rho,cp,_precision); + PetscPrintf(PETSC_COMM_WORLD,"rho = %.2f, cp = %.2f, precision = %.2e\n",rho,cp,_precision); throw CdmathException("Error : parameters rho and cp should be strictly positive"); } if(lambda < 0.) @@ -86,11 +86,11 @@ DiffusionEquation::DiffusionEquation(int dim, bool FECalculation,double rho,doub throw CdmathException("Error : parameter dim cannot be negative"); } - PetscPrintf(PETSC_COMM_WORLD,"Diffusion problem with density %.2f, specific heat %.2f, conductivity %.2f", rho,cp,lambda); + PetscPrintf(PETSC_COMM_WORLD,"\n Diffusion problem with density %.2e, specific heat %.2e, conductivity %.2e", rho,cp,lambda); if(FECalculation) - PetscPrintf(PETSC_COMM_WORLD," and finite elements method\n"); + PetscPrintf(PETSC_COMM_WORLD," and finite elements method\n\n"); else - PetscPrintf(PETSC_COMM_WORLD," and finite volumes method\n"); + PetscPrintf(PETSC_COMM_WORLD," and finite volumes method\n\n"); _FECalculation=FECalculation; @@ -120,8 +120,6 @@ DiffusionEquation::DiffusionEquation(int dim, bool FECalculation,double rho,doub _fileName = "SolverlabDiffusionProblem"; - _runLogFile=new ofstream; - /* Default diffusion tensor is diagonal */ _DiffusionTensor=Matrix(_Ndim); for(int idim=0;idim<_Ndim;idim++) @@ -140,14 +138,14 @@ void DiffusionEquation::initialize() *_runLogFile<< "Problem : dim = "<<_Ndim<< " but mesh dim= "<<_mesh.getMeshDimension()<<", mesh space dim= "<<_mesh.getSpaceDimension()<close(); - throw CdmathException("DiffusionEquation::initialize: mesh has incorrect dimension"); + throw CdmathException("!!!!!!!!DiffusionEquation::initialize: mesh has incorrect dimension"); } if(!_initialDataSet) - throw CdmathException("DiffusionEquation::initialize() set initial data first"); + throw CdmathException("!!!!!!!!DiffusionEquation::initialize() set initial data first"); else { - PetscPrintf(PETSC_COMM_SELF,"Initialising the diffusion of a solid temperature using "); + PetscPrintf(PETSC_COMM_SELF,"\n Initialising the diffusion of a solid temperature using "); *_runLogFile<<"Initialising the diffusion of a solid temperature using "; if(!_FECalculation) { @@ -314,7 +312,7 @@ double DiffusionEquation::computeDiffusionMatrix(bool & stop) else result=computeDiffusionMatrixFV(stop); - PetscPrintf(PETSC_COMM_WORLD,"Maximum diffusivity is %.2f, CFL = %.2f, Delta x = %.2f\n",_maxvp,_cfl,_minl); + PetscPrintf(PETSC_COMM_WORLD,"Maximum diffusivity is %.2e, CFL = %.2f, Delta x = %.2e\n",_maxvp,_cfl,_minl); MatAssemblyBegin(_A, MAT_FINAL_ASSEMBLY); MatAssemblyEnd( _A, MAT_FINAL_ASSEMBLY); @@ -602,7 +600,7 @@ bool DiffusionEquation::initTimeStep(double dt){ } else//dt<=0 { - PetscPrintf(PETSC_COMM_WORLD,"DiffusionEquation::initTimeStep %.2f = \n",dt); + PetscPrintf(PETSC_COMM_WORLD,"DiffusionEquation::initTimeStep %.2e = \n",dt); throw CdmathException("Error DiffusionEquation::initTimeStep : cannot set time step to zero"); } //At this stage _b contains _b0 + power + heat exchange @@ -704,8 +702,8 @@ void DiffusionEquation::validateTimeStep() } void DiffusionEquation::save(){ - PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results\n\n"); - *_runLogFile<< "Saving numerical results"<< endl<(_nVar,0);//Not to be confused with _GravityField3d (size _Ndim). _gravite (size _Nvar) is usefull for dealing with source term and implicitation of gravity vector @@ -3475,6 +3478,9 @@ void DriftModel::getDensityDerivatives(double concentration, double pression, do } void DriftModel::save(){ + PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep); + *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<(_fluides[0])==NULL || static_cast(_fluides[1])==NULL) - throw CdmathException("FiveEqsTwoFluid::initialize: both phase must have stiffened gas EOS"); + throw CdmathException("!!!!!!!!FiveEqsTwoFluid::initialize: both phase must have stiffened gas EOS"); _Uroe = new double[_nVar+1]; @@ -2230,6 +2233,9 @@ void FiveEqsTwoFluid::testConservation() } void FiveEqsTwoFluid::save(){ + PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep); + *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<close(); - throw CdmathException("ProblemFluid::initialize() set initial data first"); + throw CdmathException("!!!!!!!!ProblemFluid::initialize() set initial data first"); } else if (_VV.getTypeOfField() != CELLS) { - *_runLogFile<<"Initial data should be a field on CELLS, not NODES, neither FACES"<close(); - throw CdmathException("ProblemFluid::initialize() Initial data should be a field on CELLS, not NODES, neither FACES"); + throw CdmathException("!!!!!!!!ProblemFluid::initialize() Initial data should be a field on CELLS, not NODES, neither FACES"); } cout << "Number of Phases = " << _nbPhases << " mesh dimension = "<<_Ndim<<" number of variables = "<<_nVar<