OGS 6.2.1-97-g73d1aeda3
BHEBottomDirichletBoundaryCondition.cpp
Go to the documentation of this file.
1 
12 #include "BaseLib/Error.h"
13 
15 {
17  const double /*t*/, GlobalVector const& x,
19 {
20  bc_values.ids.resize(1);
21  bc_values.values.resize(1);
22 
23  bc_values.ids[0] = _in_out_global_indices.second;
24  // here, the outflow temperature is always
25  // the same as the inflow temperature
26  // get the inflow temperature from here.
27  bc_values.values[0] = x[_in_out_global_indices.first];
28 }
29 
30 std::unique_ptr<BHEBottomDirichletBoundaryCondition>
32  std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices)
33 {
34  DBUG("Constructing BHEBottomDirichletBoundaryCondition.");
35 
36  // In case of partitioned mesh the boundary could be empty, i.e. there is no
37  // boundary condition.
38 #ifdef USE_PETSC
39  // For this special boundary condition the boundary condition is not empty
40  // if the global indices are non-negative.
41  if (in_out_global_indices.first < 0 && in_out_global_indices.second < 0)
42  {
43  return nullptr;
44  }
45  // If only one of the global indices (in or out) is negative the
46  // implementation is not valid.
47  if (in_out_global_indices.first < 0 || in_out_global_indices.second < 0)
48  {
49  OGS_FATAL(
50  "The partition cuts the BHE into two independent parts. This "
51  "behaviour is not implemented.");
52  }
53 #endif // USE_PETSC
54 
55  return std::make_unique<BHEBottomDirichletBoundaryCondition>(
56  std::move(in_out_global_indices));
57 }
58 } // namespace ProcessLib::HeatTransportBHE
std::pair< GlobalIndexType, GlobalIndexType > const _in_out_global_indices
std::unique_ptr< BHEBottomDirichletBoundaryCondition > createBHEBottomDirichletBoundaryCondition(std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices)
std::vector< IndexType > ids
void getEssentialBCValues(const double t, GlobalVector const &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
Writes the values of essential BCs to bc_values.
#define OGS_FATAL(fmt,...)
Definition: Error.h:63
std::vector< double > values