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..d1e0ba6ded7f73c073187e707e77718079f1abdd 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,8 @@ 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, + source_term_mesh.getID()}, 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..dd9c8299a1b7ae1c4285251bf7864c1f131dc771 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; }; //! 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 d236f06a5d4ddebcf11a201705e22a62466469c1..df3032267899af90e952c91a901f20500115c51e 100644 --- a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h +++ b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h @@ -103,10 +103,6 @@ public: auto const num_comp_total = dof_table_source_term.getNumberOfComponents(); - auto const& bulk_node_ids_map = - *_data.source_term_mesh.getProperties() - .template getPropertyVector<std::size_t>("bulk_node_ids"); - // gather primary variables typename ShapeMatricesType::template MatrixType<ShapeFunction::NPOINTS, Eigen::Dynamic> @@ -123,13 +119,11 @@ 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(); - auto const bulk_node_id = - bulk_node_ids_map[boundary_node_id]; - MeshLib::Location loc{_data.bulk_mesh_id, + auto const boundary_node_id = + _element.getNode(element_node_id)->getID(); + MeshLib::Location loc{_data.source_term_mesh_id, MeshLib::MeshItemType::Node, - bulk_node_id}; + boundary_node_id}; auto const dof_idx = dof_table_source_term.getGlobalIndex(loc, var, comp); if (dof_idx == NumLib::MeshComponentMap::nop) @@ -141,7 +135,7 @@ public: "functions, which is currently not supported by " "the implementation of Python BCs. That excludes, " "e.g., the HM process.", - bulk_node_id, var, comp); + boundary_node_id, var, comp); } primary_variables_mat(element_node_id, global_component) = x[dof_idx];