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
Dmitri Naumov
ogs
Commits
a712b889
Commit
a712b889
authored
9 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MeL/MG] LayeredMeshGenerator: Use PV instead of getValue()/setValue().
parent
8c503f54
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
MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
+26
-11
26 additions, 11 deletions
MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
MeshLib/MeshGenerators/LayeredMeshGenerator.h
+1
-0
1 addition, 0 deletions
MeshLib/MeshGenerators/LayeredMeshGenerator.h
with
27 additions
and
11 deletions
MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
+
26
−
11
View file @
a712b889
...
...
@@ -17,6 +17,8 @@
#include
<vector>
#include
<fstream>
#include
<logog/include/logog.hpp>
#include
"FileIO/AsciiRasterInterface.h"
#include
"GeoLib/Raster.h"
...
...
@@ -24,6 +26,8 @@
#include
"MeshLib/Mesh.h"
#include
"MeshLib/Node.h"
#include
"MeshLib/Elements/Element.h"
#include
"MeshLib/PropertyVector.h"
#include
"MeshLib/Properties.h"
#include
"MeshLib/MeshQuality/MeshValidation.h"
#include
"MeshLib/MeshSearch/NodeSearch.h"
#include
"MeshLib/MeshEditing/RemoveMeshComponents.h"
...
...
@@ -53,17 +57,28 @@ bool LayeredMeshGenerator::createLayers(MeshLib::Mesh const& mesh,
MeshLib
::
Mesh
*
LayeredMeshGenerator
::
getMesh
(
std
::
string
const
&
mesh_name
)
const
{
if
(
_nodes
.
empty
()
||
_elements
.
empty
())
return
nullptr
;
MeshLib
::
Mesh
*
result
(
new
MeshLib
::
Mesh
(
mesh_name
,
_nodes
,
_elements
));
MeshLib
::
NodeSearch
ns
(
*
result
);
if
(
ns
.
searchUnused
()
>
0
)
{
auto
new_mesh
=
MeshLib
::
removeNodes
(
*
result
,
ns
.
getSearchedNodeIDs
(),
mesh_name
);
delete
result
;
return
new_mesh
;
}
return
result
;
if
(
_nodes
.
empty
()
||
_elements
.
empty
())
return
nullptr
;
MeshLib
::
Properties
properties
;
if
(
_materials
.
size
()
==
_elements
.
size
())
{
boost
::
optional
<
MeshLib
::
PropertyVector
<
int
>
&>
materials
=
properties
.
createNewPropertyVector
<
int
>
(
"MaterialIDs"
,
MeshLib
::
MeshItemType
::
Cell
);
materials
->
resize
(
_materials
.
size
());
std
::
copy
(
_materials
.
cbegin
(),
_materials
.
cend
(),
materials
->
begin
());
}
else
WARN
(
"Skipping MaterialID information, number of entries does not match element number"
);
MeshLib
::
Mesh
*
result
(
new
MeshLib
::
Mesh
(
mesh_name
,
_nodes
,
_elements
,
properties
));
MeshLib
::
NodeSearch
ns
(
*
result
);
if
(
ns
.
searchUnused
()
>
0
)
{
auto
new_mesh
=
MeshLib
::
removeNodes
(
*
result
,
ns
.
getSearchedNodeIDs
(),
mesh_name
);
delete
result
;
return
new_mesh
;
}
return
result
;
}
double
LayeredMeshGenerator
::
calcEpsilon
(
GeoLib
::
Raster
const
&
low
,
GeoLib
::
Raster
const
&
high
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshGenerators/LayeredMeshGenerator.h
+
1
−
0
View file @
a712b889
...
...
@@ -97,6 +97,7 @@ protected:
double
_elevation_epsilon
;
double
_minimum_thickness
;
std
::
vector
<
int
>
_materials
;
std
::
vector
<
MeshLib
::
Node
*>
_nodes
;
std
::
vector
<
MeshLib
::
Element
*>
_elements
;
};
...
...
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