Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mojtaba Abdolkhani
ogs
Commits
8a75d92a
Commit
8a75d92a
authored
6 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Resolve circular dep. HTBHE<->BC.
Passing the bhe type to the BCs is not necessary, just a callback.
parent
b8976eea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/BoundaryCondition/BHEInflowDirichletBoundaryCondition.h
+12
-11
12 additions, 11 deletions
...b/BoundaryCondition/BHEInflowDirichletBoundaryCondition.h
ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp
+3
-1
3 additions, 1 deletion
ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp
with
15 additions
and
12 deletions
ProcessLib/BoundaryCondition/BHEInflowDirichletBoundaryCondition.h
+
12
−
11
View file @
8a75d92a
...
@@ -11,18 +11,18 @@
...
@@ -11,18 +11,18 @@
#include
"BoundaryCondition.h"
#include
"BoundaryCondition.h"
#include
"NumLib/IndexValueVector.h"
#include
"NumLib/IndexValueVector.h"
#include
"ProcessLib/HeatTransportBHE/BHE/BHETypes.h"
namespace
ProcessLib
namespace
ProcessLib
{
{
template
<
typename
BHE
Type
>
template
<
typename
BHE
UpdateCallback
>
class
BHEInflowDirichletBoundaryCondition
final
:
public
BoundaryCondition
class
BHEInflowDirichletBoundaryCondition
final
:
public
BoundaryCondition
{
{
public:
public:
BHEInflowDirichletBoundaryCondition
(
BHEInflowDirichletBoundaryCondition
(
std
::
pair
<
GlobalIndexType
,
GlobalIndexType
>&&
in_out_global_indices
,
std
::
pair
<
GlobalIndexType
,
GlobalIndexType
>&&
in_out_global_indices
,
BHEType
&
bhe
)
BHEUpdateCallback
bhe_update_callback
)
:
_in_out_global_indices
(
std
::
move
(
in_out_global_indices
)),
_bhe
(
bhe
)
:
_in_out_global_indices
(
std
::
move
(
in_out_global_indices
)),
_bhe_update_callback
(
bhe_update_callback
)
{
{
}
}
...
@@ -36,19 +36,19 @@ public:
...
@@ -36,19 +36,19 @@ public:
bc_values
.
ids
[
0
]
=
_in_out_global_indices
.
first
;
bc_values
.
ids
[
0
]
=
_in_out_global_indices
.
first
;
// here call the corresponding BHE functions
// here call the corresponding BHE functions
auto
const
T_out
=
x
[
_in_out_global_indices
.
second
];
auto
const
T_out
=
x
[
_in_out_global_indices
.
second
];
bc_values
.
values
[
0
]
=
_bhe
.
update
FlowRateAndTemperature
(
T_out
,
t
);
bc_values
.
values
[
0
]
=
_bhe
_
update
_callback
(
T_out
,
t
);
}
}
private
:
private
:
std
::
pair
<
GlobalIndexType
,
GlobalIndexType
>
const
_in_out_global_indices
;
std
::
pair
<
GlobalIndexType
,
GlobalIndexType
>
const
_in_out_global_indices
;
BHE
Type
&
_bhe
;
BHE
UpdateCallback
_bhe_update_callback
;
};
};
template
<
typename
BHE
Type
>
template
<
typename
BHE
UpdateCallback
>
std
::
unique_ptr
<
BHEInflowDirichletBoundaryCondition
<
BHE
Type
>>
std
::
unique_ptr
<
BHEInflowDirichletBoundaryCondition
<
BHE
UpdateCallback
>>
createBHEInflowDirichletBoundaryCondition
(
createBHEInflowDirichletBoundaryCondition
(
std
::
pair
<
GlobalIndexType
,
GlobalIndexType
>&&
in_out_global_indices
,
std
::
pair
<
GlobalIndexType
,
GlobalIndexType
>&&
in_out_global_indices
,
BHE
Type
&
bhe
)
BHE
UpdateCallback
bhe_update_callback
)
{
{
DBUG
(
"Constructing BHEInflowDirichletBoundaryCondition."
);
DBUG
(
"Constructing BHEInflowDirichletBoundaryCondition."
);
...
@@ -71,7 +71,8 @@ createBHEInflowDirichletBoundaryCondition(
...
@@ -71,7 +71,8 @@ createBHEInflowDirichletBoundaryCondition(
}
}
#endif // USE_PETSC
#endif // USE_PETSC
return
std
::
make_unique
<
BHEInflowDirichletBoundaryCondition
<
BHEType
>>
(
return
std
::
make_unique
<
std
::
move
(
in_out_global_indices
),
bhe
);
BHEInflowDirichletBoundaryCondition
<
BHEUpdateCallback
>>
(
std
::
move
(
in_out_global_indices
),
bhe_update_callback
);
}
}
}
// namespace ProcessLib
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp
+
3
−
1
View file @
8a75d92a
...
@@ -244,7 +244,9 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(
...
@@ -244,7 +244,9 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(
ProcessLib
::
createBHEInflowDirichletBoundaryCondition
(
ProcessLib
::
createBHEInflowDirichletBoundaryCondition
(
get_global_bhe_bc_indices
(
bc_top_node_id
,
get_global_bhe_bc_indices
(
bc_top_node_id
,
in_out_component_id
),
in_out_component_id
),
bhe
));
[
&
bhe
](
double
const
T
,
double
const
t
)
{
return
bhe
.
updateFlowRateAndTemperature
(
T
,
t
);
}));
// Bottom, outflow.
// Bottom, outflow.
bcs
.
addBoundaryCondition
(
bcs
.
addBoundaryCondition
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment