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
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
Mojtaba Abdolkhani
ogs
Commits
a99235bd
Commit
a99235bd
authored
9 years ago
by
Dmitri Naumov
Committed by
Tom Fischer
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Replace Node ptr with Point3d.
parent
68d30c7a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MeshLib/ElementCoordinatesMappingLocal.cpp
+11
-12
11 additions, 12 deletions
MeshLib/ElementCoordinatesMappingLocal.cpp
MeshLib/ElementCoordinatesMappingLocal.h
+2
-2
2 additions, 2 deletions
MeshLib/ElementCoordinatesMappingLocal.h
with
13 additions
and
14 deletions
MeshLib/ElementCoordinatesMappingLocal.cpp
+
11
−
12
View file @
a99235bd
...
...
@@ -25,10 +25,10 @@ namespace detail
/// rotate points to local coordinates
void
rotateToLocal
(
const
MeshLib
::
RotationMatrix
&
matR2local
,
std
::
vector
<
MathLib
::
Point3d
*
>
&
vec_node
s
)
std
::
vector
<
MathLib
::
Point3d
>
&
point
s
)
{
for
(
auto
node
:
vec_node
s
)
node
->
setCoords
((
matR2local
*
(
*
node
)
).
getCoords
());
for
(
auto
&
p
:
point
s
)
p
.
setCoords
((
matR2local
*
p
).
getCoords
());
}
/// get a rotation matrix to the global coordinates
...
...
@@ -36,7 +36,7 @@ void rotateToLocal(
void
getRotationMatrixToGlobal
(
const
MeshLib
::
Element
&
e
,
const
MeshLib
::
CoordinateSystem
&
global_coords
,
const
std
::
vector
<
MathLib
::
Point3d
*
>
&
vec_node
s
,
const
std
::
vector
<
MathLib
::
Point3d
>
&
point
s
,
MeshLib
::
RotationMatrix
&
matR
)
{
const
std
::
size_t
global_dim
=
global_coords
.
getDimension
();
...
...
@@ -45,7 +45,7 @@ void getRotationMatrixToGlobal(
if
(
global_dim
==
e
.
getDimension
())
{
matR
.
setIdentity
();
}
else
if
(
e
.
getDimension
()
==
1
)
{
MathLib
::
Vector3
xx
(
*
vec_nodes
[
0
],
*
vec_node
s
[
1
]);
MathLib
::
Vector3
xx
(
points
[
0
],
point
s
[
1
]);
xx
.
normalize
();
if
(
global_dim
==
2
)
GeoLib
::
compute2DRotationMatrixToX
(
xx
,
matR
);
...
...
@@ -56,8 +56,7 @@ void getRotationMatrixToGlobal(
// get plane normal
MathLib
::
Vector3
plane_normal
;
double
d
;
//std::tie(plane_normal, d) = GeoLib::getNewellPlane(vec_nodes);
GeoLib
::
getNewellPlane
(
vec_nodes
,
plane_normal
,
d
);
std
::
tie
(
plane_normal
,
d
)
=
GeoLib
::
getNewellPlane
(
points
);
// compute a rotation matrix to XY
GeoLib
::
computeRotationMatrixToXY
(
plane_normal
,
matR
);
...
...
@@ -82,16 +81,16 @@ ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(
:
_coords
(
global_coords
),
_matR2global
(
3
,
3
)
{
assert
(
e
.
getDimension
()
<=
global_coords
.
getDimension
());
_
vec_node
s
.
reserve
(
e
.
getNNodes
());
_
point
s
.
reserve
(
e
.
getNNodes
());
for
(
unsigned
i
=
0
;
i
<
e
.
getNNodes
();
i
++
)
_
vec_nodes
.
push_back
(
new
MathLib
::
Point3d
(
*
static_cast
<
MathLib
::
Point3d
const
*>
(
e
.
getNode
(
i
)
)
));
_
points
.
emplace_back
(
e
.
getNode
(
i
)
->
getCoords
(
));
detail
::
getRotationMatrixToGlobal
(
e
,
global_coords
,
_
vec_node
s
,
_matR2global
);
detail
::
getRotationMatrixToGlobal
(
e
,
global_coords
,
_
point
s
,
_matR2global
);
#ifdef OGS_USE_EIGEN
detail
::
rotateToLocal
(
_matR2global
.
transpose
(),
_
vec_node
s
);
detail
::
rotateToLocal
(
_matR2global
.
transpose
(),
_
point
s
);
#else
RotationMatrix
*
m
(
_matR2global
.
transpose
());
detail
::
rotateToLocal
(
*
m
,
_
vec_node
s
);
detail
::
rotateToLocal
(
*
m
,
_
point
s
);
delete
m
;
#endif
}
...
...
This diff is collapsed.
Click to expand it.
MeshLib/ElementCoordinatesMappingLocal.h
+
2
−
2
View file @
a99235bd
...
...
@@ -56,7 +56,7 @@ public:
/// return mapped coordinates of the node
MathLib
::
Point3d
const
&
getMappedCoordinates
(
std
::
size_t
node_id
)
const
{
return
*
_vec_node
s
[
node_id
];
return
_point
s
[
node_id
];
}
/// return a rotation matrix converting to global coordinates
...
...
@@ -64,7 +64,7 @@ public:
private
:
const
CoordinateSystem
_coords
;
std
::
vector
<
MathLib
::
Point3d
*
>
_
vec_node
s
;
std
::
vector
<
MathLib
::
Point3d
>
_
point
s
;
RotationMatrix
_matR2global
;
};
...
...
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