OGS
HeatTransportBHEProcess.cpp
Go to the documentation of this file.
1
12
13#include <cassert>
14
22
23namespace ProcessLib
24{
25namespace HeatTransportBHE
26{
28 std::string name,
29 MeshLib::Mesh& mesh,
30 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
31 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
32 unsigned const integration_order,
33 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
34 process_variables,
35 HeatTransportBHEProcessData&& process_data,
36 SecondaryVariableCollection&& secondary_variables)
37 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
38 integration_order, std::move(process_variables),
39 std::move(secondary_variables)),
40 _process_data(std::move(process_data)),
41 _bheMeshData(getBHEDataInMesh(mesh))
42{
43 if (_bheMeshData.BHE_mat_IDs.size() !=
45 {
47 "The number of the given BHE properties ({:d}) are not consistent "
48 "with the number of BHE groups in the mesh ({:d}).",
51 }
52
53 auto material_ids = MeshLib::materialIDs(mesh);
54 if (material_ids == nullptr)
55 {
56 OGS_FATAL("Not able to get material IDs! ");
57 }
58
60
61 // create a map from a material ID to a BHE ID
62 for (int i = 0; i < static_cast<int>(_bheMeshData.BHE_mat_IDs.size()); i++)
63 {
64 // fill in the map structure
66 i;
67 }
68}
69
71{
72 // Create single component dof in every of the mesh's nodes.
74 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
75
76 //
77 // Soil temperature variable defined on the whole mesh.
78 //
80 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
81 std::vector<MeshLib::MeshSubset> all_mesh_subsets{*_mesh_subset_soil_nodes};
82
83 std::vector<std::vector<MeshLib::Element*> const*> vec_var_elements;
84 vec_var_elements.push_back(&(_mesh.getElements()));
85
86 std::vector<int> vec_n_components{
87 1}; // one component for the soil temperature variable.
88
89 //
90 // BHE nodes with BHE type dependent number of variables.
91 //
92 int const n_BHEs = _process_data._vec_BHE_property.size();
93 assert(n_BHEs == static_cast<int>(_bheMeshData.BHE_mat_IDs.size()));
94 assert(n_BHEs == static_cast<int>(_bheMeshData.BHE_nodes.size()));
95 assert(n_BHEs == static_cast<int>(_bheMeshData.BHE_elements.size()));
96
97 // the BHE nodes need to be cherry-picked from the vector
98 for (int i = 0; i < n_BHEs; i++)
99 {
100 auto const number_of_unknowns =
101 visit([](auto const& bhe) { return bhe.number_of_unknowns; },
103 auto const& bhe_nodes = _bheMeshData.BHE_nodes[i];
104 auto const& bhe_elements = _bheMeshData.BHE_elements[i];
105
106 // All the BHE nodes have additional variables.
107 _mesh_subset_BHE_nodes.push_back(
108 std::make_unique<MeshLib::MeshSubset const>(_mesh, bhe_nodes));
109
110 std::generate_n(std::back_inserter(all_mesh_subsets),
111 // Here the number of components equals to the
112 // number of unknowns on the BHE
113 number_of_unknowns,
114 [&ms = _mesh_subset_BHE_nodes.back()]()
115 { return *ms; });
116
117 vec_n_components.push_back(number_of_unknowns);
118 vec_var_elements.push_back(&bhe_elements);
119 }
120
122 std::make_unique<NumLib::LocalToGlobalIndexMap>(
123 std::move(all_mesh_subsets),
124 vec_n_components,
125 vec_var_elements,
127
128 // in case of debugging the dof table, activate the following line
129 // std::cout << *_local_to_global_index_map << "\n";
130}
131
133 NumLib::LocalToGlobalIndexMap const& dof_table,
134 MeshLib::Mesh const& mesh,
135 unsigned const integration_order)
136{
137 // Quick access map to BHE's through element ids.
138 std::unordered_map<std::size_t, BHE::BHETypes*> element_to_bhe_map;
139 int const n_BHEs = _process_data._vec_BHE_property.size();
140 for (int i = 0; i < n_BHEs; i++)
141 {
142 auto const& bhe_elements = _bheMeshData.BHE_elements[i];
143 for (auto const& e : bhe_elements)
144 {
145 element_to_bhe_map[e->getID()] =
147 }
148 }
149
150 assert(mesh.getDimension() == 3);
153 mesh.getElements(), dof_table, _local_assemblers,
154 NumLib::IntegrationOrder{integration_order}, element_to_bhe_map,
156
157 // Create BHE boundary conditions for each of the BHEs
159}
160
162 const double t, double const dt, std::vector<GlobalVector*> const& x,
163 std::vector<GlobalVector*> const& x_prev, int const process_id,
165{
166 DBUG("Assemble HeatTransportBHE process.");
167
168 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
170 // Call global assembler for each local assembly item.
173 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
174 &b);
175 // Algebraic BC procedure.
177 {
178 algebraicBcConcreteProcess(t, dt, x, x_prev, process_id, M, K, b);
179 }
180
181 //_global_output(t, process_id, M, K, b);
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,
187 GlobalVector& b, GlobalMatrix& Jac)
188{
189 DBUG("AssembleWithJacobian HeatTransportBHE process.");
190
191 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
193
194 // Call global assembler for each local assembly item.
197 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
198 process_id, &b, &Jac);
199}
200
202 double const t, double const dt, std::vector<GlobalVector*> const& x,
203 GlobalVector const& x_prev, int const process_id)
204{
205 DBUG("Compute heat flux for HeatTransportBHE process.");
206
207 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
208 dof_tables.reserve(x.size());
209 std::generate_n(std::back_inserter(dof_tables), x.size(),
210 [&]() { return _local_to_global_index_map.get(); });
211
214 _local_assemblers, getActiveElementIDs(), dof_tables, t, dt, x, x_prev,
215 process_id);
216}
217
219 GlobalVector const& x)
220{
221 // if the process use python boundary condition
224
225 // Here the task is to get current time flowrate and flow temperature from
226 // TESPy and determine whether it converges.
227 auto const Tout_nodes_id =
229 const std::size_t n_bc_nodes = Tout_nodes_id.size();
230
231 for (std::size_t i = 0; i < n_bc_nodes; i++)
232 {
233 // read the T_out and store them in dataframe
235 x[Tout_nodes_id[i]];
236 }
237 // Transfer Tin and Tout to TESPy and return the results
238 auto const tespy_result = _process_data.py_bc_object->tespySolver(
240 std::get<1>(_process_data.py_bc_object->dataframe_network), // T_in
241 std::get<2>(_process_data.py_bc_object->dataframe_network)); // T_out
243 {
244 DBUG("Method `tespySolver' not overridden in Python script.");
245 }
246
247 // update the Tin and flow rate
248 for (std::size_t i = 0; i < n_bc_nodes; i++)
249 {
251 std::get<2>(tespy_result)[i];
253 std::get<3>(tespy_result)[i];
254 }
255 auto const tespy_has_converged = std::get<1>(tespy_result);
256 if (tespy_has_converged == true)
258
260}
261
263 std::vector<GlobalVector*> const& x, const double t, const double dt,
264 int const process_id)
265{
266 if (_process_data.py_bc_object == nullptr ||
268 {
269 return;
270 }
271
272 auto& [time, Tin_value, Tout_value, Tout_nodes_ids, flowrate] =
274
275 // We found the problem that time != t, but it always equals the last
276 // step. The following line is to correct this, although we do not use
277 // it for server communication.
278 time = t;
279
280 auto const& solution = *x[process_id];
281
282 // Iterate through each BHE
283 const std::size_t n_bc_nodes = Tout_nodes_ids.size();
284 for (std::size_t i = 0; i < n_bc_nodes; i++)
285 {
286 // read the T_out and store them in dataframe
287 Tout_value[i] = solution[Tout_nodes_ids[i]];
288 }
289
290 // Transfer T_out to server_Communication and get back T_in and flowrate
291 auto const server_communication_result =
293 t, dt, Tin_value, Tout_value, flowrate);
296 {
297 DBUG("Method `serverCommunication' not overridden in Python script.");
298 }
299
300 auto const& [server_communication_Tin_value,
301 server_communication_flowrate] = server_communication_result;
302
303 std::copy(begin(server_communication_Tin_value),
304 end(server_communication_Tin_value),
305 begin(Tin_value));
306 std::copy(begin(server_communication_flowrate),
307 end(server_communication_flowrate),
308 begin(flowrate));
309}
310
312 std::vector<GlobalVector*> const& x,
313 std::vector<GlobalVector*> const& /*x_prev*/, const double t,
314 const double dt, int const process_id)
315{
316 if (_process_data.py_bc_object == nullptr ||
318 {
319 return;
320 }
321
322 auto& [time, Tin_value, Tout_value, Tout_nodes_ids, flowrate] =
324
325 // We found the problem that time != t, but it always equals the last
326 // step. The following line is to correct this, although we do not use
327 // it for server communication.
328 time = t;
329
330 auto const& solution = *x[process_id];
331
332 // Iterate through each BHE
333 const std::size_t n_bc_nodes = Tout_nodes_ids.size();
334 for (std::size_t i = 0; i < n_bc_nodes; i++)
335 {
336 // read the T_out and store them in dataframe
337 Tout_value[i] = solution[Tout_nodes_ids[i]];
338 }
339
340 // Transfer T_out to server_Communication
342 t, dt, Tin_value, Tout_value, flowrate);
345 {
346 DBUG("Method `serverCommunication' not overridden in Python script.");
347 }
348}
349
351 [[maybe_unused]] const double t, double const /*dt*/,
352 [[maybe_unused]] std::vector<GlobalVector*> const& x,
353 std::vector<GlobalVector*> const& /*xprev*/, int const /*process_id*/,
354 [[maybe_unused]] GlobalMatrix& M, [[maybe_unused]] GlobalMatrix& K,
355 [[maybe_unused]] GlobalVector& b)
356{
357#ifndef USE_PETSC
358 auto M_normal = M.getRawMatrix();
359 auto K_normal = K.getRawMatrix();
360 auto n_original_rows = K_normal.rows();
361 auto const n_BHE_bottom_pairs = _vec_bottom_BHE_node_indices.size();
362 auto const n_BHE_top_pairs = _vec_top_BHE_node_indices.size();
363
364 // apply weighting factor based on the max value from column wise inner
365 // product and scale it with user defined value
366 const double w_val =
368 (Eigen::RowVectorXd::Ones(K_normal.rows()) * K_normal.cwiseAbs())
369 .maxCoeff();
370
371 M_normal.conservativeResize(
372 M_normal.rows() + n_BHE_bottom_pairs + n_BHE_top_pairs,
373 M_normal.cols());
374 K_normal.conservativeResize(
375 K_normal.rows() + n_BHE_bottom_pairs + n_BHE_top_pairs,
376 K_normal.cols());
377
378 for (std::size_t i = 0; i < n_BHE_bottom_pairs; i++)
379 {
380 Eigen::SparseVector<double> M_Plus(M_normal.cols());
381 M_Plus.setZero();
382 M_normal.row(n_original_rows + i) = M_Plus;
383
384 Eigen::SparseVector<double> K_Plus(K_normal.cols());
385 K_Plus.setZero();
386
387 auto const [bhe_idx, first_BHE_bottom_index, second_BHE_bottom_index] =
389
390 K_Plus.insert(first_BHE_bottom_index) = w_val;
391 K_Plus.insert(second_BHE_bottom_index) = -w_val;
392
393 K_normal.row(n_original_rows + i) = K_Plus;
394 }
395
396 auto b_normal = b.getRawVector();
397 Eigen::SparseVector<double> b_Plus(b_normal.rows() + n_BHE_bottom_pairs +
398 n_BHE_top_pairs);
399 b_Plus.setZero();
400
401 // Copy values from the original column vector to the modified one
402 for (int i = 0; i < b_normal.innerSize(); ++i)
403 {
404 b_Plus.insert(i) = b_normal.coeff(i);
405 }
406
407 for (std::size_t i = 0; i < n_BHE_top_pairs; i++)
408 {
409 Eigen::SparseVector<double> M_Plus(M_normal.cols());
410 M_Plus.setZero();
411 M_normal.row(n_original_rows + n_BHE_bottom_pairs + i) = M_Plus;
412
413 Eigen::SparseVector<double> K_Plus(K_normal.cols());
414 K_Plus.setZero();
415
416 auto const [bhe_idx, first_BHE_top_index, second_BHE_top_index] =
418
419 auto first_BHE_top_index_pair = first_BHE_top_index;
420 auto second_BHE_top_index_pair = second_BHE_top_index;
421
422 K_Plus.insert(first_BHE_top_index_pair) =
423 w_val; // for power BC, the inflow node must be positive
424 K_Plus.insert(second_BHE_top_index_pair) =
425 -w_val; // for power BC, the outflow node must be negative
426
427 K_normal.row(n_original_rows + n_BHE_bottom_pairs + i) = K_Plus;
428
429 // get the delta_T value here
430 double const T_out = (*x[0])[second_BHE_top_index_pair];
431
432 auto calculate_delta_T = [&](auto& bhe)
433 {
434 auto const T_in = bhe.updateFlowRateAndTemperature(T_out, t);
435 return T_in - T_out;
436 };
437 auto delta_T = std::visit(calculate_delta_T,
439
440 b_Plus.insert(n_original_rows + n_BHE_bottom_pairs + i) =
441 delta_T * w_val;
442 }
443
444 M.getRawMatrix() = M_normal;
445 K.getRawMatrix() = K_normal;
446 b.getRawVector() = b_Plus;
447#else
448 OGS_FATAL(
449 "The Algebraic Boundary Condition is not implemented for use with "
450 "PETsc Library! Simulation will be terminated.");
451#endif
452}
453
455 std::vector<std::vector<MeshLib::Node*>> const& all_bhe_nodes)
456{
457 const int process_id = 0;
458 auto& bcs = _boundary_conditions[process_id];
459
460 std::size_t const n_BHEs = _process_data._vec_BHE_property.size();
461
462 // for each BHE
463 for (std::size_t bhe_i = 0; bhe_i < n_BHEs; bhe_i++)
464 {
465 auto const& bhe_nodes = all_bhe_nodes[bhe_i];
466 // find the variable ID
467 // the soil temperature is 0-th variable
468 // the BHE temperature is therefore bhe_i + 1
469 const int variable_id = bhe_i + 1;
470
471 std::vector<MeshLib::Node*> bhe_boundary_nodes;
472
473 // cherry-pick the boundary nodes according to
474 // the number of connected line elements.
475 for (auto const& bhe_node : bhe_nodes)
476 {
477 // Count number of 1d elements connected with every BHE node.
478 auto const& connected_elements =
480 const std::size_t n_line_elements = std::count_if(
481 connected_elements.begin(), connected_elements.end(),
482 [](MeshLib::Element const* elem)
483 { return (elem->getDimension() == 1); });
484
485 if (n_line_elements == 1)
486 {
487 bhe_boundary_nodes.push_back(bhe_node);
488 }
489 }
490
491 if (bhe_boundary_nodes.size() != 2)
492 {
493 OGS_FATAL(
494 "Error!!! The BHE boundary nodes are not correctly found, "
495 "for every single BHE, there should be 2 boundary nodes.");
496 }
497
498 // For 1U, 2U, CXC, CXA type BHE, the node order in the boundary nodes
499 // vector should be rearranged according to its z coordinate in
500 // descending order. In these BHE types, the z coordinate on the top and
501 // bottom node is different. The BHE top node with a higher z coordinate
502 // should be placed at the first, while the BHE bottom node with a lower
503 // z coordinate should be placed at the second. For other horizontal BHE
504 // types e.g. 1P-type BHE, the z coordinate on the top and bottom node
505 // is identical. Thus the node order in the boundary nodes vector can
506 // not be rearranged according to its z coordinate. For these BHE types,
507 // the boundary node order is according to the default node id order in
508 // the model mesh.
509 // for 1P-type BHE
510 if ((*bhe_boundary_nodes[0])[2] == (*bhe_boundary_nodes[1])[2])
511 {
512 INFO(
513 "For 1P-type BHE, the BHE inflow and outflow "
514 "nodes are identified according to their mesh node id in "
515 "ascending order");
516 }
517 // for 1U, 2U, CXC, CXA type BHE
518 else
519 {
520 // swap the boundary nodes if the z coordinate of the
521 // first node is lower than it on the second node
522 if ((*bhe_boundary_nodes[0])[2] < (*bhe_boundary_nodes[1])[2])
523 {
524 std::swap(bhe_boundary_nodes[0], bhe_boundary_nodes[1]);
525 }
526 }
527
528 auto get_global_index =
529 [&](std::size_t const node_id, int const component)
530 {
531 return _local_to_global_index_map->getGlobalIndex(
533 variable_id, component);
534 };
535
536 auto get_global_bhe_bc_indices =
537 [&](std::array<
538 std::pair<std::size_t /*node_id*/, int /*component*/>, 2>
539 nodes_and_components)
540 {
541 return std::make_pair(
542 get_global_index(nodes_and_components[0].first,
543 nodes_and_components[0].second),
544 get_global_index(nodes_and_components[1].first,
545 nodes_and_components[1].second));
546 };
547
548 auto get_global_bhe_bc_indices_with_bhe_idx =
549 [&](std::size_t bhe_idx,
550 std::array<
551 std::pair<std::size_t /*node_id*/, int /*component*/>, 2>
552 nodes_and_components)
553 {
554 return std::make_tuple(
555 bhe_idx,
556 get_global_index(nodes_and_components[0].first,
557 nodes_and_components[0].second),
558 get_global_index(nodes_and_components[1].first,
559 nodes_and_components[1].second));
560 };
561
562 auto createBCs =
563 [&, bc_top_node_id = bhe_boundary_nodes[0]->getID(),
564 bc_bottom_node_id = bhe_boundary_nodes[1]->getID()](auto& bhe)
565 {
566 for (auto const& in_out_component_id :
567 bhe.inflow_outflow_bc_component_ids)
568 {
569 if (bhe.use_python_bcs ||
570 this->_process_data._use_server_communication)
571 // call BHEPythonBoundarycondition
572 {
573 if (this->_process_data
574 .py_bc_object) // the bc object exist
575 {
576 // apply the customized top, inflow BC.
577 bcs.addBoundaryCondition(
579 get_global_bhe_bc_indices(
580 bhe.getBHEInflowDirichletBCNodesAndComponents(
581 bc_top_node_id, bc_bottom_node_id,
582 in_out_component_id.first)),
583 bhe,
585 }
586 else
587 {
588 OGS_FATAL(
589 "The Python Boundary Condition was switched on, "
590 "but the data object does not exist! ");
591 }
592 }
593 else
594 {
597 bhe.isPowerBC())
598 {
599 // for algebraic_bc method, record the pair of indices
600 // in a separate vector
602 get_global_bhe_bc_indices_with_bhe_idx(
603 bhe_i,
604 {{{bc_top_node_id, in_out_component_id.first},
605 {bc_top_node_id,
606 in_out_component_id.second}}}));
607 }
608 else
609 {
610 // Top, inflow, normal case
611 bcs.addBoundaryCondition(
613 get_global_bhe_bc_indices(
614 bhe.getBHEInflowDirichletBCNodesAndComponents(
615 bc_top_node_id, bc_bottom_node_id,
616 in_out_component_id.first)),
617 [&bhe](double const T, double const t) {
618 return bhe.updateFlowRateAndTemperature(T,
619 t);
620 }));
621 }
622 }
623
624 auto const bottom_nodes_and_components =
625 bhe.getBHEBottomDirichletBCNodesAndComponents(
626 bc_bottom_node_id,
627 in_out_component_id.first,
628 in_out_component_id.second);
629
630 if (bottom_nodes_and_components &&
633 {
634 // Bottom, outflow, all cases | not needed for algebraic_bc
635 // method
636 bcs.addBoundaryCondition(
638 get_global_bhe_bc_indices(
639 {{{bc_bottom_node_id,
640 in_out_component_id.first},
641 {bc_bottom_node_id,
642 in_out_component_id.second}}})));
643 }
644 else if (bottom_nodes_and_components &&
647 {
648 // for algebraic_bc method, record the pair of indices in a
649 // separate vector
651 get_global_bhe_bc_indices_with_bhe_idx(
652 bhe_i,
653 {{{bc_bottom_node_id, in_out_component_id.first},
654 {bc_bottom_node_id,
655 in_out_component_id.second}}}));
656 }
657 }
658 };
659 visit(createBCs, _process_data._vec_BHE_property[bhe_i]);
660 }
661}
662} // namespace HeatTransportBHE
663} // 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
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::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
NumLib::IterationResult postIterationConcreteProcess(GlobalVector const &x) override
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)
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)
BHEMeshData getBHEDataInMesh(MeshLib::Mesh const &mesh)
Definition MeshUtils.cpp:51
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.