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
fe89f134
Commit
fe89f134
authored
2 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[A/Utils/MeshEdit] Use Eigen::Vector3d instead of std::array
parent
13b0d51b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Applications/Utils/MeshEdit/AddFaultToVoxelGrid.cpp
+7
-10
7 additions, 10 deletions
Applications/Utils/MeshEdit/AddFaultToVoxelGrid.cpp
with
7 additions
and
10 deletions
Applications/Utils/MeshEdit/AddFaultToVoxelGrid.cpp
+
7
−
10
View file @
fe89f134
...
@@ -96,7 +96,7 @@ bool testTriangleIntersectingAABB(MeshLib::Node const& n0,
...
@@ -96,7 +96,7 @@ bool testTriangleIntersectingAABB(MeshLib::Node const& n0,
}
}
void
markFaults
(
MeshLib
::
Mesh
&
mesh
,
MeshLib
::
Mesh
const
&
fault
,
void
markFaults
(
MeshLib
::
Mesh
&
mesh
,
MeshLib
::
Mesh
const
&
fault
,
int
const
fault_id
,
std
::
array
<
double
,
3
>
half_cell_size
)
int
const
fault_id
,
Eigen
::
Vector3d
const
&
half_cell_size
)
{
{
auto
const
&
elems
=
mesh
.
getElements
();
auto
const
&
elems
=
mesh
.
getElements
();
std
::
size_t
const
n_elems
=
mesh
.
getNumberOfElements
();
std
::
size_t
const
n_elems
=
mesh
.
getNumberOfElements
();
...
@@ -107,18 +107,15 @@ void markFaults(MeshLib::Mesh& mesh, MeshLib::Mesh const& fault,
...
@@ -107,18 +107,15 @@ void markFaults(MeshLib::Mesh& mesh, MeshLib::Mesh const& fault,
auto
[
min_pnt
,
max_pnt
]
=
fault_aabb
.
getMinMaxPoints
();
auto
[
min_pnt
,
max_pnt
]
=
fault_aabb
.
getMinMaxPoints
();
// get bounding box of fault + voxel extent
// get bounding box of fault + voxel extent
for
(
std
::
size_t
i
=
0
;
i
<
3
;
++
i
)
min_pnt
-=
half_cell_size
;
{
max_pnt
+=
half_cell_size
;
min_pnt
[
i
]
-=
half_cell_size
[
i
];
max_pnt
[
i
]
+=
half_cell_size
[
i
];
}
std
::
array
<
Eigen
::
Vector3d
,
2
>
const
fault_extent
{{
min_pnt
,
max_pnt
}};
std
::
array
<
Eigen
::
Vector3d
,
2
>
const
fault_extent
{{
min_pnt
,
max_pnt
}};
GeoLib
::
AABB
const
fault_aabb_ext
(
fault_extent
.
cbegin
(),
GeoLib
::
AABB
const
fault_aabb_ext
(
fault_extent
.
cbegin
(),
fault_extent
.
cend
());
fault_extent
.
cend
());
// test each voxel grid element vs each fault triangle
// test each voxel grid element vs each fault triangle
Eigen
::
Vector3d
const
extent
(
Eigen
::
Vector3d
const
extent
{
half_cell_size
};
{
half_cell_size
[
0
],
half_cell_size
[
1
],
half_cell_size
[
2
]});
for
(
std
::
size_t
j
=
0
;
j
<
n_elems
;
++
j
)
for
(
std
::
size_t
j
=
0
;
j
<
n_elems
;
++
j
)
{
{
// test if bounding box of fault is intersecting voxel
// test if bounding box of fault is intersecting voxel
...
@@ -290,14 +287,14 @@ int main(int argc, char* argv[])
...
@@ -290,14 +287,14 @@ int main(int argc, char* argv[])
fault_id
=
*
it
+
1
;
fault_id
=
*
it
+
1
;
}
}
std
::
array
<
double
,
3
>
half_cell_size
;
Eigen
::
Vector3d
half_cell_size
;
{
{
auto
const
n
=
*
mesh
->
getElement
(
0
)
->
getNode
(
0
);
auto
const
n
=
*
mesh
->
getElement
(
0
)
->
getNode
(
0
);
auto
const
c
=
MeshLib
::
getCenterOfGravity
(
*
mesh
->
getElement
(
0
));
auto
const
c
=
MeshLib
::
getCenterOfGravity
(
*
mesh
->
getElement
(
0
));
half_cell_size
[
0
]
=
std
::
abs
(
c
[
0
]
-
n
[
0
]);
half_cell_size
[
0
]
=
std
::
abs
(
c
[
0
]
-
n
[
0
]);
half_cell_size
[
1
]
=
std
::
abs
(
c
[
1
]
-
n
[
1
]);
half_cell_size
[
1
]
=
std
::
abs
(
c
[
1
]
-
n
[
1
]);
half_cell_size
[
2
]
=
std
::
abs
(
c
[
2
]
-
n
[
2
]);
half_cell_size
[
2
]
=
std
::
abs
(
c
[
2
]
-
n
[
2
]);
}
;
}
markFaults
(
*
mesh
,
*
fault
,
fault_id
,
half_cell_size
);
markFaults
(
*
mesh
,
*
fault
,
fault_id
,
half_cell_size
);
...
...
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