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
8a698bd6
Commit
8a698bd6
authored
9 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MeL/MG] LayeredMeshGenerateor::getMesh(): Declare the ownership of the mesh.
parent
312cb991
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
MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
+6
-5
6 additions, 5 deletions
MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
MeshLib/MeshGenerators/LayeredMeshGenerator.h
+3
-2
3 additions, 2 deletions
MeshLib/MeshGenerators/LayeredMeshGenerator.h
with
9 additions
and
7 deletions
MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
+
6
−
5
View file @
8a698bd6
...
...
@@ -55,7 +55,8 @@ bool LayeredMeshGenerator::createLayers(MeshLib::Mesh const& mesh,
return
result
;
}
MeshLib
::
Mesh
*
LayeredMeshGenerator
::
getMesh
(
std
::
string
const
&
mesh_name
)
const
std
::
unique_ptr
<
MeshLib
::
Mesh
>
LayeredMeshGenerator
::
getMesh
(
std
::
string
const
&
mesh_name
)
const
{
if
(
_nodes
.
empty
()
||
_elements
.
empty
())
return
nullptr
;
...
...
@@ -71,11 +72,11 @@ MeshLib::Mesh* LayeredMeshGenerator::getMesh(std::string const& mesh_name) const
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
);
std
::
unique_ptr
<
MeshLib
::
Mesh
>
result
(
new
MeshLib
::
Mesh
(
mesh_name
,
_nodes
,
_elements
,
properties
));
MeshLib
::
NodeSearch
ns
(
*
result
.
get
()
);
if
(
ns
.
searchUnused
()
>
0
)
{
auto
new_mesh
=
MeshLib
::
removeNodes
(
*
result
,
ns
.
getSearchedNodeIDs
(),
mesh_name
);
delete
result
;
std
::
unique_ptr
<
MeshLib
::
Mesh
>
new_mesh
(
MeshLib
::
removeNodes
(
*
result
.
get
(),
ns
.
getSearchedNodeIDs
(),
mesh_name
))
;
return
new_mesh
;
}
return
result
;
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshGenerators/LayeredMeshGenerator.h
+
3
−
2
View file @
8a698bd6
...
...
@@ -15,9 +15,10 @@
#ifndef LAYEREDMESHGENERATOR_H
#define LAYEREDMESHGENERATOR_H
#include
<memory>
#include
<limits>
#include
<string>
#include
<vector>
#include
<limits>
namespace
GeoLib
{
class
Raster
;
...
...
@@ -62,7 +63,7 @@ public:
double
noDataReplacementValue
)
=
0
;
/// Returns a mesh of the subsurface representation
MeshLib
::
Mesh
*
getMesh
(
std
::
string
const
&
mesh_name
)
const
;
std
::
unique_ptr
<
MeshLib
::
Mesh
>
getMesh
(
std
::
string
const
&
mesh_name
)
const
;
protected:
LayeredMeshGenerator
();
...
...
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