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