OGS
HeatTransportBHEProcess.cpp
Go to the documentation of this file.
1
12
13#include <cassert>
14
23
24namespace ProcessLib
25{
26namespace HeatTransportBHE
27{
29 std::string name,
30 MeshLib::Mesh& mesh,
31 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
32 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
33 unsigned const integration_order,
34 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
35 process_variables,
36 HeatTransportBHEProcessData&& process_data,
37 SecondaryVariableCollection&& secondary_variables,
38 BHEMeshData&& bhe_mesh_data)
39 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
40 integration_order, std::move(process_variables),
41 std::move(secondary_variables)),
42 _process_data(std::move(process_data)),
43 _bheMeshData(std::move(bhe_mesh_data))
44{
45 if (_bheMeshData.BHE_mat_IDs.size() !=
47 {
49 "The number of the given BHE properties ({:d}) are not consistent "
50 "with the number of BHE groups in the mesh ({:d}).",
53 }
54
55 auto material_ids = MeshLib::materialIDs(mesh);
56 if (material_ids == nullptr)
57 {
58 OGS_FATAL("Not able to get material IDs! ");
59 }
60
62
63 // create a map from a material ID to a BHE ID
64 for (int i = 0; i < static_cast<int>(_bheMeshData.BHE_mat_IDs.size()); i++)
65 {
66 // fill in the map structure
68 i;
69 }
70}
71
73{
74 // Create single component dof in every of the mesh's nodes.
76 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
77
78 //
79 // Soil temperature variable defined on the whole mesh.
80 //
82 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
83 std::vector<MeshLib::MeshSubset> all_mesh_subsets{*_mesh_subset_soil_nodes};
84
85 std::vector<std::vector<MeshLib::Element*> const*> vec_var_elements;
86 vec_var_elements.push_back(&(_mesh.getElements()));
87
88 std::vector<int> vec_n_components{
89 1}; // one component for the soil temperature variable.
90
91 //
92 // BHE nodes with BHE type dependent number of variables.
93 //
94 int const n_BHEs = _process_data._vec_BHE_property.size();
95 assert(n_BHEs == static_cast<int>(_bheMeshData.BHE_mat_IDs.size()));
96 assert(n_BHEs == static_cast<int>(_bheMeshData.BHE_nodes.size()));
97 assert(n_BHEs == static_cast<int>(_bheMeshData.BHE_elements.size()));
98
99 // the BHE nodes need to be cherry-picked from the vector
100 for (int i = 0; i < n_BHEs; i++)
101 {
102 auto const number_of_unknowns =
103 visit([](auto const& bhe) { return bhe.number_of_unknowns; },
105 auto const& bhe_nodes = _bheMeshData.BHE_nodes[i];
106 auto const& bhe_elements = _bheMeshData.BHE_elements[i];
107
108 // All the BHE nodes have additional variables.
109 _mesh_subset_BHE_nodes.push_back(
110 std::make_unique<MeshLib::MeshSubset const>(_mesh, bhe_nodes));
111
112 std::generate_n(std::back_inserter(all_mesh_subsets),
113 // Here the number of components equals to the
114 // number of unknowns on the BHE
115 number_of_unknowns,
116 [&ms = _mesh_subset_BHE_nodes.back()]()
117 { return *ms; });
118
119 vec_n_components.push_back(number_of_unknowns);
120 vec_var_elements.push_back(&bhe_elements);
121 }
122
124 std::make_unique<NumLib::LocalToGlobalIndexMap>(
125 std::move(all_mesh_subsets),
126 vec_n_components,
127 vec_var_elements,
129
130 // in case of debugging the dof table, activate the following line
131 // std::cout << *_local_to_global_index_map << "\n";
132}
133
135 NumLib::LocalToGlobalIndexMap const& dof_table,
136 MeshLib::Mesh const& mesh,
137 unsigned const integration_order)
138{
139 // Quick access map to BHE's through element ids.
140 std::unordered_map<std::size_t, BHE::BHETypes*> element_to_bhe_map;
141 int const n_BHEs = _process_data._vec_BHE_property.size();
142 for (int i = 0; i < n_BHEs; i++)
143 {
144 auto const& bhe_elements = _bheMeshData.BHE_elements[i];
145 for (auto const& e : bhe_elements)
146 {
147 element_to_bhe_map[e->getID()] =
149 }
150 }
151
152 assert(mesh.getDimension() == 3);
155 mesh.getElements(), dof_table, _local_assemblers,
156 NumLib::IntegrationOrder{integration_order}, element_to_bhe_map,
158
159 // Create BHE boundary conditions for each of the BHEs
161
163 {
164 std::vector<std::size_t> const bhes_node_ids =
165 _bheMeshData.BHE_nodes | ranges::views::join |
166 ranges::views::transform([](auto const* const node)
167 { return node->getID(); }) |
168 ranges::to<std::vector>;
169
170 // all connected soil elements and also the BHE elements.
171 MeshLib::ElementSearch es{mesh};
172 es.searchByNodeIDs(bhes_node_ids);
173
176 mesh.getNumberOfElements(), false);
177 for (auto const id : es.getSearchedElementIDs())
178 {
180 }
181 }
182}
183
185 const double t, double const dt, std::vector<GlobalVector*> const& x,
186 std::vector<GlobalVector*> const& x_prev, int const process_id,
188{
189 DBUG("Assemble HeatTransportBHE process.");
190
191 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
193 // Call global assembler for each local assembly item.
196 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
197 &b);
198 // Algebraic BC procedure.
200 {
201 algebraicBcConcreteProcess(t, dt, x, x_prev, process_id, M, K, b);
202 }
203
204 //_global_output(t, process_id, M, K, b);
205}
206
208 const double t, double const dt, std::vector<GlobalVector*> const& x,
209 std::vector<GlobalVector*> const& x_prev, int const process_id,
210 GlobalVector& b, GlobalMatrix& Jac)
211{
212 DBUG("AssembleWithJacobian HeatTransportBHE process.");
213
214 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
216
217 // Call global assembler for each local assembly item.
220 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
221 process_id, &b, &Jac);
222}
223
225 double const t, double const dt, std::vector<GlobalVector*> const& x,
226 GlobalVector const& x_prev, int const process_id)
227{
228 DBUG("Compute heat flux for HeatTransportBHE process.");
229
230 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
231 dof_tables.reserve(x.size());
232 std::generate_n(std::back_inserter(dof_tables), x.size(),
233 [&]() { return _local_to_global_index_map.get(); });
234
237 _local_assemblers, getActiveElementIDs(), dof_tables, t, dt, x, x_prev,
238 process_id);
239}
240
242 GlobalVector const& x)
243{
244 // if the process use python boundary condition
247
248 // Here the task is to get current time flowrate and flow temperature from
249 // TESPy and determine whether it converges.
250 auto const Tout_nodes_id =
252 const std::size_t n_bc_nodes = Tout_nodes_id.size();
253
254 for (std::size_t i = 0; i < n_bc_nodes; i++)
255 {
256 // read the T_out and store them in dataframe
258 x[Tout_nodes_id[i]];
259 }
260 // Transfer Tin and Tout to TESPy and return the results
261 auto const tespy_result = _process_data.py_bc_object->tespySolver(
263 std::get<1>(_process_data.py_bc_object->dataframe_network), // T_in
264 std::get<2>(_process_data.py_bc_object->dataframe_network)); // T_out
266 {
267 DBUG("Method `tespySolver' not overridden in Python script.");
268 }
269
270 // update the Tin and flow rate
271 for (std::size_t i = 0; i < n_bc_nodes; i++)
272 {
274 std::get<2>(tespy_result)[i];
276 std::get<3>(tespy_result)[i];
277 }
278 auto const tespy_has_converged = std::get<1>(tespy_result);
279 if (tespy_has_converged == true)
281
283}
284
286 std::vector<GlobalVector*> const& x, const double t, const double dt,
287 int const process_id)
288{
289 if (_process_data.py_bc_object == nullptr ||
291 {
292 return;
293 }
294
295 auto& [time, Tin_value, Tout_value, Tout_nodes_ids, flowrate] =
297
298 // We found the problem that time != t, but it always equals the last
299 // step. The following line is to correct this, although we do not use
300 // it for server communication.
301 time = t;
302
303 auto const& solution = *x[process_id];
304
305 // Iterate through each BHE
306 const std::size_t n_bc_nodes = Tout_nodes_ids.size();
307 for (std::size_t i = 0; i < n_bc_nodes; i++)
308 {
309 // read the T_out and store them in dataframe
310 Tout_value[i] = solution[Tout_nodes_ids[i]];
311 }
312
313 // Transfer T_out to server_Communication and get back T_in and flowrate
314 auto const server_communication_result =
316 t, dt, Tin_value, Tout_value, flowrate);
319 {
320 DBUG("Method `serverCommunication' not overridden in Python script.");
321 }
322
323 auto const& [server_communication_Tin_value,
324 server_communication_flowrate] = server_communication_result;
325
326 std::copy(begin(server_communication_Tin_value),
327 end(server_communication_Tin_value),
328 begin(Tin_value));
329 std::copy(begin(server_communication_flowrate),
330 end(server_communication_flowrate),
331 begin(flowrate));
332}
333
335 std::vector<GlobalVector*> const& x,
336 std::vector<GlobalVector*> const& /*x_prev*/, const double t,
337 const double dt, int const process_id)
338{
339 if (_process_data.py_bc_object == nullptr ||
341 {
342 return;
343 }
344
345 auto& [time, Tin_value, Tout_value, Tout_nodes_ids, flowrate] =
347
348 // We found the problem that time != t, but it always equals the last
349 // step. The following line is to correct this, although we do not use
350 // it for server communication.
351 time = t;
352
353 auto const& solution = *x[process_id];
354
355 // Iterate through each BHE
356 const std::size_t n_bc_nodes = Tout_nodes_ids.size();
357 for (std::size_t i = 0; i < n_bc_nodes; i++)
358 {
359 // read the T_out and store them in dataframe
360 Tout_value[i] = solution[Tout_nodes_ids[i]];
361 }
362
363 // Transfer T_out to server_Communication
365 t, dt, Tin_value, Tout_value, flowrate);
368 {
369 DBUG("Method `serverCommunication' not overridden in Python script.");
370 }
371}
372
374 [[maybe_unused]] const double t, double const /*dt*/,
375 [[maybe_unused]] std::vector<GlobalVector*> const& x,
376 std::vector<GlobalVector*> const& /*xprev*/, int const /*process_id*/,
377 [[maybe_unused]] GlobalMatrix& M, [[maybe_unused]] GlobalMatrix& K,
378 [[maybe_unused]] GlobalVector& b)
379{
380#ifndef USE_PETSC
381 auto M_normal = M.getRawMatrix();
382 auto K_normal = K.getRawMatrix();
383 auto n_original_rows = K_normal.rows();
384 auto const n_BHE_bottom_pairs = _vec_bottom_BHE_node_indices.size();
385 auto const n_BHE_top_pairs = _vec_top_BHE_node_indices.size();
386
387 // apply weighting factor based on the max value from column wise inner
388 // product and scale it with user defined value
389 const double w_val =
391 (Eigen::RowVectorXd::Ones(K_normal.rows()) * K_normal.cwiseAbs())
392 .maxCoeff();
393
394 M_normal.conservativeResize(
395 M_normal.rows() + n_BHE_bottom_pairs + n_BHE_top_pairs,
396 M_normal.cols());
397 K_normal.conservativeResize(
398 K_normal.rows() + n_BHE_bottom_pairs + n_BHE_top_pairs,
399 K_normal.cols());
400
401 for (std::size_t i = 0; i < n_BHE_bottom_pairs; i++)
402 {
403 Eigen::SparseVector<double> M_Plus(M_normal.cols());
404 M_Plus.setZero();
405 M_normal.row(n_original_rows + i) = M_Plus;
406
407 Eigen::SparseVector<double> K_Plus(K_normal.cols());
408 K_Plus.setZero();
409
410 auto const [bhe_idx, first_BHE_bottom_index, second_BHE_bottom_index] =
412
413 K_Plus.insert(first_BHE_bottom_index) = w_val;
414 K_Plus.insert(second_BHE_bottom_index) = -w_val;
415
416 K_normal.row(n_original_rows + i) = K_Plus;
417 }
418
419 auto b_normal = b.getRawVector();
420 Eigen::SparseVector<double> b_Plus(b_normal.rows() + n_BHE_bottom_pairs +
421 n_BHE_top_pairs);
422 b_Plus.setZero();
423
424 // Copy values from the original column vector to the modified one
425 for (int i = 0; i < b_normal.innerSize(); ++i)
426 {
427 b_Plus.insert(i) = b_normal.coeff(i);
428 }
429
430 for (std::size_t i = 0; i < n_BHE_top_pairs; i++)
431 {
432 Eigen::SparseVector<double> M_Plus(M_normal.cols());
433 M_Plus.setZero();
434 M_normal.row(n_original_rows + n_BHE_bottom_pairs + i) = M_Plus;
435
436 Eigen::SparseVector<double> K_Plus(K_normal.cols());
437 K_Plus.setZero();
438
439 auto const [bhe_idx, first_BHE_top_index, second_BHE_top_index] =
441
442 auto first_BHE_top_index_pair = first_BHE_top_index;
443 auto second_BHE_top_index_pair = second_BHE_top_index;
444
445 K_Plus.insert(first_BHE_top_index_pair) =
446 w_val; // for power BC, the inflow node must be positive
447 K_Plus.insert(second_BHE_top_index_pair) =
448 -w_val; // for power BC, the outflow node must be negative
449
450 K_normal.row(n_original_rows + n_BHE_bottom_pairs + i) = K_Plus;
451
452 // get the delta_T value here
453 double const T_out = (*x[0])[second_BHE_top_index_pair];
454
455 auto calculate_delta_T = [&](auto& bhe)
456 {
457 auto const T_in = bhe.updateFlowRateAndTemperature(T_out, t);
458 return T_in - T_out;
459 };
460 auto delta_T = std::visit(calculate_delta_T,
462
463 b_Plus.insert(n_original_rows + n_BHE_bottom_pairs + i) =
464 delta_T * w_val;
465 }
466
467 M.getRawMatrix() = M_normal;
468 K.getRawMatrix() = K_normal;
469 b.getRawVector() = b_Plus;
470#else
471 OGS_FATAL(
472 "The Algebraic Boundary Condition is not implemented for use with "
473 "PETsc Library! Simulation will be terminated.");
474#endif
475}
476
478 std::vector<std::vector<MeshLib::Node*>> const& all_bhe_nodes)
479{
480 const int process_id = 0;
481 auto& bcs = _boundary_conditions[process_id];
482
483 std::size_t const n_BHEs = _process_data._vec_BHE_property.size();
484
485 // for each BHE
486 for (std::size_t bhe_i = 0; bhe_i < n_BHEs; bhe_i++)
487 {
488 auto const& bhe_nodes = all_bhe_nodes[bhe_i];
489 // find the variable ID
490 // the soil temperature is 0-th variable
491 // the BHE temperature is therefore bhe_i + 1
492 const int variable_id = bhe_i + 1;
493
494 std::vector<MeshLib::Node*> bhe_boundary_nodes;
495
496 // cherry-pick the boundary nodes according to
497 // the number of connected line elements.
498 for (auto const& bhe_node : bhe_nodes)
499 {
500 // Count number of 1d elements connected with every BHE node.
501 auto const& connected_elements =
503 const std::size_t n_line_elements = std::count_if(
504 connected_elements.begin(), connected_elements.end(),
505 [](MeshLib::Element const* elem)
506 { return (elem->getDimension() == 1); });
507
508 if (n_line_elements == 1)
509 {
510 bhe_boundary_nodes.push_back(bhe_node);
511 }
512 }
513
514 if (bhe_boundary_nodes.size() != 2)
515 {
516 OGS_FATAL(
517 "Error!!! The BHE boundary nodes are not correctly found, "
518 "for every single BHE, there should be 2 boundary nodes.");
519 }
520
521 // For 1U, 2U, CXC, CXA type BHE, the node order in the boundary nodes
522 // vector should be rearranged according to its z coordinate in
523 // descending order. In these BHE types, the z coordinate on the top and
524 // bottom node is different. The BHE top node with a higher z coordinate
525 // should be placed at the first, while the BHE bottom node with a lower
526 // z coordinate should be placed at the second. For other horizontal BHE
527 // types e.g. 1P-type BHE, the z coordinate on the top and bottom node
528 // is identical. Thus the node order in the boundary nodes vector can
529 // not be rearranged according to its z coordinate. For these BHE types,
530 // the boundary node order is according to the default node id order in
531 // the model mesh.
532 // for 1P-type BHE
533 if ((*bhe_boundary_nodes[0])[2] == (*bhe_boundary_nodes[1])[2])
534 {
535 INFO(
536 "For 1P-type BHE, the BHE inflow and outflow "
537 "nodes are identified according to their mesh node id in "
538 "ascending order");
539 }
540 // for 1U, 2U, CXC, CXA type BHE
541 else
542 {
543 // swap the boundary nodes if the z coordinate of the
544 // first node is lower than it on the second node
545 if ((*bhe_boundary_nodes[0])[2] < (*bhe_boundary_nodes[1])[2])
546 {
547 std::swap(bhe_boundary_nodes[0], bhe_boundary_nodes[1]);
548 }
549 }
550
551 auto get_global_index =
552 [&](std::size_t const node_id, int const component)
553 {
554 return _local_to_global_index_map->getGlobalIndex(
556 variable_id, component);
557 };
558
559 auto get_global_bhe_bc_indices =
560 [&](std::array<
561 std::pair<std::size_t /*node_id*/, int /*component*/>, 2>
562 nodes_and_components)
563 {
564 return std::make_pair(
565 get_global_index(nodes_and_components[0].first,
566 nodes_and_components[0].second),
567 get_global_index(nodes_and_components[1].first,
568 nodes_and_components[1].second));
569 };
570
571 auto get_global_bhe_bc_indices_with_bhe_idx =
572 [&](std::size_t bhe_idx,
573 std::array<
574 std::pair<std::size_t /*node_id*/, int /*component*/>, 2>
575 nodes_and_components)
576 {
577 return std::make_tuple(
578 bhe_idx,
579 get_global_index(nodes_and_components[0].first,
580 nodes_and_components[0].second),
581 get_global_index(nodes_and_components[1].first,
582 nodes_and_components[1].second));
583 };
584
585 auto createBCs =
586 [&, bc_top_node_id = bhe_boundary_nodes[0]->getID(),
587 bc_bottom_node_id = bhe_boundary_nodes[1]->getID()](auto& bhe)
588 {
589 for (auto const& in_out_component_id :
590 bhe.inflow_outflow_bc_component_ids)
591 {
592 if (bhe.use_python_bcs ||
593 this->_process_data._use_server_communication)
594 // call BHEPythonBoundarycondition
595 {
596 if (this->_process_data
597 .py_bc_object) // the bc object exist
598 {
599 // apply the customized top, inflow BC.
600 bcs.addBoundaryCondition(
602 get_global_bhe_bc_indices(
603 bhe.getBHEInflowDirichletBCNodesAndComponents(
604 bc_top_node_id, bc_bottom_node_id,
605 in_out_component_id.first)),
606 bhe,
608 }
609 else
610 {
611 OGS_FATAL(
612 "The Python Boundary Condition was switched on, "
613 "but the data object does not exist! ");
614 }
615 }
616 else
617 {
620 bhe.isPowerBC())
621 {
622 // for algebraic_bc method, record the pair of indices
623 // in a separate vector
625 get_global_bhe_bc_indices_with_bhe_idx(
626 bhe_i,
627 {{{bc_top_node_id, in_out_component_id.first},
628 {bc_top_node_id,
629 in_out_component_id.second}}}));
630 }
631 else
632 {
633 // Top, inflow, normal case
634 bcs.addBoundaryCondition(
636 get_global_bhe_bc_indices(
637 bhe.getBHEInflowDirichletBCNodesAndComponents(
638 bc_top_node_id, bc_bottom_node_id,
639 in_out_component_id.first)),
640 [&bhe](double const T, double const t) {
641 return bhe.updateFlowRateAndTemperature(T,
642 t);
643 }));
644 }
645 }
646
647 auto const bottom_nodes_and_components =
648 bhe.getBHEBottomDirichletBCNodesAndComponents(
649 bc_bottom_node_id,
650 in_out_component_id.first,
651 in_out_component_id.second);
652
653 if (bottom_nodes_and_components &&
656 {
657 // Bottom, outflow, all cases | not needed for algebraic_bc
658 // method
659 bcs.addBoundaryCondition(
661 get_global_bhe_bc_indices(
662 {{{bc_bottom_node_id,
663 in_out_component_id.first},
664 {bc_bottom_node_id,
665 in_out_component_id.second}}})));
666 }
667 else if (bottom_nodes_and_components &&
670 {
671 // for algebraic_bc method, record the pair of indices in a
672 // separate vector
674 get_global_bhe_bc_indices_with_bhe_idx(
675 bhe_i,
676 {{{bc_bottom_node_id, in_out_component_id.first},
677 {bc_bottom_node_id,
678 in_out_component_id.second}}}));
679 }
680 }
681 };
682 visit(createBCs, _process_data._vec_BHE_property[bhe_i]);
683 }
684}
685} // namespace HeatTransportBHE
686} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
Global vector based on Eigen vector.
Definition EigenVector.h:25
Element search class.
bool isAxiallySymmetric() const
Definition Mesh.h:137
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:109
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88
std::size_t getID() const
Get id of the mesh.
Definition Mesh.h:121
std::vector< Element const * > const & getElementsConnectedToNode(std::size_t node_id) const
Definition Mesh.cpp:256
std::size_t getNumberOfElements() const
Get the number of elements.
Definition Mesh.h:97
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > dataframe_network
virtual std::tuple< bool, bool, std::vector< double >, std::vector< double > > tespySolver(double, std::vector< double > const &, std::vector< double > const &) const
virtual void serverCommunicationPostTimestep(double, double, std::vector< double > const &, std::vector< double > const &, std::vector< double > const &) const
virtual std::tuple< std::vector< double >, std::vector< double > > serverCommunicationPreTimestep(double, double, std::vector< double > const &, std::vector< double > const &, std::vector< double > const &) const
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_soil_nodes
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
std::vector< std::unique_ptr< MeshLib::MeshSubset const > > _mesh_subset_BHE_nodes
std::vector< std::tuple< std::size_t, GlobalIndexType, GlobalIndexType > > _vec_bottom_BHE_node_indices
void computeSecondaryVariableConcrete(double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id) override
std::vector< std::unique_ptr< HeatTransportBHELocalAssemblerInterface > > _local_assemblers
HeatTransportBHEProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, HeatTransportBHEProcessData &&process_data, SecondaryVariableCollection &&secondary_variables, BHEMeshData &&bhe_mesh_data)
NumLib::IterationResult postIterationConcreteProcess(GlobalVector const &x) override
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, const double t, const double dt, int const process_id) override
std::vector< std::tuple< std::size_t, GlobalIndexType, GlobalIndexType > > _vec_top_BHE_node_indices
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
void algebraicBcConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) override
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, const double dt, int const process_id) override
void createBHEBoundaryConditionTopBottom(std::vector< std::vector< MeshLib::Node * > > const &all_bhe_nodes)
virtual void computeSecondaryVariable(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
std::vector< BoundaryConditionCollection > _boundary_conditions
Definition Process.h:405
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition Process.h:366
MeshLib::Mesh & _mesh
Definition Process.h:365
std::vector< std::size_t > const & getActiveElementIDs() const
Definition Process.h:167
VectorMatrixAssembler _global_assembler
Definition Process.h:377
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition Process.h:368
Handles configuration of several secondary variables from the project file.
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix *M, GlobalMatrix *K, GlobalVector *b)
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector *b, GlobalMatrix *Jac)
IterationResult
Status flags telling the NonlinearSolver if an iteration succeeded.
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:268
@ BY_COMPONENT
Ordering data by component type.
std::unique_ptr< BHEInflowDirichletBoundaryCondition< BHEUpdateCallback > > createBHEInflowDirichletBoundaryCondition(std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices, BHEUpdateCallback bhe_update_callback)
std::unique_ptr< BHEBottomDirichletBoundaryCondition > createBHEBottomDirichletBoundaryCondition(std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices)
void createLocalAssemblers(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, NumLib::IntegrationOrder const integration_order, ExtraCtorArgs &&... extra_ctor_args)
std::unique_ptr< BHEInflowPythonBoundaryCondition< BHEType > > createBHEInflowPythonBoundaryCondition(std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices, BHEType &bhe, BHEInflowPythonBoundaryConditionPythonSideInterface &py_bc_object)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
std::vector< std::vector< MeshLib::Node * > > BHE_nodes
Definition MeshUtils.h:38
std::vector< std::vector< MeshLib::Element * > > BHE_elements
Definition MeshUtils.h:37
BHEInflowPythonBoundaryConditionPythonSideInterface * py_bc_object
Python object computing BC values.