OGS
VectorMatrixAssembler.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <vector>
14 #include "NumLib/NumericsConfig.h"
17 
18 namespace NumLib
19 {
20 class LocalToGlobalIndexMap;
21 } // NumLib
22 
23 namespace ProcessLib
24 {
25 struct CoupledSolutionsForStaggeredScheme;
26 
27 class LocalAssemblerInterface;
28 
34 {
35 public:
36  explicit VectorMatrixAssembler(
37  std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler);
38 
39  void preAssemble(const std::size_t mesh_item_id,
40  LocalAssemblerInterface& local_assembler,
41  const NumLib::LocalToGlobalIndexMap& dof_table,
42  const double t, double const dt, const GlobalVector& x);
43 
46  void assemble(std::size_t const mesh_item_id,
47  LocalAssemblerInterface& local_assembler,
48  std::vector<std::reference_wrapper<
49  NumLib::LocalToGlobalIndexMap>> const& dof_tables,
50  double const t, double const dt,
51  std::vector<GlobalVector*> const& x,
52  std::vector<GlobalVector*> const& xdot, int const process_id,
54 
58  std::size_t const mesh_item_id,
59  LocalAssemblerInterface& local_assembler,
60  std::vector<
61  std::reference_wrapper<NumLib::LocalToGlobalIndexMap>> const&
62  dof_tables,
63  const double t, double const dt, std::vector<GlobalVector*> const& x,
64  std::vector<GlobalVector*> const& xdot, const double dxdot_dx,
65  const double dx_dx, int const process_id, GlobalMatrix& M,
67 
68 private:
69  // temporary data only stored here in order to avoid frequent memory
70  // reallocations.
71  std::vector<double> _local_M_data;
72  std::vector<double> _local_K_data;
73  std::vector<double> _local_b_data;
74  std::vector<double> _local_Jac_data;
75 
77  std::unique_ptr<AbstractJacobianAssembler> _jacobian_assembler;
78 };
79 
80 } // namespace ProcessLib
Global vector based on Eigen vector.
Definition: EigenVector.h:26
std::unique_ptr< AbstractJacobianAssembler > _jacobian_assembler
Used to assemble the Jacobian.
VectorMatrixAssembler(std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler)
void preAssemble(const std::size_t mesh_item_id, LocalAssemblerInterface &local_assembler, const NumLib::LocalToGlobalIndexMap &dof_table, const double t, double const dt, const GlobalVector &x)
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)