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
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
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
wenqing
ogs
Commits
adcc2658
Commit
adcc2658
authored
6 years ago
by
Tom Fischer
Committed by
Dmitri Naumov
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Move balance calculation to class Balance.
parent
c0d6f47f
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/CalculateSurfaceFlux/Balance.h
+22
-0
22 additions, 0 deletions
ProcessLib/CalculateSurfaceFlux/Balance.h
ProcessLib/HT/HTProcess.cpp
+1
-18
1 addition, 18 deletions
ProcessLib/HT/HTProcess.cpp
with
23 additions
and
18 deletions
ProcessLib/CalculateSurfaceFlux/Balance.h
+
22
−
0
View file @
adcc2658
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
// TODO used for output, if output classes are ready this has to be changed
// TODO used for output, if output classes are ready this has to be changed
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h"
namespace
ProcessLib
namespace
ProcessLib
{
{
struct
Balance
struct
Balance
...
@@ -44,6 +46,26 @@ struct Balance
...
@@ -44,6 +46,26 @@ struct Balance
output_mesh_file_name
.
c_str
());
output_mesh_file_name
.
c_str
());
}
}
void
integrate
(
GlobalVector
const
&
x
,
double
const
t
,
Process
const
&
p
,
int
const
process_id
,
int
const
integration_order
,
MeshLib
::
Mesh
const
&
bulk_mesh
)
{
auto
*
const
balance_pv
=
MeshLib
::
getOrCreateMeshProperty
<
double
>
(
surface_mesh
,
property_vector_name
,
MeshLib
::
MeshItemType
::
Cell
,
1
);
// initialise the PropertyVector pv with zero values
std
::
fill
(
balance_pv
->
begin
(),
balance_pv
->
end
(),
0.0
);
auto
balance
=
ProcessLib
::
CalculateSurfaceFlux
(
surface_mesh
,
p
.
getProcessVariables
(
process_id
)[
0
].
get
().
getNumberOfComponents
(),
integration_order
);
balance
.
integrate
(
x
,
*
balance_pv
,
t
,
bulk_mesh
,
[
&
p
](
std
::
size_t
const
element_id
,
MathLib
::
Point3d
const
&
pnt
,
double
const
t
,
GlobalVector
const
&
x
)
{
return
p
.
getFlux
(
element_id
,
pnt
,
t
,
x
);
});
}
void
save
(
double
const
t
)
const
void
save
(
double
const
t
)
const
{
{
// TODO (TomFischer) output, if output classes are ready this has to be
// TODO (TomFischer) output, if output classes are ready this has to be
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/HT/HTProcess.cpp
+
1
−
18
View file @
adcc2658
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
#include
"NumLib/DOF/DOFTableUtil.h"
#include
"NumLib/DOF/DOFTableUtil.h"
#include
"NumLib/DOF/LocalToGlobalIndexMap.h"
#include
"NumLib/DOF/LocalToGlobalIndexMap.h"
#include
"ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h"
#include
"ProcessLib/Utils/CreateLocalAssemblers.h"
#include
"ProcessLib/Utils/CreateLocalAssemblers.h"
#include
"HTMaterialProperties.h"
#include
"HTMaterialProperties.h"
...
@@ -272,23 +271,7 @@ void HTProcess::postTimestepConcreteProcess(GlobalVector const& x,
...
@@ -272,23 +271,7 @@ void HTProcess::postTimestepConcreteProcess(GlobalVector const& x,
{
{
return
;
return
;
}
}
auto
*
const
balance_pv
=
MeshLib
::
getOrCreateMeshProperty
<
double
>
(
_balance
->
integrate
(
x
,
t
,
*
this
,
process_id
,
_integration_order
,
_mesh
);
_balance
->
surface_mesh
,
_balance
->
property_vector_name
,
MeshLib
::
MeshItemType
::
Cell
,
1
);
// initialise the PropertyVector pv with zero values
std
::
fill
(
balance_pv
->
begin
(),
balance_pv
->
end
(),
0.0
);
auto
balance
=
ProcessLib
::
CalculateSurfaceFlux
(
_balance
->
surface_mesh
,
getProcessVariables
(
process_id
)[
0
].
get
().
getNumberOfComponents
(),
_integration_order
);
balance
.
integrate
(
x
,
*
balance_pv
,
t
,
_mesh
,
[
this
](
std
::
size_t
const
element_id
,
MathLib
::
Point3d
const
&
pnt
,
double
const
t
,
GlobalVector
const
&
x
)
{
return
getFlux
(
element_id
,
pnt
,
t
,
x
);
});
// post: surface_mesh has scalar element property
_balance
->
save
(
t
);
_balance
->
save
(
t
);
}
}
...
...
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