13#include <pybind11/pybind11.h>
31template <
typename BHEType>
36 std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices,
43 const auto g_idx_T_out =
54 bc_values.
ids.resize(1);
55 bc_values.
values.resize(1);
58 const std::size_t n_bc_nodes = std::get<3>(data_exchange).size();
68 for (std::size_t i = 0; i < n_bc_nodes; i++)
72 auto const dataframe_node_id = std::get<3>(data_exchange);
73 auto const dataframe_Tin_val = std::get<1>(data_exchange);
74 auto const dataframe_BHE_flowrate = std::get<4>(data_exchange);
75 if (dataframe_node_id[i] == boundary_node_id)
77 bc_values.
values[0] = dataframe_Tin_val[i];
78 _bhe.updateHeatTransferCoefficients(dataframe_BHE_flowrate[i]);
93template <
typename BHEType>
94std::unique_ptr<BHEInflowPythonBoundaryCondition<BHEType>>
96 std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices,
101 DBUG(
"Constructing BHEInflowPythonBoundaryCondition.");
108 if (in_out_global_indices.first < 0 && in_out_global_indices.second < 0)
114 if (in_out_global_indices.first < 0 || in_out_global_indices.second < 0)
117 "The partition cuts the BHE into two independent parts. This "
118 "behaviour is not implemented.");
121 return std::make_unique<BHEInflowPythonBoundaryCondition<BHEType>>(
122 std::move(in_out_global_indices), bhe, py_bc_object);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Global vector based on Eigen vector.
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > dataframe_network
A boundary condition whose values are computed by a Python script.
BHEInflowPythonBoundaryCondition(std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices, BHEType &bhe, BHEInflowPythonBoundaryConditionPythonSideInterface &py_bc_object)
BHEInflowPythonBoundaryConditionPythonSideInterface & _py_bc_object
void getEssentialBCValues(const double t, const GlobalVector &, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
Writes the values of essential BCs to bc_values.
std::pair< GlobalIndexType, GlobalIndexType > const _in_out_global_indices
std::unique_ptr< BHEInflowPythonBoundaryCondition< BHEType > > createBHEInflowPythonBoundaryCondition(std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices, BHEType &bhe, BHEInflowPythonBoundaryConditionPythonSideInterface &py_bc_object)
std::vector< IndexType > ids
std::vector< double > values