Skip to content

Commit a4c013b

Browse files
committed
Final fix of Eggshell & related.
1 parent fd0f418 commit a4c013b

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

hermes2d/include/mesh/mesh_util.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ namespace Hermes
144144
/ \ / son[0]\ \ / /son[1] \
145145
/ \ / \ * / \
146146
*-------------*-------------* *-----------* *-----------*
147-
vn[0] vn[1] vn[2] vn[0] vn[1]
147+
vn[0] vn[1] vn[2] vn[0] vn[1]
148148
vn[0] en[0] vn[1]
149149
150150
-Triangle to quads refinement
@@ -166,8 +166,8 @@ namespace Hermes
166166
/ \ / son[0] | | son[1] \
167167
/ \ / | | \
168168
*-------------*-------------* *-------------* *-------------*
169-
vn[0] vn[1] vn[0] vn[1]
170-
vn[0] en[0] vn[1]
169+
vn[0] vn[1] vn[0] vn[1]
170+
vn[0] en[0] vn[1]
171171
172172
node and son numbering on a quad: refinement '0':
173173

hermes2d/src/mesh/mesh.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ namespace Hermes
398398
x2 = get_vertex_node(e->vn[2]->id, e->vn[0]->id);
399399

400400
CurvMap* cm[H2D_MAX_NUMBER_EDGES];
401-
memset(cm, 0, sizeof(cm));
401+
memset(cm, 0, H2D_MAX_NUMBER_EDGES * sizeof(CurvMap*));
402402

403403
// adjust mid-edge coordinates if this is a curved element
404404
if(e->is_curved())

hermes2d/src/space/space.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -1088,10 +1088,7 @@ namespace Hermes
10881088
int j = e->next_vert(i);
10891089
if (e->vn[i]->bnd && e->vn[j]->bnd)
10901090
{
1091-
Element* parent = e;
1092-
while(parent->parent != nullptr)
1093-
parent = parent->parent;
1094-
SurfPos surf_pos = { 0, i, parent, e->vn[i]->id, e->vn[j]->id, 0.0, 0.0, 1.0 };
1091+
SurfPos surf_pos = { 0, i, e, e->vn[i]->id, e->vn[j]->id, 0.0, 0.0, 1.0 };
10951092
update_edge_bc(e, &surf_pos);
10961093
}
10971094
}

hermes2d/src/space/space_h1.cpp

+16-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,14 @@ namespace Hermes
274274
surf_pos->t = surf_pos->lo;
275275
// Find out the (x, y) coordinates for the first endpoint.
276276
double x, y, n_x, n_y, t_x, t_y;
277-
Nurbs* nurbs = surf_pos->base->is_curved() ? surf_pos->base->cm->nurbs[surf_pos->surf_num] : nullptr;
277+
Nurbs* nurbs = nullptr;
278+
CurvMap* cm = surf_pos->base->cm;
279+
if(cm)
280+
{
281+
while(!cm->toplevel)
282+
cm = cm->parent->cm;
283+
nurbs = cm->nurbs[surf_pos->surf_num];
284+
}
278285
CurvMap::nurbs_edge(surf_pos->base, nurbs, surf_pos->surf_num, 2.0*surf_pos->t - 1.0, x, y, n_x, n_y, t_x, t_y);
279286
// Calculate.
280287
proj[0] = bc->value(x, y, n_x, n_y, t_x, t_y);
@@ -311,7 +318,14 @@ namespace Hermes
311318
{
312319
// Find out the (x, y) coordinate.
313320
double x, y, n_x, n_y, t_x, t_y;
314-
Nurbs* nurbs = surf_pos->base->is_curved() ? surf_pos->base->cm->nurbs[surf_pos->surf_num] : nullptr;
321+
Nurbs* nurbs = nullptr;
322+
CurvMap* cm = surf_pos->base->cm;
323+
if(cm)
324+
{
325+
while(!cm->toplevel)
326+
cm = cm->parent->cm;
327+
nurbs = cm->nurbs[surf_pos->surf_num];
328+
}
315329
CurvMap::nurbs_edge(surf_pos->base, nurbs, surf_pos->surf_num, 2.0*surf_pos->t - 1.0, x, y, n_x, n_y, t_x, t_y);
316330
// Calculate.
317331
rhs[i] += pt[j][1] * this->shapeset->get_fn_value(ii, pt[j][0], -1.0, 0, surf_pos->base->get_mode())

0 commit comments

Comments
 (0)