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
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
Yuhao Liu
ogs
Commits
5ad524d2
Commit
5ad524d2
authored
3 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[PL/DS] Extract also the outer nodes.
parent
897541b9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ProcessLib/CreateDeactivatedSubdomain.cpp
+26
-21
26 additions, 21 deletions
ProcessLib/CreateDeactivatedSubdomain.cpp
ProcessLib/DeactivatedSubdomain.cpp
+4
-2
4 additions, 2 deletions
ProcessLib/DeactivatedSubdomain.cpp
ProcessLib/DeactivatedSubdomain.h
+3
-1
3 additions, 1 deletion
ProcessLib/DeactivatedSubdomain.h
with
33 additions
and
24 deletions
ProcessLib/CreateDeactivatedSubdomain.cpp
+
26
−
21
View file @
5ad524d2
...
@@ -21,10 +21,10 @@
...
@@ -21,10 +21,10 @@
namespace
ProcessLib
namespace
ProcessLib
{
{
template
<
typename
IsActive
>
template
<
typename
IsActive
>
static
std
::
vector
<
MeshLib
::
Node
*>
extractInner
Node
s
(
static
std
::
pair
<
std
::
vector
<
MeshLib
::
Node
*>
,
std
::
vector
<
MeshLib
::
Node
*>>
MeshLib
::
Mesh
const
&
mesh
,
extractInnerAndOuterNodes
(
MeshLib
::
Mesh
const
&
mesh
,
MeshLib
::
Mesh
const
&
sub_mesh
,
MeshLib
::
Mesh
const
&
sub_mesh
,
IsActive
is_active
)
IsActive
is_active
)
{
{
auto
*
const
bulk_node_ids
=
auto
*
const
bulk_node_ids
=
sub_mesh
.
getProperties
().
template
getPropertyVector
<
std
::
size_t
>(
sub_mesh
.
getProperties
().
template
getPropertyVector
<
std
::
size_t
>(
...
@@ -38,21 +38,25 @@ static std::vector<MeshLib::Node*> extractInnerNodes(
...
@@ -38,21 +38,25 @@ static std::vector<MeshLib::Node*> extractInnerNodes(
std
::
vector
<
MeshLib
::
Node
*>
inner_nodes
;
std
::
vector
<
MeshLib
::
Node
*>
inner_nodes
;
// Reserve for more than needed, but not much, because almost all nodes will
// Reserve for more than needed, but not much, because almost all nodes will
// be
found and copied
.
// be
the inner nodes
.
inner_nodes
.
reserve
(
sub_mesh
.
getNumberOfNodes
());
inner_nodes
.
reserve
(
sub_mesh
.
getNumberOfNodes
());
std
::
copy_if
(
begin
(
sub_mesh
.
getNodes
()),
end
(
sub_mesh
.
getNodes
()),
back_inserter
(
inner_nodes
),
[
&
](
MeshLib
::
Node
*
const
n
)
{
std
::
vector
<
MeshLib
::
Node
*>
outer_nodes
;
auto
const
bulk_node
=
mesh
.
getNode
((
*
bulk_node_ids
)[
n
->
getID
()]);
std
::
partition_copy
(
const
auto
&
connected_elements
=
bulk_node
->
getElements
();
begin
(
sub_mesh
.
getNodes
()),
end
(
sub_mesh
.
getNodes
()),
back_inserter
(
inner_nodes
),
back_inserter
(
outer_nodes
),
// Check whether this node is connected to an active
[
&
](
MeshLib
::
Node
*
const
n
)
{
// element.
auto
const
bulk_node
=
mesh
.
getNode
((
*
bulk_node_ids
)[
n
->
getID
()]);
return
std
::
all_of
(
begin
(
connected_elements
),
const
auto
&
connected_elements
=
bulk_node
->
getElements
();
end
(
connected_elements
),
is_active
);
});
// Check whether this node is connected only to an active
// elements. Then it is an inner node, and outer otherwise.
return
inner_nodes
;
return
std
::
all_of
(
begin
(
connected_elements
),
end
(
connected_elements
),
is_active
);
});
return
{
std
::
move
(
inner_nodes
),
std
::
move
(
outer_nodes
)};
}
}
static
std
::
unique_ptr
<
DeactivatedSubdomainMesh
>
createDeactivatedSubdomainMesh
(
static
std
::
unique_ptr
<
DeactivatedSubdomainMesh
>
createDeactivatedSubdomainMesh
(
...
@@ -75,9 +79,10 @@ static std::unique_ptr<DeactivatedSubdomainMesh> createDeactivatedSubdomainMesh(
...
@@ -75,9 +79,10 @@ static std::unique_ptr<DeactivatedSubdomainMesh> createDeactivatedSubdomainMesh(
"deactivate_subdomain_"
+
std
::
to_string
(
material_id
),
"deactivate_subdomain_"
+
std
::
to_string
(
material_id
),
MeshLib
::
cloneElements
(
deactivated_elements
));
MeshLib
::
cloneElements
(
deactivated_elements
));
auto
inner_nodes
=
extractInnerNodes
(
mesh
,
*
sub_mesh
,
is_active
);
auto
[
inner_nodes
,
outer_nodes
]
=
return
std
::
make_unique
<
DeactivatedSubdomainMesh
>
(
std
::
move
(
sub_mesh
),
extractInnerAndOuterNodes
(
mesh
,
*
sub_mesh
,
is_active
);
std
::
move
(
inner_nodes
));
return
std
::
make_unique
<
DeactivatedSubdomainMesh
>
(
std
::
move
(
sub_mesh
),
std
::
move
(
inner_nodes
),
std
::
move
(
outer_nodes
));
}
}
static
MathLib
::
PiecewiseLinearInterpolation
parseTimeIntervalOrCurve
(
static
MathLib
::
PiecewiseLinearInterpolation
parseTimeIntervalOrCurve
(
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/DeactivatedSubdomain.cpp
+
4
−
2
View file @
5ad524d2
...
@@ -24,9 +24,11 @@ const std::string DeactivatedSubdomain::zero_parameter_name =
...
@@ -24,9 +24,11 @@ const std::string DeactivatedSubdomain::zero_parameter_name =
DeactivatedSubdomainMesh
::
DeactivatedSubdomainMesh
(
DeactivatedSubdomainMesh
::
DeactivatedSubdomainMesh
(
std
::
unique_ptr
<
MeshLib
::
Mesh
>
deactivated_subdomain_mesh_
,
std
::
unique_ptr
<
MeshLib
::
Mesh
>
deactivated_subdomain_mesh_
,
std
::
vector
<
MeshLib
::
Node
*>&&
inner_nodes_
)
std
::
vector
<
MeshLib
::
Node
*>&&
inner_nodes_
,
std
::
vector
<
MeshLib
::
Node
*>&&
outer_nodes_
)
:
mesh
(
std
::
move
(
deactivated_subdomain_mesh_
)),
:
mesh
(
std
::
move
(
deactivated_subdomain_mesh_
)),
inner_nodes
(
std
::
move
(
inner_nodes_
))
inner_nodes
(
std
::
move
(
inner_nodes_
)),
outer_nodes
(
std
::
move
(
outer_nodes_
))
{
{
}
}
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/DeactivatedSubdomain.h
+
3
−
1
View file @
5ad524d2
...
@@ -32,10 +32,12 @@ struct DeactivatedSubdomainMesh
...
@@ -32,10 +32,12 @@ struct DeactivatedSubdomainMesh
{
{
DeactivatedSubdomainMesh
(
DeactivatedSubdomainMesh
(
std
::
unique_ptr
<
MeshLib
::
Mesh
>
deactivated_subdomain_mesh_
,
std
::
unique_ptr
<
MeshLib
::
Mesh
>
deactivated_subdomain_mesh_
,
std
::
vector
<
MeshLib
::
Node
*>&&
inner_nodes_
);
std
::
vector
<
MeshLib
::
Node
*>&&
inner_nodes_
,
std
::
vector
<
MeshLib
::
Node
*>&&
outer_nodes_
);
std
::
unique_ptr
<
MeshLib
::
Mesh
>
const
mesh
;
std
::
unique_ptr
<
MeshLib
::
Mesh
>
const
mesh
;
std
::
vector
<
MeshLib
::
Node
*>
const
inner_nodes
;
std
::
vector
<
MeshLib
::
Node
*>
const
inner_nodes
;
std
::
vector
<
MeshLib
::
Node
*>
const
outer_nodes
;
};
};
/// Time depend subdomain deactivation.
/// Time depend subdomain deactivation.
...
...
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