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
Özgür Ozan Sen
ogs
Commits
a7cc8ac8
Commit
a7cc8ac8
authored
1 year ago
by
Julian Heinze
Browse files
Options
Downloads
Patches
Plain Diff
dereference optional for cellsize
parent
9586503a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Applications/DataExplorer/DataView/Vtu2GridDialog.cpp
+12
-12
12 additions, 12 deletions
Applications/DataExplorer/DataView/Vtu2GridDialog.cpp
with
12 additions
and
12 deletions
Applications/DataExplorer/DataView/Vtu2GridDialog.cpp
+
12
−
12
View file @
a7cc8ac8
...
...
@@ -100,11 +100,11 @@ void Vtu2GridDialog::updateExpectedVoxel()
this
->
expectedVoxelLabel
->
setText
(
"approximated Voxel: undefined"
);
return
;
}
auto
const
&
xyz
=
opt_xyz
.
value
();
auto
const
delta
=
getMeshExtent
(
_mesh_model
.
getMesh
(
this
->
meshListBox
->
currentText
().
toStdString
()));
double
const
expected_voxel
=
(
delta
[
0
])
*
(
delta
[
1
])
*
(
delta
[
2
])
/
xyz
[
0
]
/
xyz
[
1
]
/
xyz
[
2
];
double
const
expected_voxel
=
(
delta
[
0
])
*
(
delta
[
1
])
*
(
delta
[
2
])
/
(
*
opt_
xyz
)
[
0
]
/
(
*
opt_
xyz
)
[
1
]
/
(
*
opt_
xyz
)
[
2
];
int
const
exponent
=
std
::
floor
(
std
::
log10
(
std
::
abs
(
expected_voxel
)));
this
->
expectedVoxelLabel
->
setText
(
...
...
@@ -139,10 +139,10 @@ void Vtu2GridDialog::accept()
return
;
}
auto
opt_xyz
=
fillXYZ
(
this
->
xlineEdit
->
text
(),
this
->
ylineEdit
->
text
(),
this
->
zlineEdit
->
text
());
auto
cellsize
=
fillXYZ
(
this
->
xlineEdit
->
text
(),
this
->
ylineEdit
->
text
(),
this
->
zlineEdit
->
text
());
if
(
!
opt_xyz
)
if
(
!
cellsize
)
{
OGSError
::
box
(
"At least the x-length of a voxel must be specified and > 0.
\n
If "
...
...
@@ -151,7 +151,6 @@ void Vtu2GridDialog::accept()
"treated as "
"the x-input."
);
}
auto
const
&
cellsize
=
opt_xyz
.
value
();
auto
_mesh
(
_mesh_model
.
getMesh
(
this
->
meshListBox
->
currentText
().
toStdString
()));
...
...
@@ -179,17 +178,18 @@ void Vtu2GridDialog::accept()
"The range (max-min of the bounding box) is not allowed to be < 0"
);
}
std
::
array
<
std
::
size_t
,
3
>
const
dims
=
VoxelGridFromMesh
::
getNumberOfVoxelPerDimension
(
ranges
,
cellsize
);
VoxelGridFromMesh
::
getNumberOfVoxelPerDimension
(
ranges
,
*
cellsize
);
std
::
unique_ptr
<
MeshLib
::
Mesh
>
grid
(
generateRegularHexMesh
(
dims
[
0
],
dims
[
1
],
dims
[
2
],
cellsize
[
0
],
cellsize
[
1
],
cellsize
[
2
],
min
,
"grid"
));
generateRegularHexMesh
(
dims
[
0
],
dims
[
1
],
dims
[
2
],
(
*
cellsize
)
[
0
],
(
*
cellsize
)
[
1
],
(
*
cellsize
)
[
2
],
min
,
"grid"
));
if
(
grid
==
nullptr
)
{
OGS_FATAL
(
"Could not generate regular hex mesh. With parameters dims={} {} "
"{}, "
"cellsize={} {} {}"
,
dims
[
0
],
dims
[
1
],
dims
[
2
],
cellsize
[
0
],
cellsize
[
1
],
cellsize
[
2
]);
dims
[
0
],
dims
[
1
],
dims
[
2
],
(
*
cellsize
)[
0
],
(
*
cellsize
)[
1
],
(
*
cellsize
)[
2
]);
}
std
::
vector
<
int
>*
cell_ids
=
...
...
@@ -199,7 +199,7 @@ void Vtu2GridDialog::accept()
{
OGS_FATAL
(
"Could not create cell ids."
);
}
*
cell_ids
=
VoxelGridFromMesh
::
assignCellIds
(
mesh
,
min
,
dims
,
cellsize
);
*
cell_ids
=
VoxelGridFromMesh
::
assignCellIds
(
mesh
,
min
,
dims
,
*
cellsize
);
if
(
!
VoxelGridFromMesh
::
removeUnusedGridCells
(
mesh
,
grid
))
{
return
;
...
...
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