diff --git a/ProcessLib/SourceTerms/CreateSourceTerm.cpp b/ProcessLib/SourceTerms/CreateSourceTerm.cpp index 8676c51a14a9bcb2f2f7059df656f2f47e2711bf..34c2d23246d64bd56fb6f8bd7452b944289c3ef7 100644 --- a/ProcessLib/SourceTerms/CreateSourceTerm.cpp +++ b/ProcessLib/SourceTerms/CreateSourceTerm.cpp @@ -113,9 +113,8 @@ std::unique_ptr<SourceTerm> createSourceTerm( return ProcessLib::createPythonSourceTerm( config.config, config.mesh, std::move(dof_table_source_term), - source_term_mesh.getID(), variable_id, *config.component_id, - integration_order, shapefunction_order, - source_term_mesh.getDimension()); + variable_id, *config.component_id, integration_order, + shapefunction_order, source_term_mesh.getDimension()); #else OGS_FATAL("OpenGeoSys has not been built with Python support."); #endif diff --git a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp index 08546d0b0601f55bb9e70c2efb9da8694f6ff953..602d5a8b6fa9c7fb63a97ef70dcd8ee9995cd87f 100644 --- a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp +++ b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp @@ -23,9 +23,9 @@ namespace ProcessLib std::unique_ptr<SourceTerm> createPythonSourceTerm( BaseLib::ConfigTree const& config, MeshLib::Mesh const& source_term_mesh, std::unique_ptr<NumLib::LocalToGlobalIndexMap> dof_table, - std::size_t const bulk_mesh_id, int const variable_id, - int const component_id, unsigned const integration_order, - unsigned const shapefunction_order, unsigned const global_dim) + int const variable_id, int const component_id, + unsigned const integration_order, unsigned const shapefunction_order, + unsigned const global_dim) { DBUG("Constructing PythonSourceTerm from config."); //! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__type} @@ -73,7 +73,7 @@ std::unique_ptr<SourceTerm> createPythonSourceTerm( return std::make_unique<ProcessLib::SourceTerms::Python::PythonSourceTerm>( std::move(dof_table), ProcessLib::SourceTerms::Python::PythonSourceTermData{ - source_term, bulk_mesh_id, global_component_id, source_term_mesh}, + source_term, global_component_id, source_term_mesh}, integration_order, shapefunction_order, global_dim, flush_stdout); } diff --git a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.h b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.h index a0ee05825250baaa9f4b8e015d5374b78064b5f1..5c003daa0a9fbd22b7147611798f45081cfb5e56 100644 --- a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.h +++ b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.h @@ -32,8 +32,8 @@ class SourceTerm; std::unique_ptr<SourceTerm> createPythonSourceTerm( BaseLib::ConfigTree const& config, MeshLib::Mesh const& source_term_mesh, std::unique_ptr<NumLib::LocalToGlobalIndexMap> dof_table, - std::size_t const bulk_mesh_id, int const variable_id, - int const component_id, unsigned const integration_order, - unsigned const shapefunction_order, unsigned const global_dim); + int const variable_id, int const component_id, + unsigned const integration_order, unsigned const shapefunction_order, + unsigned const global_dim); } // namespace ProcessLib diff --git a/ProcessLib/SourceTerms/Python/PythonSourceTerm.h b/ProcessLib/SourceTerms/Python/PythonSourceTerm.h index ff25d47bb029b8ea7c59037eb9405c6ca3914038..06899e6a1905a445232f99afb5321000bf4f684d 100644 --- a/ProcessLib/SourceTerms/Python/PythonSourceTerm.h +++ b/ProcessLib/SourceTerms/Python/PythonSourceTerm.h @@ -31,15 +31,15 @@ struct PythonSourceTermData final //! Python object computing source term values. PythonSourceTermPythonSideInterface* source_term_object; - //! Mesh ID of the entire domain. - std::size_t const bulk_mesh_id; - //! Global component ID of the (variable, component) to which this source //! term is applied. int const global_component_id; //! The source term mesh, i.e., the (sub-) domain of this source term. const MeshLib::Mesh& source_term_mesh; + + //! Mesh ID of the entire domain. + std::size_t const source_term_mesh_id = source_term_mesh.getID(); }; //! A source term whose values are computed by a Python script. diff --git a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h index f36e8072e0d5a4d93cb5a43204c92b160a0806dc..df3032267899af90e952c91a901f20500115c51e 100644 --- a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h +++ b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h @@ -119,9 +119,9 @@ public: for (unsigned element_node_id = 0; element_node_id < num_nodes; ++element_node_id) { - auto const* const node = _element.getNode(element_node_id); - auto const boundary_node_id = node->getID(); - MeshLib::Location loc{_data.source_term_mesh.getID(), + auto const boundary_node_id = + _element.getNode(element_node_id)->getID(); + MeshLib::Location loc{_data.source_term_mesh_id, MeshLib::MeshItemType::Node, boundary_node_id}; auto const dof_idx =