OGS
ProcessLib::SourceTermCollection Class Referencefinal

Detailed Description

Definition at line 18 of file SourceTermCollection.h.

#include <SourceTermCollection.h>

Public Member Functions

 SourceTermCollection (std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
 
void integrate (const double t, GlobalVector const &x, GlobalVector &b, GlobalMatrix *jac) const
 
void addSourceTermsForProcessVariables (std::vector< std::reference_wrapper< ProcessVariable > > const &process_variables, NumLib::LocalToGlobalIndexMap const &dof_table, unsigned const integration_order)
 

Private Attributes

std::vector< std::unique_ptr< SourceTerm > > _source_terms
 
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & _parameters
 

Constructor & Destructor Documentation

◆ SourceTermCollection()

ProcessLib::SourceTermCollection::SourceTermCollection ( std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters)
inlineexplicit

Definition at line 21 of file SourceTermCollection.h.

24 : _parameters(parameters)
25 {
26 }
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & _parameters

Member Function Documentation

◆ addSourceTermsForProcessVariables()

void ProcessLib::SourceTermCollection::addSourceTermsForProcessVariables ( std::vector< std::reference_wrapper< ProcessVariable > > const & process_variables,
NumLib::LocalToGlobalIndexMap const & dof_table,
unsigned const integration_order )

Definition at line 17 of file SourceTermCollection.cpp.

22{
23 for (int variable_id = 0;
24 variable_id < static_cast<int>(process_variables.size());
25 ++variable_id)
26 {
27 ProcessVariable& pv = process_variables[variable_id];
28 auto sts =
29 pv.createSourceTerms(dof_table, variable_id, integration_order,
30 _parameters, process_variables);
31
32 std::move(sts.begin(), sts.end(), std::back_inserter(_source_terms));
33 }
34}
std::vector< std::unique_ptr< SourceTerm > > _source_terms

References _parameters, _source_terms, and ProcessLib::ProcessVariable::createSourceTerms().

◆ integrate()

void ProcessLib::SourceTermCollection::integrate ( const double t,
GlobalVector const & x,
GlobalVector & b,
GlobalMatrix * jac ) const

Definition at line 36 of file SourceTermCollection.cpp.

38{
39 // For parallel computing with DDC, a partition may not have source term
40 // but a nullptr is assigned to its element in _source_terms.
41 auto non_nullptr = [](std::unique_ptr<SourceTerm> const& st)
42 { return st != nullptr; };
43
44 for (auto const& st : _source_terms | ranges::views::filter(non_nullptr))
45 {
46 st->integrate(t, x, b, jac);
47 }
48}
constexpr List filter(Pred, SomeListOfTypes<> *)
Definition TMP.h:49

References _source_terms.

Member Data Documentation

◆ _parameters

std::vector<std::unique_ptr<ParameterLib::ParameterBase> > const& ProcessLib::SourceTermCollection::_parameters
private

Definition at line 40 of file SourceTermCollection.h.

Referenced by addSourceTermsForProcessVariables().

◆ _source_terms

std::vector<std::unique_ptr<SourceTerm> > ProcessLib::SourceTermCollection::_source_terms
private

Definition at line 38 of file SourceTermCollection.h.

Referenced by addSourceTermsForProcessVariables(), and integrate().


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