13 #include <pybind11/pybind11.h>
32 template <
typename BHEType>
37 std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices,
44 const auto g_idx_T_out =
55 bc_values.
ids.resize(1);
56 bc_values.
values.resize(1);
59 const std::size_t n_bc_nodes = std::get<3>(data_exchange).size();
69 for (std::size_t i = 0; i < n_bc_nodes; i++)
73 auto const dataframe_node_id = std::get<3>(data_exchange);
74 auto const dataframe_Tin_val = std::get<1>(data_exchange);
75 auto const dataframe_BHE_flowrate = std::get<4>(data_exchange);
76 if (dataframe_node_id[i] == boundary_node_id)
78 bc_values.
values[0] = dataframe_Tin_val[i];
79 _bhe.updateHeatTransferCoefficients(dataframe_BHE_flowrate[i]);
94 template <
typename BHEType>
95 std::unique_ptr<BHEInflowPythonBoundaryCondition<BHEType>>
97 std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices,
102 DBUG(
"Constructing BHEInflowPythonBoundaryCondition.");
109 if (in_out_global_indices.first < 0 && in_out_global_indices.second < 0)
115 if (in_out_global_indices.first < 0 || in_out_global_indices.second < 0)
118 "The partition cuts the BHE into two independent parts. This "
119 "behaviour is not implemented.");
122 return std::make_unique<BHEInflowPythonBoundaryCondition<BHEType>>(
123 std::move(in_out_global_indices), bhe, py_bc_object);
void DBUG(char const *fmt, Args const &... 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