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
6905584f
Commit
6905584f
authored
1 year ago
by
Julian Heinze
Browse files
Options
Downloads
Patches
Plain Diff
Moved docu to header + adjusted for doxygen
parent
16db77d7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MeshToolsLib/MeshGenerators/VoxelGridFromMesh.cpp
+3
-8
3 additions, 8 deletions
MeshToolsLib/MeshGenerators/VoxelGridFromMesh.cpp
MeshToolsLib/MeshGenerators/VoxelGridFromMesh.h
+6
-0
6 additions, 0 deletions
MeshToolsLib/MeshGenerators/VoxelGridFromMesh.h
with
9 additions
and
8 deletions
MeshToolsLib/MeshGenerators/VoxelGridFromMesh.cpp
+
3
−
8
View file @
6905584f
...
...
@@ -28,12 +28,6 @@
namespace
MeshToolsLib
::
MeshGenerator
::
VoxelGridFromMesh
{
// getNumberOfVoxelPerDimension is used to calculate how many voxel fit to
// a bounding box. For this calculation the differnce of min and max point of
// the bounding box is devided by the cellsize, for every dimension. The
// calculation is restricted to work only with positive values for the cellsize.
// If the there is no differencec in min and max, we assign one voxel for the
// respective dimension.
std
::
array
<
std
::
size_t
,
3
>
getNumberOfVoxelPerDimension
(
std
::
array
<
double
,
3
>
const
&
ranges
,
std
::
array
<
double
,
3
>
const
&
cellsize
)
{
...
...
@@ -42,8 +36,9 @@ std::array<std::size_t, 3> getNumberOfVoxelPerDimension(
OGS_FATAL
(
"A cellsize ({},{},{}) is not allowed to be <= 0"
,
cellsize
[
0
],
cellsize
[
1
],
cellsize
[
2
]);
}
std
::
array
<
double
,
3
>
numberOfVoxel
=
{
ranges
[
0
]
/
cellsize
[
0
],
ranges
[
1
]
/
cellsize
[
1
],
ranges
[
2
]
/
cellsize
[
2
]};
std
::
array
<
double
,
3
>
numberOfVoxel
=
{
ranges
[
0
]
/
cellsize
[
0
],
ranges
[
1
]
/
cellsize
[
1
],
ranges
[
2
]
/
cellsize
[
2
]};
if
(
ranges
[
0
]
<
0
||
ranges
[
1
]
<
0
||
ranges
[
2
]
<
0
)
{
...
...
This diff is collapsed.
Click to expand it.
MeshToolsLib/MeshGenerators/VoxelGridFromMesh.h
+
6
−
0
View file @
6905584f
...
...
@@ -29,6 +29,12 @@ namespace MeshToolsLib::MeshGenerator::VoxelGridFromMesh
{
static
std
::
string
const
cell_id_name
=
"CellIds"
;
/// getNumberOfVoxelPerDimension is used to calculate how many voxel fit into
/// a bounding box. For this calculation the difference of min and max point of
/// the bounding box is divided by the cell size, for every dimension. The
/// calculation is restricted to work only with positive values for the cell
/// size. If the difference between min and max is zero, we assign one voxel for
/// the respective dimension.
std
::
array
<
std
::
size_t
,
3
>
getNumberOfVoxelPerDimension
(
std
::
array
<
double
,
3
>
const
&
ranges
,
std
::
array
<
double
,
3
>
const
&
cellsize
);
...
...
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