Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
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
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
MostafaMollaali
dynamic
Commits
4adfc2b0
Commit
4adfc2b0
authored
6 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[PL/ComponentTransport] Exec. calc. of sfc flux.
parent
9c2cb2cf
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/ComponentTransport/ComponentTransportProcess.cpp
+53
-0
53 additions, 0 deletions
ProcessLib/ComponentTransport/ComponentTransportProcess.cpp
ProcessLib/ComponentTransport/ComponentTransportProcess.h
+5
-0
5 additions, 0 deletions
ProcessLib/ComponentTransport/ComponentTransportProcess.h
with
58 additions
and
0 deletions
ProcessLib/ComponentTransport/ComponentTransportProcess.cpp
+
53
−
0
View file @
4adfc2b0
...
...
@@ -11,6 +11,11 @@
#include
<cassert>
// TODO used for output, if output classes are ready this has to be changed
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h"
#include
"ProcessLib/Utils/CreateLocalAssemblers.h"
namespace
ProcessLib
...
...
@@ -105,6 +110,54 @@ Eigen::Vector3d ComponentTransportProcess::getFlux(std::size_t const element_id,
return
_local_assemblers
[
element_id
]
->
getFlux
(
p
,
t
,
local_x
);
}
void
ComponentTransportProcess
::
postTimestepConcreteProcess
(
GlobalVector
const
&
x
,
const
double
t
,
const
double
/*delta_t*/
,
int
const
process_id
)
{
// For the monolithic scheme, process_id is always zero.
if
(
_use_monolithic_scheme
&&
process_id
!=
0
)
{
OGS_FATAL
(
"The condition of process_id = 0 must be satisfied for "
"monolithic ComponentTransportProcess, which is a single process."
);
}
if
(
!
_use_monolithic_scheme
&&
process_id
!=
1
)
{
DBUG
(
"This is the transport part of the staggered "
"ComponentTransportProcess."
);
return
;
}
if
(
!
_balance_mesh
)
// computing the balance is optional
{
return
;
}
auto
*
const
balance_pv
=
MeshLib
::
getOrCreateMeshProperty
<
double
>
(
*
_balance_mesh
,
_balance_pv_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_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
// TODO output, if output classes are ready this has to be
// changed
std
::
string
const
fname
=
BaseLib
::
dropFileExtension
(
_balance_out_fname
)
+
"_t_"
+
std
::
to_string
(
t
)
+
".vtu"
;
MeshLib
::
IO
::
writeMeshToFile
(
*
_balance_mesh
,
fname
);
}
}
// namespace ComponentTransport
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/ComponentTransport/ComponentTransportProcess.h
+
5
−
0
View file @
4adfc2b0
...
...
@@ -111,6 +111,11 @@ public:
MathLib
::
Point3d
const
&
p
,
double
const
t
,
GlobalVector
const
&
x
)
const
override
;
void
postTimestepConcreteProcess
(
GlobalVector
const
&
x
,
const
double
t
,
const
double
delta_t
,
int
const
process_id
)
override
;
private
:
void
initializeConcreteProcess
(
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
...
...
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