OGS
BHEBottomDirichletBoundaryCondition.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include "BaseLib/Error.h"
7
9{
11 const double /*t*/, GlobalVector const& x,
13{
14 bc_values.ids.resize(1);
15 bc_values.values.resize(1);
16
17 bc_values.ids[0] = _in_out_global_indices.second;
18 // here, the outflow temperature is always
19 // the same as the inflow temperature
20 // get the inflow temperature from here.
21 bc_values.values[0] = x[_in_out_global_indices.first];
22}
23
24std::unique_ptr<BHEBottomDirichletBoundaryCondition>
26 std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices)
27{
28 DBUG("Constructing BHEBottomDirichletBoundaryCondition.");
29
30 // In case of partitioned mesh the boundary could be empty, i.e. there is no
31 // boundary condition.
32#ifdef USE_PETSC
33 // For this special boundary condition the boundary condition is not empty
34 // if the global indices are non-negative.
35 if (in_out_global_indices.first < 0 && in_out_global_indices.second < 0)
36 {
37 return nullptr;
38 }
39 // If only one of the global indices (in or out) is negative the
40 // implementation is not valid.
41 if (in_out_global_indices.first < 0 || in_out_global_indices.second < 0)
42 {
44 "The partition cuts the BHE into two independent parts. This "
45 "behaviour is not implemented.");
46 }
47#endif // USE_PETSC
48
49 return std::make_unique<BHEBottomDirichletBoundaryCondition>(
50 std::move(in_out_global_indices));
51}
52} // namespace ProcessLib::HeatTransportBHE
#define OGS_FATAL(...)
Definition Error.h:19
MathLib::EigenVector GlobalVector
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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