30 bool const use_monolithic_scheme);
32 template <
typename VectorOfLocalAssemblers>
34 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
35 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
37 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
39 VectorOfLocalAssemblers
const& local_assemblers,
40 std::vector<std::size_t>
const& active_element_ids);
47 std::unique_ptr<GlobalMatrix>
M_{};
48 std::unique_ptr<GlobalMatrix>
K_{};
49 std::unique_ptr<GlobalVector>
b_{};
52template <
typename VectorOfLocalAssemblers>
54 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
55 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
57 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
59 VectorOfLocalAssemblers
const& local_assemblers,
60 std::vector<std::size_t>
const& active_element_ids)
62 if (
bool const cache_empty =
K_ ==
nullptr; cache_empty)
70 local_assemblers, active_element_ids, dof_tables, t, dt, x, x_prev,
77 INFO(
"[time] Calling local assemblers took {:g} s", time_asm.
elapsed());
81 DBUG(
"Saving global K, M, b for later reuse.");
90 INFO(
"[time] Saving global K, M, b took {:g} s",
96 DBUG(
"Reusing saved global K, M, b.");
105 INFO(
"[time] Restoring global K, M, b took {:g} s",
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the RunTime class.
double elapsed() const
Get the elapsed time in seconds.
void start()
Start the timer.
Global vector based on Eigen vector.
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_
void assemble(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix *const M, GlobalMatrix *const K, GlobalVector *const b, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, VectorMatrixAssembler &global_assembler, VectorOfLocalAssemblers const &local_assemblers, std::vector< std::size_t > const &active_element_ids)
AssembledMatrixCache(bool const is_linear, bool const use_monolithic_scheme)
std::unique_ptr< GlobalMatrix > K_
std::unique_ptr< GlobalVector > b_