Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
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
Feliks Kiszkurno
ogs-feliks
Commits
6de09174
Commit
6de09174
authored
4 years ago
by
renchao.lu
Committed by
renchao.lu
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Retrieve local process solutions.
parent
392feaa6
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/LocalAssemblerInterface.cpp
+26
-6
26 additions, 6 deletions
ProcessLib/LocalAssemblerInterface.cpp
ProcessLib/LocalAssemblerInterface.h
+5
-5
5 additions, 5 deletions
ProcessLib/LocalAssemblerInterface.h
with
31 additions
and
11 deletions
ProcessLib/LocalAssemblerInterface.cpp
+
26
−
6
View file @
6de09174
...
...
@@ -9,10 +9,12 @@
*/
#include
"LocalAssemblerInterface.h"
#include
<cassert>
#include
"NumLib/DOF/DOFTableUtil.h"
#include
"CoupledSolutionsForStaggeredScheme.h"
#include
"MathLib/LinAlg/Eigen/EigenMapTools.h"
#include
"NumLib/DOF/DOFTableUtil.h"
namespace
ProcessLib
{
...
...
@@ -71,12 +73,30 @@ void LocalAssemblerInterface::assembleWithJacobianForStaggeredScheme(
void
LocalAssemblerInterface
::
computeSecondaryVariable
(
std
::
size_t
const
mesh_item_id
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
double
const
t
,
double
const
dt
,
GlobalVector
const
&
x
,
GlobalVector
const
&
x_dot
)
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
const
&
dof_tables
,
double
const
t
,
double
const
dt
,
std
::
vector
<
GlobalVector
*>
const
&
x
,
GlobalVector
const
&
x_dot
,
int
const
process_id
)
{
auto
const
indices
=
NumLib
::
getIndices
(
mesh_item_id
,
dof_table
);
auto
const
local_x
=
x
.
get
(
indices
);
auto
const
local_x_dot
=
x_dot
.
get
(
indices
);
std
::
vector
<
double
>
local_x_vec
;
auto
const
n_processes
=
x
.
size
();
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
auto
const
indices
=
NumLib
::
getIndices
(
mesh_item_id
,
*
dof_tables
[
process_id
]);
assert
(
!
indices
.
empty
());
auto
const
local_solution
=
x
[
process_id
]
->
get
(
indices
);
local_x_vec
.
insert
(
std
::
end
(
local_x_vec
),
std
::
begin
(
local_solution
),
std
::
end
(
local_solution
));
}
auto
const
local_x
=
MathLib
::
toVector
(
local_x_vec
);
// Todo: A more decent way is to directly pass x_dots as done for x
auto
const
indices
=
NumLib
::
getIndices
(
mesh_item_id
,
*
dof_tables
[
process_id
]);
auto
const
local_x_dot_vec
=
x_dot
.
get
(
indices
);
auto
const
local_x_dot
=
MathLib
::
toVector
(
local_x_dot_vec
);
computeSecondaryVariableConcrete
(
t
,
dt
,
local_x
,
local_x_dot
);
}
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/LocalAssemblerInterface.h
+
5
−
5
View file @
6de09174
...
...
@@ -80,9 +80,9 @@ public:
virtual
void
computeSecondaryVariable
(
std
::
size_t
const
mesh_item_id
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
double
const
t
,
double
const
d
t
,
GlobalVector
const
&
local_
x
,
GlobalVector
const
&
local_x_dot
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
const
&
dof_table
s
,
double
const
t
,
double
const
dt
,
std
::
vector
<
GlobalVector
*>
const
&
x
,
GlobalVector
const
&
x_dot
,
int
const
process_id
);
virtual
void
preTimestep
(
std
::
size_t
const
mesh_item_id
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
...
...
@@ -157,8 +157,8 @@ private:
virtual
void
computeSecondaryVariableConcrete
(
double
const
/*t*/
,
double
const
/*dt*/
,
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
std
::
v
ector
<
double
>
const
&
/*local_x_dot*/
)
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
Eigen
::
V
ector
Xd
const
&
/*local_x_dot*/
)
{
}
...
...
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