Skip to content
Snippets Groups Projects
Commit efa2e10e authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Stop assembly time

parent 870f6e7e
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
#include <dune/common/parametertreeparser.hh>
#include <dune/common/shared_ptr.hh>
#include <dune/common/stdstreams.hh>
#include <dune/common/timer.hh>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/istl/bcrsmatrix.hh>
......@@ -177,6 +178,8 @@ int main(int argc, char *argv[]) {
parset); // FIXME
Dune::ParameterTreeParser::readOptions(argc, argv, parset);
Dune::Timer timer;
typedef Dune::FieldVector<double, dim> SmallVector;
typedef Dune::FieldMatrix<double, dim, dim> SmallMatrix;
typedef Dune::BCRSMatrix<SmallMatrix> OperatorType;
......@@ -219,8 +222,11 @@ int main(int argc, char *argv[]) {
P1Basis::LocalFiniteElement> const
localStiffness(E, nu);
OperatorType stiffnessMatrix;
timer.reset();
OperatorAssembler<P1Basis, P1Basis>(p1Basis, p1Basis)
.assemble(localStiffness, stiffnessMatrix);
std::cout << "Assembled stiffness matrix in " << timer.elapsed() << "s"
<< std::endl;
EnergyNorm<OperatorType, VectorType> energyNorm(stiffnessMatrix);
// Set up the boundary
......@@ -304,7 +310,9 @@ int main(int argc, char *argv[]) {
multigridStep.ignoreNodes_ = &ignoreNodes;
// }}}
for (size_t run = 1; run <= parset.get<size_t>("timesteps"); ++run) {
timer.reset();
auto const timesteps = parset.get<size_t>("timesteps");
for (size_t run = 1; run <= timesteps; ++run) {
if (parset.get<bool>("printProgress")) {
std::cout << ".";
std::cout.flush();
......@@ -407,6 +415,8 @@ int main(int argc, char *argv[]) {
u3 += u3_diff;
}
std::cout << std::endl;
std::cout << "Making " << timesteps << " time steps took "
<< timer.elapsed() << "s" << std::endl;
// Clean up after the TNNMG solver
for (auto &x : transferOperators)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment