Added: Virtual method printStep for app-specific time step headers
This commit is contained in:
parent
3167d115a1
commit
095c671396
@ -314,11 +314,16 @@ SIM::ConvStatus NewmarkSIM::solveStep (TimeStep& param, SIM::SolutionMode,
|
|||||||
|
|
||||||
if (msgLevel >= 0)
|
if (msgLevel >= 0)
|
||||||
{
|
{
|
||||||
utl::LogStream& cout = model.getProcessAdm().cout;
|
double digits = log10(param.time.t) - log10(param.time.dt);
|
||||||
double digits = log10(param.time.t)-log10(param.time.dt);
|
if (digits > 6.0)
|
||||||
size_t stdPrec = digits > 6.0 ? cout.precision(ceil(digits)) : 0;
|
{
|
||||||
cout <<"\n step="<< param.step <<" time="<< param.time.t << std::endl;
|
utl::LogStream& cout = model.getProcessAdm().cout;
|
||||||
if (digits > 6.0) cout.precision(stdPrec);
|
std::streamsize oldPrec = cout.precision(ceil(digits));
|
||||||
|
model.printStep(param.step,param.time);
|
||||||
|
cout.precision(oldPrec);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
model.printStep(param.step,param.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subiter&FIRST && !model.updateDirichlet(param.time.t,&solution.front()))
|
if (subiter&FIRST && !model.updateDirichlet(param.time.t,&solution.front()))
|
||||||
|
@ -203,15 +203,16 @@ ConvStatus NonLinSIM::solveStep (TimeStep& param, SolutionMode mode,
|
|||||||
|
|
||||||
if (msgLevel >= 0)
|
if (msgLevel >= 0)
|
||||||
{
|
{
|
||||||
utl::LogStream& cout = model.getProcessAdm().cout;
|
double digits = log10(param.time.t) - log10(param.time.dt);
|
||||||
double digits = log10(param.time.t)-log10(param.time.dt);
|
if (digits > 6.0)
|
||||||
std::streamsize oldPrec = digits > 6.0 ? cout.precision(ceil(digits)) : 0;
|
{
|
||||||
cout <<"\n step="<< param.step <<" time="<< param.time.t;
|
utl::LogStream& cout = model.getProcessAdm().cout;
|
||||||
if (param.maxCFL > 0.0 || param.maxCFL < -0.5)
|
std::streamsize oldPrec = cout.precision(ceil(digits));
|
||||||
cout <<" CFL = "<< param.time.CFL << std::endl;
|
model.printStep(param.step,param.time);
|
||||||
|
cout.precision(oldPrec);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
cout << std::endl;
|
model.printStep(param.step,param.time);
|
||||||
if (oldPrec > 0) cout << std::setprecision(oldPrec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
param.iter = 0;
|
param.iter = 0;
|
||||||
|
@ -1055,6 +1055,12 @@ bool SIMbase::solveMatrixSystem (Vectors& solution, int printSol,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SIMbase::printStep (int istep, const TimeDomain& time) const
|
||||||
|
{
|
||||||
|
adm.cout <<"\n step="<< istep <<" time="<< time.t << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SIMbase::printSolutionSummary (const Vector& solution, int printSol,
|
void SIMbase::printSolutionSummary (const Vector& solution, int printSol,
|
||||||
const char* compName,
|
const char* compName,
|
||||||
std::streamsize outPrec)
|
std::streamsize outPrec)
|
||||||
|
@ -385,6 +385,15 @@ public:
|
|||||||
//! \param eNorm Matrix with element norms
|
//! \param eNorm Matrix with element norms
|
||||||
virtual bool postProcessNorms(Vectors& gNorm, Matrix* eNorm) { return true; }
|
virtual bool postProcessNorms(Vectors& gNorm, Matrix* eNorm) { return true; }
|
||||||
|
|
||||||
|
//! \brief Prints out load/time step identification.
|
||||||
|
//! \param[in] istep Load- or time step counter
|
||||||
|
//! \param[in] time Parameters for nonlinear/time-dependent simulations
|
||||||
|
//!
|
||||||
|
//! \details This method is used by multi-step simulators to print out
|
||||||
|
//! a heading when starting a new load/time increment. Override this method
|
||||||
|
//! if your simulator have some additional data to be printed.
|
||||||
|
virtual void printStep(int istep, const TimeDomain& time) const;
|
||||||
|
|
||||||
//! \brief Prints a summary of the calculated solution to std::cout.
|
//! \brief Prints a summary of the calculated solution to std::cout.
|
||||||
//! \param[in] solution The solution vector
|
//! \param[in] solution The solution vector
|
||||||
//! \param[in] printSol Print solution only if size is less than this value
|
//! \param[in] printSol Print solution only if size is less than this value
|
||||||
|
Loading…
Reference in New Issue
Block a user