Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dkrz-sw
YAC
Commits
d1fa9aeb
Commit
d1fa9aeb
authored
3 weeks ago
by
Moritz Hanke
Browse files
Options
Downloads
Patches
Plain Diff
improves error messages in interp_method_avg
parent
2d1f481e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/interp_method_avg.c
+24
-7
24 additions, 7 deletions
src/core/interp_method_avg.c
with
24 additions
and
7 deletions
src/core/interp_method_avg.c
+
24
−
7
View file @
d1fa9aeb
...
...
@@ -522,7 +522,8 @@ static int compute_weights_dist_no(
// respect to the given triangle
static
void
compute_barycentric_coords
(
double
*
barycentric_coords
,
size_t
triangle_indices
[
3
],
yac_const_coordinate_pointer
grid_coords
)
{
yac_const_coordinate_pointer
grid_coords
,
char
const
*
caller
)
{
double
A
[
3
][
3
];
lapack_int
n
=
3
,
nrhs
=
1
,
lda
=
n
,
ldx
=
n
,
ipiv
[
3
];
...
...
@@ -535,11 +536,25 @@ static void compute_barycentric_coords(
// where: A is the matrix consisting of the vertex coordinates of the three
// corners of the triangle
// we compute b by solving this linear system using LAPACK
YAC_ASSERT
(
YAC_ASSERT
_F
(
!
LAPACKE_dgesv
(
LAPACK_COL_MAJOR
,
n
,
nrhs
,
&
A
[
0
][
0
],
lda
,
ipiv
,
barycentric_coords
,
ldx
),
"ERROR: internal error (could not solve linear 3x3 system)"
)
LAPACK_COL_MAJOR
,
n
,
nrhs
,
&
A
[
0
][
0
],
lda
,
ipiv
,
barycentric_coords
,
ldx
),
"ERROR(%s::compute_sb_coords): "
"internal error (could not solve linear 3x3 system)
\n
"
"(vector: (% .6e;% .6e;% .6e)
\n
"
" triangle: ((% .6e;% .6e;% .6e),
\n
"
" (% .6e;% .6e;% .6e),
\n
"
" (% .6e;% .6e;% .6e))"
,
caller
,
barycentric_coords
[
0
],
barycentric_coords
[
1
],
barycentric_coords
[
2
],
grid_coords
[
triangle_indices
[
0
]][
0
],
grid_coords
[
triangle_indices
[
0
]][
1
],
grid_coords
[
triangle_indices
[
0
]][
2
],
grid_coords
[
triangle_indices
[
1
]][
0
],
grid_coords
[
triangle_indices
[
1
]][
1
],
grid_coords
[
triangle_indices
[
1
]][
2
],
grid_coords
[
triangle_indices
[
2
]][
0
],
grid_coords
[
triangle_indices
[
2
]][
1
],
grid_coords
[
triangle_indices
[
2
]][
2
])
}
// returns 0 if edge_direction_vec points south; 1 otherwise
...
...
@@ -729,7 +744,8 @@ static int compute_weights_bary_yes(
// compute barycentric coordinates for the current triangle
compute_barycentric_coords
(
temp_barycentric_coords
,
triangle_indices
[
i
],
src_coords
);
temp_barycentric_coords
,
triangle_indices
[
i
],
src_coords
,
"compute_weights_bary_yes"
);
double
curr_min_barycentric_coord
=
MIN
(
temp_barycentric_coords
[
0
],
...
...
@@ -832,7 +848,8 @@ static int compute_weights_bary_no(
// compute barycentric coordinates for the current triangle
compute_barycentric_coords
(
temp_barycentric_coords
,
triangle_indices
[
i
],
src_coords
);
temp_barycentric_coords
,
triangle_indices
[
i
],
src_coords
,
"compute_weights_bary_no"
);
double
curr_min_barycentric_coord
=
MIN
(
temp_barycentric_coords
[
0
],
...
...
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