Skip to content
Snippets Groups Projects
Commit 313ef3f1 authored by Boris Martin's avatar Boris Martin
Browse files

Made assembly separate

parent 0c83f960
No related branches found
No related tags found
2 merge requests!43Multi source configuration,!42Made assembly separate
Pipeline #10815 failed
......@@ -344,7 +344,7 @@ namespace gmshddm
}
template< class T_Scalar >
gmshfem::common::Timer Formulation< T_Scalar >::pre()
gmshfem::common::Timer Formulation< T_Scalar >::pre(bool mustAssemble)
{
const int outerVerbosity = gmshfem::common::Options::instance()->verbose;
const int innerVerbosity = (outerVerbosity != 0 ? outerVerbosity - 1 : 0);
......@@ -798,8 +798,52 @@ namespace gmshddm
_infoNumberOfDofs();
if(mustAssemble) {
s_printResources("DDM pre-processing before volume assembly");
assemble();
}
time.tock();
if(MPI_Rank == 0) {
gmshfem::msg::info << "Done pre-processing in " << time << "s" << gmshfem::msg::endl;
}
return time;
}
template< class T_Scalar >
gmshfem::common::Timer Formulation< T_Scalar >::assemble()
{
gmshfem::common::Timer time;
time.tick();
const int outerVerbosity = gmshfem::common::Options::instance()->verbose;
const int innerVerbosity = (outerVerbosity != 0 ? outerVerbosity - 1 : 0);
_physicalCommutator = true;
_artificialCommutator = false;
togglePhysicalAndArtificialSourceTerms();
// Clear volume
for(auto idom = 0ULL; idom < _volume.size(); ++idom) {
if(mpi::isItMySubdomain(idom)) {
// Clear formulation
_volume[idom]->setSystemToZero();
}
}
for(auto idom = 0ULL; idom < _surface.size(); ++idom) {
if(mpi::isItMySubdomain(idom)) {
for(auto it = _surface[idom].begin(); it != _surface[idom].end(); ++it) {
gmshfem::msg::info << " - Clearing " << it->second->name() << gmshfem::msg::endl;
it->second->setSystemToZero();
}
}
}
// Assemble locally on each processor
_assembleAllVolume();
......@@ -823,9 +867,10 @@ namespace gmshddm
s_printResources("DDM pre-processing end");
time.tock();
if(MPI_Rank == 0) {
gmshfem::msg::info << "Done pre-processing in " << time << "s" << gmshfem::msg::endl;
gmshfem::msg::info << "Done assembling in " << time << "s" << gmshfem::msg::endl;
}
return time;
......
......@@ -90,7 +90,8 @@ namespace gmshddm
gmshfem::problem::Formulation< T_Scalar > &operator()(unsigned int i);
gmshfem::problem::Formulation< T_Scalar > &operator()(unsigned int i, unsigned int j);
gmshfem::common::Timer pre();
gmshfem::common::Timer pre(bool mustAssemble = true);
gmshfem::common::Timer assemble();
gmshfem::common::Timer solve(const std::string &solver, const double tolerance = 1e-6, const int iterMax = 1000, const bool sameMatrixWithArtificialAndPhysicalSources = false, const bool skipFinalSolutionComputation = false);
gmshfem::common::Timer solve(AbstractIterativeSolver<T_Scalar> &solver, const double tolerance = 1e-6, const int iterMax = 1000, const bool sameMatrixWithArtificialAndPhysicalSources = false, const bool skipFinalSolutionComputation = false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment