61{
62 if (
bool const cache_empty =
K_ ==
nullptr; cache_empty)
63 {
64 BaseLib::RunTime time_asm;
66
67
70 local_assemblers, active_element_ids, dof_tables, t, dt, x, x_prev,
71 process_id, M, K, b);
72
76
77 INFO(
"[time] Calling local assemblers took {:g} s", time_asm.
elapsed());
78
80 {
81 DBUG(
"Saving global K, M, b for later reuse.");
82
83 BaseLib::RunTime time_save;
85
86 K_ = MathLib::MatrixVectorTraits<GlobalMatrix>::newInstance(*K);
87 M_ = MathLib::MatrixVectorTraits<GlobalMatrix>::newInstance(*M);
88 b_ = MathLib::MatrixVectorTraits<GlobalVector>::newInstance(*b);
89
90 INFO(
"[time] Saving global K, M, b took {:g} s",
92 }
93 }
94 else
95 {
96 DBUG(
"Reusing saved global K, M, b.");
97
98 BaseLib::RunTime time_restore;
100
104
105 INFO(
"[time] Restoring global K, M, b took {:g} s",
107 }
108}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
double elapsed() const
Get the elapsed time in seconds.
void start()
Start the timer.
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix *M, GlobalMatrix *K, GlobalVector *b)
void copy(PETScVector const &x, PETScVector &y)
void finalizeVectorAssembly(VEC_T &)
General function to finalize the vector assembly.
bool finalizeMatrixAssembly(MAT_T &)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
std::unique_ptr< GlobalMatrix > M_
std::unique_ptr< GlobalMatrix > K_
std::unique_ptr< GlobalVector > b_