OGS
TwoPhaseFlowWithPrhoProcess.cpp
Go to the documentation of this file.
1
12
15
16namespace ProcessLib
17{
18namespace TwoPhaseFlowWithPrho
19{
21 std::string name,
22 MeshLib::Mesh& mesh,
23 std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
24 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
25 unsigned const integration_order,
26 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
27 process_variables,
29 SecondaryVariableCollection&& secondary_variables,
30 BaseLib::ConfigTree const& /*config*/,
31 std::map<std::string,
32 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
33 /*curves*/)
34 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
35 integration_order, std::move(process_variables),
36 std::move(secondary_variables)),
37 _process_data(std::move(process_data))
38{
39 DBUG("Create TwoPhaseFlowProcess with Prho model.");
40}
41
43 NumLib::LocalToGlobalIndexMap const& dof_table,
44 MeshLib::Mesh const& mesh,
45 unsigned const integration_order)
46{
47 ProcessLib::createLocalAssemblers<TwoPhaseFlowWithPrhoLocalAssembler>(
48 mesh.getDimension(), mesh.getElements(), dof_table, _local_assemblers,
49 mesh.isAxiallySymmetric(), integration_order, _process_data);
50
52 "saturation",
56
58 "pressure_nonwetting",
61 getIntPtNonWettingPressure));
62}
63
65 const double t, double const dt, std::vector<GlobalVector*> const& x,
66 std::vector<GlobalVector*> const& xdot, int const process_id,
68{
69 DBUG("Assemble TwoPhaseFlowWithPrhoProcess.");
70
71 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
72 dof_table = {std::ref(*_local_to_global_index_map)};
73 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
74
75 // Call global assembler for each local assembly item.
78 pv.getActiveElementIDs(), dof_table, t, dt, x, xdot, process_id, M, K,
79 b);
80}
81
83 const double t, double const dt, std::vector<GlobalVector*> const& x,
84 std::vector<GlobalVector*> const& xdot, int const process_id,
86{
87 DBUG("AssembleWithJacobian TwoPhaseFlowWithPrhoProcess.");
88
89 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
90 dof_table = {std::ref(*_local_to_global_index_map)};
91 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
92
93 // Call global assembler for each local assembly item.
96 _local_assemblers, pv.getActiveElementIDs(), dof_table, t, dt, x, xdot,
97 process_id, M, K, b, Jac);
98}
100 std::vector<GlobalVector*> const& x, double const t, double const dt,
101 const int process_id)
102{
103 DBUG("PreTimestep TwoPhaseFlowWithPrhoProcess.");
104
105 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
106
109 pv.getActiveElementIDs(), *_local_to_global_index_map, *x[process_id],
110 t, dt);
111}
112
113} // namespace TwoPhaseFlowWithPrho
114} // namespace ProcessLib
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:29
Global vector based on Eigen vector.
Definition: EigenVector.h:28
bool isAxiallySymmetric() const
Definition: Mesh.h:131
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition: Mesh.h:103
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:76
virtual void preTimestep(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
std::vector< std::size_t > const & getActiveElementIDs() const
SecondaryVariableCollection _secondary_variables
Definition: Process.h:333
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition: Process.h:146
VectorMatrixAssembler _global_assembler
Definition: Process.h:335
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition: Process.h:331
NumLib::Extrapolator & getExtrapolator() const
Definition: Process.h:182
Handles configuration of several secondary variables from the project file.
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
virtual std::vector< double > const & getIntPtSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
TwoPhaseFlowWithPrhoProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< 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, TwoPhaseFlowWithPrhoProcessData &&process_data, SecondaryVariableCollection &&secondary_variables, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
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
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 preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, const double t, const double dt, const int process_id) override
std::vector< std::unique_ptr< TwoPhaseFlowWithPrhoLocalAssemblerInterface > > _local_assemblers
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)
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)
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 executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)