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
Karsten Rink
ogs
Commits
81ec6a4a
Commit
81ec6a4a
authored
5 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[StaggeredScheme] Modified Process::constructDofTable()
parent
517d0eaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/Process.cpp
+58
-27
58 additions, 27 deletions
ProcessLib/Process.cpp
ProcessLib/Process.h
+22
-0
22 additions, 0 deletions
ProcessLib/Process.h
with
80 additions
and
27 deletions
ProcessLib/Process.cpp
+
58
−
27
View file @
81ec6a4a
...
...
@@ -232,7 +232,21 @@ void Process::assembleWithJacobian(const double t, GlobalVector const& x,
void
Process
::
constructDofTable
()
{
// Create single component dof in every of the mesh's nodes.
if
(
_use_monolithic_scheme
)
{
constructMonolithicProcessDofTable
();
return
;
}
// For staggered scheme:
const
int
specified_prosess_id
=
0
;
constructDofTableOfSpecifiedProsessStaggerdScheme
(
specified_prosess_id
);
}
void
Process
::
constructMonolithicProcessDofTable
()
{
// Create single component dof in every of the mesh nodes.
_mesh_subset_all_nodes
=
std
::
make_unique
<
MeshLib
::
MeshSubset
>
(
_mesh
,
_mesh
.
getNodes
());
...
...
@@ -241,41 +255,58 @@ void Process::constructDofTable()
// Vector of the number of variable components
std
::
vector
<
int
>
vec_var_n_components
;
if
(
_use_monolithic_scheme
)
// Collect the mesh subsets in a vector for the components of each
// variables.
for
(
ProcessVariable
const
&
pv
:
_process_variables
[
0
])
{
// Collect the mesh subsets in a vector for each variables' components.
for
(
ProcessVariable
const
&
pv
:
_process_variables
[
0
])
{
std
::
generate_n
(
std
::
back_inserter
(
all_mesh_subsets
),
pv
.
getNumberOfComponents
(),
[
&
]()
{
return
*
_mesh_subset_all_nodes
;
});
}
// Create a vector of the number of variable components
for
(
ProcessVariable
const
&
pv
:
_process_variables
[
0
])
{
vec_var_n_components
.
push_back
(
pv
.
getNumberOfComponents
());
}
}
else
// for staggered scheme
{
// Assuming that all equations of the coupled process use the same
// element order. Other cases can be considered by overloading this
// member function in the derived class.
// Collect the mesh subsets in a vector for each variables' components.
std
::
generate_n
(
std
::
back_inserter
(
all_mesh_subsets
),
_process_variables
[
0
][
0
].
get
()
.
getNumberOfComponents
(),
pv
.
getNumberOfComponents
(),
[
&
]()
{
return
*
_mesh_subset_all_nodes
;
});
}
// Create a vector of the number of variable components.
vec_var_n_components
.
push_back
(
_process_variables
[
0
][
0
].
get
().
getNumberOfComponents
());
// Create a vector of the number of variable components
for
(
ProcessVariable
const
&
pv
:
_process_variables
[
0
])
{
vec_var_n_components
.
push_back
(
pv
.
getNumberOfComponents
());
}
_local_to_global_index_map
=
std
::
make_unique
<
NumLib
::
LocalToGlobalIndexMap
>
(
std
::
move
(
all_mesh_subsets
),
vec_var_n_components
,
NumLib
::
ComponentOrder
::
BY_LOCATION
);
assert
(
_local_to_global_index_map
);
}
void
Process
::
constructDofTableOfSpecifiedProsessStaggerdScheme
(
const
int
specified_prosess_id
)
{
// Create single component dof in every of the mesh nodes.
_mesh_subset_all_nodes
=
std
::
make_unique
<
MeshLib
::
MeshSubset
>
(
_mesh
,
_mesh
.
getNodes
());
// Vector of mesh subsets.
std
::
vector
<
MeshLib
::
MeshSubset
>
all_mesh_subsets
;
// Vector of the number of variable components
std
::
vector
<
int
>
vec_var_n_components
;
// Collect the mesh subsets in a vector for each variables' components.
std
::
generate_n
(
std
::
back_inserter
(
all_mesh_subsets
),
_process_variables
[
specified_prosess_id
][
0
]
.
get
()
.
getNumberOfComponents
(),
[
&
]()
{
return
*
_mesh_subset_all_nodes
;
});
// Create a vector of the number of variable components.
vec_var_n_components
.
push_back
(
_process_variables
[
specified_prosess_id
][
0
]
.
get
()
.
getNumberOfComponents
());
_local_to_global_index_map
=
std
::
make_unique
<
NumLib
::
LocalToGlobalIndexMap
>
(
std
::
move
(
all_mesh_subsets
),
vec_var_n_components
,
NumLib
::
ComponentOrder
::
BY_LOCATION
);
assert
(
_local_to_global_index_map
);
}
std
::
tuple
<
NumLib
::
LocalToGlobalIndexMap
*
,
bool
>
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/Process.h
+
22
−
0
View file @
81ec6a4a
...
...
@@ -235,8 +235,30 @@ private:
}
protected
:
/** This function is for general cases, in which all equations of the
coupled processes have the same number of unknowns. For the general cases
with the staggered scheme, all equations of the coupled processes share one
DOF table hold by \verb{_local_to_global_index_map}. Other cases can be
considered by overloading this member function in the
derived class.
*/
virtual
void
constructDofTable
();
/**
* Construct the DOF table for the monolithic scheme,
* which is stored in the
* member of this class, \verb{_local_to_global_index_map}.
*/
void
constructMonolithicProcessDofTable
();
/**
* Construct the DOF table for a specified process in the staggered scheme,
* which is stored in the
* member of this class, \verb{_local_to_global_index_map}.
*/
void
constructDofTableOfSpecifiedProsessStaggerdScheme
(
const
int
specified_prosess_id
);
/**
* Get the address of a LocalToGlobalIndexMap, and the status of its memory.
* If the LocalToGlobalIndexMap is created as new in this function, the
...
...
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