OGS
PythonSourceTerm.h
Go to the documentation of this file.
1
11#pragma once
12
16#include "Utils/BcOrStData.h"
17
18namespace ProcessLib
19{
20class ProcessVariable;
21
22namespace SourceTerms::Python
23{
24struct PythonStData final
26 PythonSourceTermPythonSideInterface>
27{
33 getFlagAndFluxAndDFlux(double const t, std::array<double, 3> const coords,
34 std::vector<double> const& prim_vars_data) const
35 {
36 auto [flux, dFlux] =
37 bc_or_st_object->getFlux(t, coords, prim_vars_data);
38
39 return {true, flux, std::move(dFlux)};
40 }
41};
42
45{
46public:
47 explicit PythonSourceTerm(
48 std::unique_ptr<NumLib::LocalToGlobalIndexMap> source_term_dof_table,
49 PythonStData&& source_term_data, unsigned const integration_order,
50 unsigned const global_dim, bool const flush_stdout);
51
52 void integrate(const double t, GlobalVector const& x, GlobalVector& b,
53 GlobalMatrix* jac) const override;
54
55private:
58
60 std::vector<std::unique_ptr<PythonSourceTermLocalAssemblerInterface>>
62
66 bool const _flush_stdout;
67};
68
69} // namespace SourceTerms::Python
70} // namespace ProcessLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
A source term whose values are computed by a Python script.
PythonSourceTerm(std::unique_ptr< NumLib::LocalToGlobalIndexMap > source_term_dof_table, PythonStData &&source_term_data, unsigned const integration_order, unsigned const global_dim, bool const flush_stdout)
std::vector< std::unique_ptr< PythonSourceTermLocalAssemblerInterface > > _local_assemblers
Local assemblers for all elements of the source term mesh.
void integrate(const double t, GlobalVector const &x, GlobalVector &b, GlobalMatrix *jac) const override
PythonStData _source_term_data
Auxiliary data used by the local assemblers.
ProcessLib::BoundaryConditionAndSourceTerm::Python::FlagAndFluxAndDFlux getFlagAndFluxAndDFlux(double const t, std::array< double, 3 > const coords, std::vector< double > const &prim_vars_data) const