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