Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
6dd17b92
Commit
6dd17b92
authored
Oct 12, 2017
by
Uwe Schulzweida
Browse files
find_coordinate_to_ignore: optimized.
parent
fb068824
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Verifygrid.cc
View file @
6dd17b92
...
...
@@ -157,26 +157,14 @@ void find_unit_normal(double a[3], double b[3], double c[3], double *unit_normal
int
find_coordinate_to_ignore
(
double
*
cell_corners_xyz
)
{
double
corner_coordinates
[
3
];
double
second_corner_coordinates
[
3
];
double
third_corner_coordinates
[
3
];
/* Takes the first three corners/vertices of the cell and calculates the unit normal via determinants. */
corner_coordinates
[
0
]
=
cell_corners_xyz
[
0
];
corner_coordinates
[
1
]
=
cell_corners_xyz
[
1
];
corner_coordinates
[
2
]
=
cell_corners_xyz
[
2
];
double
*
p
corner_coordinates
1
=
&
cell_corners_xyz
[
0
];
double
*
p
corner_coordinates
2
=
&
cell_corners_xyz
[
3
];
double
*
p
corner_coordinates
3
=
&
cell_corners_xyz
[
6
];
second_corner_coordinates
[
0
]
=
cell_corners_xyz
[
3
+
0
];
second_corner_coordinates
[
1
]
=
cell_corners_xyz
[
3
+
1
];
second_corner_coordinates
[
2
]
=
cell_corners_xyz
[
3
+
2
];
third_corner_coordinates
[
0
]
=
cell_corners_xyz
[
6
+
0
];
third_corner_coordinates
[
1
]
=
cell_corners_xyz
[
6
+
1
];
third_corner_coordinates
[
2
]
=
cell_corners_xyz
[
6
+
2
];
double
surface_normal_of_the_cell
[
3
];
find_unit_normal
(
corner_coordinates
,
second_
corner_coordinates
,
third_
corner_coordinates
,
surface_normal_of_the_cell
);
find_unit_normal
(
p
corner_coordinates
1
,
p
corner_coordinates
2
,
p
corner_coordinates
3
,
surface_normal_of_the_cell
);
/* The surface normal is used to choose the coordinate to ignore. */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment