OGS
RichardsComponentTransportProcess.cpp
Go to the documentation of this file.
1 
12 
13 #include <cassert>
14 
16 
17 namespace ProcessLib
18 {
19 namespace RichardsComponentTransport
20 {
22  std::string name,
23  MeshLib::Mesh& mesh,
24  std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
25  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
26  unsigned const integration_order,
27  std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
28  process_variables,
30  SecondaryVariableCollection&& secondary_variables,
31  bool const use_monolithic_scheme)
32  : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
33  integration_order, std::move(process_variables),
34  std::move(secondary_variables), use_monolithic_scheme),
35  _process_data(std::move(process_data))
36 {
37 }
38 
40  NumLib::LocalToGlobalIndexMap const& dof_table,
41  MeshLib::Mesh const& mesh,
42  unsigned const integration_order)
43 {
44  const int monolithic_process_id = 0;
45  ProcessLib::ProcessVariable const& pv =
46  getProcessVariables(monolithic_process_id)[0];
47 
48  ProcessLib::createLocalAssemblers<LocalAssemblerData>(
49  mesh.getDimension(), mesh.getElements(), dof_table, _local_assemblers,
50  NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
51  _process_data, pv);
52 
54  "darcy_velocity",
58  getIntPtDarcyVelocity));
59 
61  "saturation",
64  getIntPtSaturation));
65 }
66 
68  const double t, double const dt, std::vector<GlobalVector*> const& x,
69  std::vector<GlobalVector*> const& xdot, int const process_id,
71 {
72  DBUG("Assemble RichardsComponentTransportProcess.");
73 
74  std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
75  dof_table = {std::ref(*_local_to_global_index_map)};
76  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
77 
78  // Call global assembler for each local assembly item.
81  pv.getActiveElementIDs(), dof_table, t, dt, x, xdot, process_id, M, K,
82  b);
83 }
84 
86  const double t, double const dt, std::vector<GlobalVector*> const& x,
87  std::vector<GlobalVector*> const& xdot, int const process_id,
89 {
90  DBUG("AssembleWithJacobian RichardsComponentTransportProcess.");
91 
92  std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
93  dof_table = {std::ref(*_local_to_global_index_map)};
94  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
95 
96  // Call global assembler for each local assembly item.
99  _local_assemblers, pv.getActiveElementIDs(), dof_table, t, dt, x, xdot,
100  process_id, M, K, b, Jac);
101 }
102 
103 } // namespace RichardsComponentTransport
104 } // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:29
Global vector based on Eigen vector.
Definition: EigenVector.h:28
bool isAxiallySymmetric() const
Definition: Mesh.h:131
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:76
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition: Mesh.h:103
std::vector< std::size_t > const & getActiveElementIDs() const
NumLib::Extrapolator & getExtrapolator() const
Definition: Process.h:184
SecondaryVariableCollection _secondary_variables
Definition: Process.h:335
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition: Process.h:148
VectorMatrixAssembler _global_assembler
Definition: Process.h:337
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition: Process.h:333
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
std::vector< std::unique_ptr< RichardsComponentTransportLocalAssemblerInterface > > _local_assemblers
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac) override
RichardsComponentTransportProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, RichardsComponentTransportProcessData &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
Handles configuration of several secondary variables from the project file.
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
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, 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)
static const double t
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)