Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
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
Feliks Kiszkurno
ogs-feliks
Commits
af0557af
Commit
af0557af
authored
10 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
added data-dependent epsilon calculation
parent
2dc3cd5d
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/LayeredVolume.cpp
+10
-2
10 additions, 2 deletions
MeshLib/MeshGenerators/LayeredVolume.cpp
MeshLib/MeshGenerators/LayeredVolume.h
+4
-1
4 additions, 1 deletion
MeshLib/MeshGenerators/LayeredVolume.h
with
14 additions
and
3 deletions
MeshLib/MeshGenerators/LayeredVolume.cpp
+
10
−
2
View file @
af0557af
...
@@ -32,10 +32,9 @@
...
@@ -32,10 +32,9 @@
const
double
LayeredVolume
::
_invalid_value
=
-
9999
;
const
double
LayeredVolume
::
_invalid_value
=
-
9999
;
const
double
LayeredVolume
::
_elevation_epsilon
=
0.0001
;
LayeredVolume
::
LayeredVolume
()
LayeredVolume
::
LayeredVolume
()
:
_mesh
(
nullptr
)
:
_elevation_epsilon
(
0.0001
),
_mesh
(
nullptr
)
{
{
}
}
...
@@ -60,6 +59,8 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto
...
@@ -60,6 +59,8 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto
if
(
mesh
.
getDimension
()
!=
2
)
if
(
mesh
.
getDimension
()
!=
2
)
return
false
;
return
false
;
_elevation_epsilon
=
calcEpsilon
(
*
rasters
.
back
(),
*
rasters
[
0
]);
// remove line elements, only tri + quad remain
// remove line elements, only tri + quad remain
MeshLib
::
ElementExtraction
ex
(
mesh
);
MeshLib
::
ElementExtraction
ex
(
mesh
);
ex
.
searchByElementType
(
MeshElemType
::
LINE
);
ex
.
searchByElementType
(
MeshElemType
::
LINE
);
...
@@ -204,6 +205,13 @@ bool LayeredVolume::exportToGeometry(GeoLib::GEOObjects &geo_objects) const
...
@@ -204,6 +205,13 @@ bool LayeredVolume::exportToGeometry(GeoLib::GEOObjects &geo_objects) const
return
true
;
return
true
;
}
}
double
LayeredVolume
::
calcEpsilon
(
const
GeoLib
::
Raster
&
high
,
const
GeoLib
::
Raster
&
low
)
{
const
double
max
(
*
std
::
max_element
(
high
.
begin
(),
high
.
end
()));
const
double
min
(
*
std
::
min_element
(
high
.
begin
(),
high
.
end
()));
return
((
max
-
min
)
*
1e-07
);
}
bool
LayeredVolume
::
allRastersExist
(
const
std
::
vector
<
std
::
string
>
&
raster_paths
)
const
bool
LayeredVolume
::
allRastersExist
(
const
std
::
vector
<
std
::
string
>
&
raster_paths
)
const
{
{
for
(
auto
raster
=
raster_paths
.
begin
();
raster
!=
raster_paths
.
end
();
++
raster
)
for
(
auto
raster
=
raster_paths
.
begin
();
raster
!=
raster_paths
.
end
();
++
raster
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshGenerators/LayeredVolume.h
+
4
−
1
View file @
af0557af
...
@@ -77,6 +77,9 @@ private:
...
@@ -77,6 +77,9 @@ private:
/// Removes duplicate 2D elements (possible due to outcroppings)
/// Removes duplicate 2D elements (possible due to outcroppings)
void
removeCongruentElements
(
std
::
size_t
nLayers
,
std
::
size_t
nElementsPerLayer
);
void
removeCongruentElements
(
std
::
size_t
nLayers
,
std
::
size_t
nElementsPerLayer
);
/// Calculates a data-dependent epsilon value
double
calcEpsilon
(
const
GeoLib
::
Raster
&
high
,
const
GeoLib
::
Raster
&
low
);
/// Checks if all raster files actually exist
/// Checks if all raster files actually exist
bool
allRastersExist
(
const
std
::
vector
<
std
::
string
>
&
raster_paths
)
const
;
bool
allRastersExist
(
const
std
::
vector
<
std
::
string
>
&
raster_paths
)
const
;
...
@@ -84,7 +87,7 @@ private:
...
@@ -84,7 +87,7 @@ private:
void
cleanUpOnError
();
void
cleanUpOnError
();
static
const
double
_invalid_value
;
static
const
double
_invalid_value
;
static
const
double
_elevation_epsilon
;
double
_elevation_epsilon
;
std
::
vector
<
MeshLib
::
Node
*>
_nodes
;
std
::
vector
<
MeshLib
::
Node
*>
_nodes
;
std
::
vector
<
MeshLib
::
Element
*>
_elements
;
std
::
vector
<
MeshLib
::
Element
*>
_elements
;
std
::
vector
<
MeshLib
::
Node
>
_attribute_points
;
std
::
vector
<
MeshLib
::
Node
>
_attribute_points
;
...
...
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