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