Hi all,
what is the best way to export a time-dependant solution (in the cpp interface) using the XDMFFile class?. Actually i'm exporting the solution using the next lines:
... previous declarations ...
XDMFFile sol(mesh.mpi_comm(), "xdmf/sol.xdmf");
// Start time stepping
while (t < T)
{
// Update for next time step
t += dt;
std::cout << "Time: " << t << std::endl;
// Solve problem 1
Solver1.solve();
// Save solutions to file
const std::pair<const Function*, double> ut(&u, t);
sol << ut;
}
where u
is the solution (Function
) in each time-step and t
(double
) the current time.
it's possible doing the same but without to create an std::pair
object in each time-step?. If the answer is positive, how can i do it?
Thanks in advance!