Skip to content
Snippets Groups Projects
Commit f42ee384 authored by HBShaoUFZ's avatar HBShaoUFZ Committed by Dmitri Naumov
Browse files

Modified the passes in bcs.addBoundaryCondition for BHEInflowPythonBoundaryCondition

Modified the template typename in BHEInflwoPythonBoundaryCondition.h

fixed unused parameter x problem in BHEInflowPythonBoundaryConditoin
adding missing \file
parent beefb2ed
No related branches found
No related tags found
No related merge requests found
......@@ -29,16 +29,16 @@
namespace ProcessLib
{
//! A boundary condition whose values are computed by a Python script.
template <typename BHEUpdateCallback>
template <typename BHEType>
class BHEInflowPythonBoundaryCondition final : public BoundaryCondition
{
public:
BHEInflowPythonBoundaryCondition(
std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices,
BHEUpdateCallback bhe_update_callback,
BHEType& bhe,
BHEInflowPythonBoundaryConditionPythonSideInterface& py_bc_object)
: _in_out_global_indices(std::move(in_out_global_indices)),
_bhe_update_callback(bhe_update_callback),
_bhe(bhe),
_py_bc_object(py_bc_object)
{
const auto g_idx_T_out = in_out_global_indices.second;
......@@ -48,7 +48,7 @@ public:
}
void getEssentialBCValues(
const double t, const GlobalVector& x,
const double t, const GlobalVector& /* x */,
NumLib::IndexValueVector<GlobalIndexType>& bc_values) const override
{
bc_values.ids.resize(1);
......@@ -86,15 +86,15 @@ public:
private:
std::pair<GlobalIndexType, GlobalIndexType> const _in_out_global_indices;
BHEUpdateCallback _bhe_update_callback;
BHEType& _bhe;
BHEInflowPythonBoundaryConditionPythonSideInterface& _py_bc_object;
};
template <typename BHEUpdateCallback>
std::unique_ptr<BHEInflowPythonBoundaryCondition<BHEUpdateCallback>>
template <typename BHEType>
std::unique_ptr<BHEInflowPythonBoundaryCondition<BHEType>>
createBHEInflowPythonBoundaryCondition(
std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices,
BHEUpdateCallback bhe_update_callback,
BHEType& bhe,
BHEInflowPythonBoundaryConditionPythonSideInterface& py_bc_object)
{
......@@ -118,8 +118,7 @@ createBHEInflowPythonBoundaryCondition(
"behaviour is not implemented.");
}
#endif // USE_PETSC
return std::make_unique<
BHEInflowPythonBoundaryCondition<BHEUpdateCallback>>(
std::move(in_out_global_indices), bhe_update_callback, py_bc_object);
return std::make_unique<BHEInflowPythonBoundaryCondition<BHEType>>(
std::move(in_out_global_indices), bhe, py_bc_object);
}
} // namespace ProcessLib
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
......
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
......
......@@ -12,6 +12,8 @@
#include <cassert>
#include "BoundaryConditions/BHEBottomDirichletBoundaryCondition.h"
#include "BoundaryConditions/BHEInflowDirichletBoundaryCondition.h"
#include "ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h"
#include "ProcessLib/BoundaryCondition/BHEInflowDirichletBoundaryCondition.h"
#include "ProcessLib/BoundaryCondition/Python/BHEInflowPythonBoundaryCondition.h"
......@@ -306,10 +308,7 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(
ProcessLib::createBHEInflowPythonBoundaryCondition(
get_global_bhe_bc_indices(bc_top_node_id,
in_out_component_id),
[&bhe](double const T, double const t) {
return bhe.updateFlowRateAndTemperature(T,
t);
},
bhe,
*(_process_data.py_bc_object)));
}
else
......@@ -328,7 +327,7 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(
{
// Top, inflow, normal case
bcs.addBoundaryCondition(
ProcessLib::createBHEInflowDirichletBoundaryCondition(
createBHEInflowDirichletBoundaryCondition(
get_global_bhe_bc_indices(bc_top_node_id,
in_out_component_id),
[&bhe](double const T, double const t) {
......@@ -337,7 +336,7 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(
}
// Bottom, outflow, all cases
bcs.addBoundaryCondition(
ProcessLib::createBHEBottomDirichletBoundaryCondition(
createBHEBottomDirichletBoundaryCondition(
get_global_bhe_bc_indices(bc_bottom_node_id,
in_out_component_id)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment