Skip to content
Snippets Groups Projects
Commit 181b4ce5 authored by Alexander Jaust's avatar Alexander Jaust
Browse files

updated main

parent 258b1d62
No related branches found
No related tags found
1 merge request!6Feature/ff pm coupling fvca cleanup (to be moved into dumux-pub/jaust2020a)
...@@ -429,6 +429,7 @@ int main(int argc, char** argv) try ...@@ -429,6 +429,7 @@ int main(int argc, char** argv) try
auto sol_checkpoint = sol; auto sol_checkpoint = sol;
double vtkTime = 1.0; double vtkTime = 1.0;
size_t iter = 0;
while ( couplingInterface.isCouplingOngoing() ) while ( couplingInterface.isCouplingOngoing() )
{ {
...@@ -485,6 +486,44 @@ int main(int argc, char** argv) try ...@@ -485,6 +486,44 @@ int main(int argc, char** argv) try
const double preciceDt = couplingInterface.advance( dt ); const double preciceDt = couplingInterface.advance( dt );
dt = std::min( preciceDt, dt ); dt = std::min( preciceDt, dt );
{
double min = std::numeric_limits<double>::max();
double max = std::numeric_limits<double>::min();
double sum = 0.;
const std::string filename = getParam<std::string>("Problem.Name") + "-" + darcyProblem->name() + "-interface-velocity-" + std::to_string(iter);
std::tie(min, max, sum) = writeVelocitiesOnInterfaceToFile<FluxVariables>( filename,
*darcyProblem,
*darcyGridVariables,
sol );
const int prec = std::cout.precision();
std::cout << "Velocity statistics:" << std::endl
<< std::setprecision(std::numeric_limits<double>::digits10 + 1)
<< " min: " << min << std::endl
<< " max: " << max << std::endl
<< " sum: " << sum << std::endl;
std::cout.precision( prec );
{
const std::string filenameFlow="darcy-statistics-" + std::to_string(iter);
std::ofstream ofs( filenameFlow+".txt", std::ofstream::out | std::ofstream::trunc);
const auto prec = ofs.precision();
ofs << "Velocity statistics (free flow):" << std::endl
<< std::setprecision(std::numeric_limits<double>::digits10 + 1)
<< " min: " << min << std::endl
<< " max: " << max << std::endl
<< " sum: " << sum << std::endl;
ofs.precision( prec );
ofs.close();
}
}
{
const std::string filename = getParam<std::string>("Problem.Name") + "-" + darcyProblem->name() + "-interface-pressure-" + std::to_string(iter);
writePressuresOnInterfaceToFile( filename,
*darcyProblem,
*darcyGridVariables,
sol );
}
++iter;
if ( couplingInterface.hasToReadIterationCheckpoint() ) if ( couplingInterface.hasToReadIterationCheckpoint() )
{ {
//Read checkpoint //Read checkpoint
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment