OGS
ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion Class Referencefinal

Detailed Description

Definition at line 23 of file SteadyStateDiffusion.h.

#include <SteadyStateDiffusion.h>

Inheritance diagram for ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion:
[legend]
Collaboration diagram for ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion:
[legend]

Public Member Functions

 SteadyStateDiffusion (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, SteadyStateDiffusionData &&process_data, SecondaryVariableCollection &&secondary_variables, std::unique_ptr< ProcessLib::SurfaceFluxData > &&surfaceflux)
 
Eigen::Vector3d getFlux (std::size_t element_id, MathLib::Point3d const &p, double const t, std::vector< GlobalVector * > const &x) const override
 
void postTimestepConcreteProcess (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &, const double t, const double, int const process_id) override
 
ODESystem interface
bool isLinear () const override
 
- Public Member Functions inherited from ProcessLib::Process
 Process (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, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
 
void preTimestep (std::vector< GlobalVector * > const &x, const double t, const double delta_t, const int process_id)
 Preprocessing before starting assembly for new timestep.
 
void postTimestep (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, const double delta_t, int const process_id)
 Postprocessing after a complete timestep.
 
void postNonLinearSolver (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, double const dt, int const process_id)
 
void preIteration (const unsigned iter, GlobalVector const &x) final
 
void computeSecondaryVariable (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
 compute secondary variables for the coupled equations or for output.
 
NumLib::IterationResult postIteration (GlobalVector const &x) final
 
void initialize (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
void setInitialConditions (std::vector< GlobalVector * > &process_solutions, std::vector< GlobalVector * > const &process_solutions_prev, double const t, int const process_id)
 
MathLib::MatrixSpecifications getMatrixSpecifications (const int process_id) const override
 
void updateDeactivatedSubdomains (double const time, const int process_id)
 
virtual bool isMonolithicSchemeUsed () const
 
virtual void extrapolateIntegrationPointValuesToNodes (const double, std::vector< GlobalVector * > const &, std::vector< GlobalVector * > &)
 
void preAssemble (const double t, double const dt, GlobalVector const &x) final
 
void assemble (const double 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) final
 
void assembleWithJacobian (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) final
 
void preOutput (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id)
 
std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * getKnownSolutions (double const t, GlobalVector const &x, int const process_id) const final
 
virtual NumLib::LocalToGlobalIndexMap const & getDOFTable (const int) const
 
MeshLib::MeshgetMesh () const
 
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > const & getProcessVariables () const
 
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables (const int process_id) const
 
std::vector< std::size_t > const & getActiveElementIDs () const
 
SecondaryVariableCollection const & getSecondaryVariables () const
 
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const & getIntegrationPointWriters () const
 
virtual void solveReactionEquation (std::vector< GlobalVector * > &, std::vector< GlobalVector * > const &, double const, double const, NumLib::EquationSystem &, int const)
 
bool requiresNormalization () const override
 
- Public Member Functions inherited from ProcessLib::SubmeshAssemblySupport
virtual std::vector< std::vector< std::string > > initializeAssemblyOnSubmeshes (std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes)
 
virtual ~SubmeshAssemblySupport ()=default
 

Private Member Functions

void initializeConcreteProcess (NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
 Process specific initialization called by initialize().
 
void assembleConcreteProcess (const double 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) override
 
void assembleWithJacobianConcreteProcess (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) override
 

Private Attributes

SteadyStateDiffusionData _process_data
 
std::vector< std::unique_ptr< SteadyStateDiffusionLocalAssemblerInterface > > _local_assemblers
 
std::unique_ptr< ProcessLib::SurfaceFluxData_surfaceflux
 

Additional Inherited Members

- Public Attributes inherited from ProcessLib::Process
std::string const name
 
- Static Public Attributes inherited from ProcessLib::Process
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name = "constant_one"
 
- Protected Member Functions inherited from ProcessLib::Process
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables (int const number_of_processes) const
 
NumLib::ExtrapolatorgetExtrapolator () const
 
NumLib::LocalToGlobalIndexMap const & getSingleComponentDOFTable () const
 
void initializeProcessBoundaryConditionsAndSourceTerms (const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
virtual void constructDofTable ()
 
void constructMonolithicProcessDofTable ()
 
void constructDofTableOfSpecifiedProcessStaggeredScheme (const int specified_process_id)
 
virtual std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData () const
 
std::vector< GlobalIndexTypegetIndicesOfResiduumWithoutInitialCompensation () const override
 
- Protected Attributes inherited from ProcessLib::Process
MeshLib::Mesh_mesh
 
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_local_to_global_index_map
 
SecondaryVariableCollection _secondary_variables
 
CellAverageData cell_average_data_
 
std::unique_ptr< ProcessLib::AbstractJacobianAssembler_jacobian_assembler
 
VectorMatrixAssembler _global_assembler
 
const bool _use_monolithic_scheme
 
unsigned const _integration_order
 
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
 
GlobalSparsityPattern _sparsity_pattern
 
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > _process_variables
 
std::vector< BoundaryConditionCollection_boundary_conditions
 

Constructor & Destructor Documentation

◆ SteadyStateDiffusion()

ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::SteadyStateDiffusion ( 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,
SteadyStateDiffusionData && process_data,
SecondaryVariableCollection && secondary_variables,
std::unique_ptr< ProcessLib::SurfaceFluxData > && surfaceflux )

Definition at line 21 of file SteadyStateDiffusion.cpp.

32 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
33 integration_order, std::move(process_variables),
34 std::move(secondary_variables)),
35 _process_data(std::move(process_data)),
36 _surfaceflux(std::move(surfaceflux))
37{
38}
std::string const name
Definition Process.h:362
Process(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, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
Definition Process.cpp:44
std::unique_ptr< ProcessLib::SurfaceFluxData > _surfaceflux

Member Function Documentation

◆ assembleConcreteProcess()

void ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleConcreteProcess ( const double 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 )
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 58 of file SteadyStateDiffusion.cpp.

62{
63 DBUG("Assemble SteadyStateDiffusion.");
64
65 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
67 // Call global assembler for each local assembly item.
70 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
71 &b);
72}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::vector< std::size_t > const & getActiveElementIDs() const
Definition Process.h:167
VectorMatrixAssembler _global_assembler
Definition Process.h:377
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition Process.h:368
std::vector< std::unique_ptr< SteadyStateDiffusionLocalAssemblerInterface > > _local_assemblers
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)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References ProcessLib::Process::_global_assembler, _local_assemblers, ProcessLib::Process::_local_to_global_index_map, ProcessLib::VectorMatrixAssembler::assemble(), DBUG(), NumLib::SerialExecutor::executeSelectedMemberDereferenced(), and ProcessLib::Process::getActiveElementIDs().

◆ assembleWithJacobianConcreteProcess()

void ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleWithJacobianConcreteProcess ( const double t,
double const dt,
std::vector< GlobalVector * > const & x,
std::vector< GlobalVector * > const & x_prev,
int const process_id,
GlobalVector & b,
GlobalMatrix & Jac )
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 74 of file SteadyStateDiffusion.cpp.

78{
79 DBUG("AssembleWithJacobian SteadyStateDiffusion.");
80
81 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
83 // Call global assembler for each local assembly item.
86 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
87 process_id, &b, &Jac);
88}
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector *b, GlobalMatrix *Jac)

References ProcessLib::Process::_global_assembler, _local_assemblers, ProcessLib::Process::_local_to_global_index_map, ProcessLib::VectorMatrixAssembler::assembleWithJacobian(), DBUG(), NumLib::SerialExecutor::executeSelectedMemberDereferenced(), and ProcessLib::Process::getActiveElementIDs().

◆ getFlux()

Eigen::Vector3d ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::getFlux ( std::size_t element_id,
MathLib::Point3d const & p,
double const t,
std::vector< GlobalVector * > const & x ) const
inlineoverridevirtual

Reimplemented from ProcessLib::Process.

Definition at line 46 of file SteadyStateDiffusion.h.

50 {
51 // fetch local_x from primary variable
52 std::vector<GlobalIndexType> indices_cache;
53 auto const r_c_indices = NumLib::getRowColumnIndices(
54 element_id, *_local_to_global_index_map, indices_cache);
55 constexpr int process_id = 0; // monolithic scheme.
56 std::vector<double> local_x(x[process_id]->get(r_c_indices.rows));
57
58 return _local_assemblers[element_id]->getFlux(p, t, local_x);
59 }
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices(std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< GlobalIndexType > &indices)
auto & get(Tuples &... ts)
Definition Get.h:59

References _local_assemblers, ProcessLib::Process::_local_to_global_index_map, and NumLib::getRowColumnIndices().

◆ initializeConcreteProcess()

void ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess ( NumLib::LocalToGlobalIndexMap const & dof_table,
MeshLib::Mesh const & mesh,
unsigned const integration_order )
overrideprivatevirtual

Process specific initialization called by initialize().

Implements ProcessLib::Process.

Definition at line 40 of file SteadyStateDiffusion.cpp.

44{
46 mesh.getDimension(), mesh.getElements(), dof_table, _local_assemblers,
47 NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
49
51 "darcy_velocity",
52 makeExtrapolator(mesh.getDimension(), getExtrapolator(),
54 &SteadyStateDiffusionLocalAssemblerInterface::
55 getIntPtDarcyVelocity));
56}
SecondaryVariableCollection _secondary_variables
Definition Process.h:370
NumLib::Extrapolator & getExtrapolator() const
Definition Process.h:208
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
void createLocalAssemblers(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, ProviderOrOrder const &provider_or_order, ExtraCtorArgs &&... extra_ctor_args)
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)

References _local_assemblers, _process_data, ProcessLib::Process::_secondary_variables, ProcessLib::SecondaryVariableCollection::addSecondaryVariable(), ProcessLib::createLocalAssemblers(), MeshLib::Mesh::getDimension(), MeshLib::Mesh::getElements(), ProcessLib::Process::getExtrapolator(), MeshLib::Mesh::isAxiallySymmetric(), and ProcessLib::makeExtrapolator().

◆ isLinear()

bool ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::isLinear ( ) const
inlineoverride

Definition at line 43 of file SteadyStateDiffusion.h.

43{ return true; }

◆ postTimestepConcreteProcess()

void ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::postTimestepConcreteProcess ( std::vector< GlobalVector * > const & x,
std::vector< GlobalVector * > const & ,
const double t,
const double ,
int const process_id )
inlineoverridevirtual

Reimplemented from ProcessLib::Process.

Definition at line 61 of file SteadyStateDiffusion.h.

67 {
68 // For this single process, process_id is always zero.
69 if (process_id != 0)
70 {
72 "The condition of process_id = 0 must be satisfied for "
73 "SteadyStateDiffusion, which is a single process.");
74 }
75 if (!_surfaceflux) // computing the surfaceflux is optional
76 {
77 return;
78 }
79
80 _surfaceflux->integrate(x, t, *this, process_id, _integration_order,
82 }
#define OGS_FATAL(...)
Definition Error.h:26
MeshLib::Mesh & _mesh
Definition Process.h:365
unsigned const _integration_order
Definition Process.h:384

References ProcessLib::Process::_integration_order, ProcessLib::Process::_mesh, _surfaceflux, ProcessLib::Process::getActiveElementIDs(), and OGS_FATAL.

Member Data Documentation

◆ _local_assemblers

std::vector<std::unique_ptr<SteadyStateDiffusionLocalAssemblerInterface> > ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::_local_assemblers
private

◆ _process_data

SteadyStateDiffusionData ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::_process_data
private

Definition at line 101 of file SteadyStateDiffusion.h.

Referenced by initializeConcreteProcess().

◆ _surfaceflux

std::unique_ptr<ProcessLib::SurfaceFluxData> ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::_surfaceflux
private

Definition at line 106 of file SteadyStateDiffusion.h.

Referenced by postTimestepConcreteProcess().


The documentation for this class was generated from the following files: