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
Chaofan Chen
ogs
Commits
34712f95
Commit
34712f95
authored
8 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[NL] Add multicomponent MeshComponentMap::getSubset().
parent
4a99140b
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
NumLib/DOF/MeshComponentMap.cpp
+30
-0
30 additions, 0 deletions
NumLib/DOF/MeshComponentMap.cpp
NumLib/DOF/MeshComponentMap.h
+16
-1
16 additions, 1 deletion
NumLib/DOF/MeshComponentMap.h
with
46 additions
and
1 deletion
NumLib/DOF/MeshComponentMap.cpp
+
30
−
0
View file @
34712f95
...
...
@@ -176,6 +176,36 @@ MeshComponentMap MeshComponentMap::getSubset(
return
MeshComponentMap
(
subset_dict
,
1
);
}
MeshComponentMap
MeshComponentMap
::
getSubset
(
std
::
vector
<
std
::
size_t
>
const
&
component_ids
,
MeshLib
::
MeshSubsets
const
&
mesh_subsets
)
const
{
assert
(
component_ids
.
size
()
<=
_num_components
);
// New dictionary for the subset.
ComponentGlobalIndexDict
subset_dict
;
for
(
auto
const
&
mesh_subset
:
mesh_subsets
)
{
std
::
size_t
const
mesh_id
=
mesh_subset
->
getMeshID
();
// Lookup the locations in the current mesh component map and
// insert the full lines into the subset dictionary.
for
(
std
::
size_t
j
=
0
;
j
<
mesh_subset
->
getNumberOfNodes
();
j
++
)
for
(
std
::
size_t
component_id
:
component_ids
)
subset_dict
.
insert
(
getLine
(
Location
(
mesh_id
,
MeshLib
::
MeshItemType
::
Node
,
mesh_subset
->
getNodeID
(
j
)),
component_id
));
for
(
std
::
size_t
j
=
0
;
j
<
mesh_subset
->
getNumberOfElements
();
j
++
)
for
(
std
::
size_t
component_id
:
component_ids
)
subset_dict
.
insert
(
getLine
(
Location
(
mesh_id
,
MeshLib
::
MeshItemType
::
Cell
,
mesh_subset
->
getElementID
(
j
)),
component_id
));
}
return
MeshComponentMap
(
subset_dict
,
1
);
}
void
MeshComponentMap
::
renumberByLocation
(
GlobalIndexType
offset
)
{
GlobalIndexType
global_index
=
offset
;
...
...
This diff is collapsed.
Click to expand it.
NumLib/DOF/MeshComponentMap.h
+
16
−
1
View file @
34712f95
...
...
@@ -45,9 +45,24 @@ public:
/// The order (BY_LOCATION/BY_COMPONENT) of components is the same as of the
/// current map.
///
/// This is single-component version.
///
/// \param component_id The global components id.
/// \param components components that should remain in the created subset
MeshComponentMap
getSubset
(
std
::
size_t
const
component_id
,
MeshComponentMap
getSubset
(
std
::
size_t
const
component_ids
,
MeshLib
::
MeshSubsets
const
&
components
)
const
;
/// Creates a multi-component subset of the current mesh component map.
/// The order (BY_LOCATION/BY_COMPONENT) of components is the same as of the
/// current map.
///
/// This is multi-component version.
///
/// \note For each component the same mesh subset will be used.
///
/// \param component_ids The vector of global components id.
/// \param components components that should remain in the created subset
MeshComponentMap
getSubset
(
std
::
vector
<
std
::
size_t
>
const
&
component_ids
,
MeshLib
::
MeshSubsets
const
&
components
)
const
;
/// The number of dofs including the those located in the ghost nodes.
...
...
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