Nektar++
Loading...
Searching...
No Matches
TestAlignedTraceNormal.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: TestAlignedTraceNormal.cpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included in
21// all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29// IN THE SOFTWARE.
30//
31// Description: Tests for trace normals sampled on boundary expansions.
32//
33///////////////////////////////////////////////////////////////////////////////
34
36#include <LocalRegions/HexExp.h>
38#include <LocalRegions/TetExp.h>
39#include <LocalRegions/TriExp.h>
47
48#include <boost/test/unit_test.hpp>
49
50#include <array>
51#include <cmath>
52#include <set>
53#include <vector>
54
56{
57
59{
60 std::array<SpatialDomains::PointGeomUniquePtr, 4> verts;
61 std::array<SpatialDomains::SegGeomUniquePtr, 6> edges;
62 std::array<SpatialDomains::TriGeomUniquePtr, 4> faces;
66 std::vector<SpatialDomains::PointGeomUniquePtr> nodes;
67};
68
69/// Build a tetrahedron with a curved face 0. Setting bit i of @p flip
70/// traverses face i (1-3) the other way round, keeping its first edge on face
71/// 0 as TetGeom requires, which changes the orientation the element sees.
72static CurvedTet MakeCurvedTet(const int flip = 0)
73{
74 CurvedTet p;
75 const std::array<std::array<NekDouble, 3>, 4> x = {{{{0.0, 0.0, 0.0}},
76 {{1.0, 0.0, 0.0}},
77 {{0.1, 1.0, 0.0}},
78 {{0.2, 0.1, 1.1}}}};
79
80 for (int i = 0; i < 4; ++i)
81 {
83 new SpatialDomains::PointGeom(3u, i, x[i][0], x[i][1], x[i][2]));
84 }
85
86 const std::array<std::array<int, 2>, 6> edgeVerts = {
87 {{{0, 1}}, {{1, 2}}, {{0, 2}}, {{0, 3}}, {{1, 3}}, {{2, 3}}}};
88 for (int i = 0; i < 6; ++i)
89 {
90 std::array<SpatialDomains::PointGeom *, 2> ev = {
91 p.verts[edgeVerts[i][0]].get(), p.verts[edgeVerts[i][1]].get()};
93 new SpatialDomains::SegGeom(i, 3, ev));
94 }
95
96 const std::array<std::array<int, 3>, 4> faceEdges = {
97 {{{0, 1, 2}}, {{0, 4, 3}}, {{1, 5, 4}}, {{2, 5, 3}}}};
98 std::array<SpatialDomains::TriGeom *, 4> facePtrs;
99 for (int i = 0; i < 4; ++i)
100 {
101 std::array<SpatialDomains::SegGeom *, 3> fe;
102 for (int j = 0; j < 3; ++j)
103 {
104 const int cyc = (flip >> i) & 1 ? (3 - j) % 3 : j;
105 fe[j] = p.edges[faceEdges[i][cyc]].get();
106 }
108 new SpatialDomains::TriGeom(i, fe));
109 facePtrs[i] = p.faces[i].get();
110 }
112 new SpatialDomains::TetGeom(0, facePtrs));
113 p.tet->Setup();
114
115 for (auto &edge : p.edges)
116 {
117 edge->FillGeom();
118 auto curveAndNodes =
119 edge->MakeOrder(3, LibUtilities::ePolyEvenlySpaced);
120 for (auto &node : curveAndNodes.second)
121 {
122 p.nodes.push_back(std::move(node));
123 }
124 p.curvedEdges[edge->GetGlobalID()] = std::move(curveAndNodes.first);
125 }
126 for (auto &face : p.faces)
127 {
128 face->FillGeom();
129 auto curveAndNodes =
130 face->MakeOrder(3, LibUtilities::eNodalTriEvenlySpaced);
131 for (auto &node : curveAndNodes.second)
132 {
133 p.nodes.push_back(std::move(node));
134 }
135 p.curvedFaces[face->GetGlobalID()] = std::move(curveAndNodes.first);
136 }
137
138 // At order three the final triangular node is the single face interior
139 // node. Moving it out of the face plane makes the normal vary over the
140 // face; the other faces are bent too, so that their orientation matters.
141 const std::array<std::array<NekDouble, 3>, 4> bump = {
142 {{{0.0, 0.0, 0.2}},
143 {{0.02, -0.1, 0.03}},
144 {{0.08, 0.05, 0.04}},
145 {{-0.1, 0.02, 0.01}}}};
146 for (int i = 0; i < 4; ++i)
147 {
148 SpatialDomains::PointGeom *interior = p.curvedFaces[i]->m_points.back();
149 interior->UpdatePosition((*interior)(0) + bump[i][0],
150 (*interior)(1) + bump[i][1],
151 (*interior)(2) + bump[i][2]);
152 }
153 p.tet->Reset(p.curvedEdges, p.curvedFaces);
154 return p;
155}
156
157BOOST_AUTO_TEST_CASE(TestDeformedFaceNormalWithDifferentQuadrature)
158{
159 CurvedTet geom = MakeCurvedTet();
160
161 using namespace LibUtilities;
163 const BasisKey high1(eModified_B, 5, PointsKey(6, eGaussRadauMAlpha1Beta0));
164 const BasisKey high2(eModified_C, 5, PointsKey(6, eGaussRadauMAlpha2Beta0));
166 high0, high1, high2, geom.tet.get());
167
169 const BasisKey low1(eModified_B, 3, PointsKey(3, eGaussRadauMAlpha1Beta0));
171 low0, low1, geom.faces[0].get());
172
173 LocalRegions::ExpansionSharedPtr adjacent = volume;
174 boundary->SetAdjacentElementExp(0, adjacent);
175
176 BOOST_REQUIRE_EQUAL(boundary->GetGeomFactors()->GetGtype(),
178 BOOST_REQUIRE(volume->GetTraceBasisKey(0, 0) != low0 ||
179 volume->GetTraceBasisKey(0, 1) != low1);
180
181 const int nq = boundary->GetTotPoints();
182 Array<OneD, NekDouble> fx(nq), fy(nq), fz(nq);
183 for (int i = 0; i < nq; ++i)
184 {
185 fx[i] = 0.3 + 0.02 * i;
186 fy[i] = -0.4 + 0.01 * i;
187 fz[i] = 0.8 - 0.03 * i;
188 }
189
190 Array<OneD, NekDouble> actual(boundary->GetNcoeffs());
191 boundary->NormVectorIProductWRTBase(fx, fy, fz, actual);
192
193 const auto &normal = volume->GetTraceNormal(0);
194 Array<OneD, NekDouble> nx(nq), ny(nq), nz(nq);
195 Interp2D(volume->GetTraceBasisKey(0, 0), volume->GetTraceBasisKey(0, 1),
196 normal[0], low0, low1, nx);
197 Interp2D(volume->GetTraceBasisKey(0, 0), volume->GetTraceBasisKey(0, 1),
198 normal[1], low0, low1, ny);
199 Interp2D(volume->GetTraceBasisKey(0, 0), volume->GetTraceBasisKey(0, 1),
200 normal[2], low0, low1, nz);
201
202 Array<OneD, NekDouble> flux(nq);
203 for (int i = 0; i < nq; ++i)
204 {
205 flux[i] = nx[i] * fx[i] + ny[i] * fy[i] + nz[i] * fz[i];
206 }
207 Array<OneD, NekDouble> expected(boundary->GetNcoeffs());
208 boundary->IProductWRTBase(flux, expected);
209
210 for (int i = 0; i < expected.size(); ++i)
211 {
212 BOOST_CHECK_SMALL(actual[i] - expected[i], 1.0e-11);
213 }
214}
215
216/// Check that the normals of @p face, sampled on @p bnd, are unit vectors
217/// orthogonal to the boundary expansion's own tangents and point from
218/// @p centre towards the face. A normal assigned to the wrong point of a curved
219/// face fails the orthogonality check.
220static void CheckAlignedNormals(LocalRegions::Expansion &elmt, const int face,
222 const std::array<NekDouble, 3> &centre)
223{
224 const int nq = bnd.GetTotPoints();
225 const LocalRegions::NormalVector n = elmt.GetAlignedTraceNormal(face, bnd);
226 BOOST_REQUIRE_EQUAL(n.size(), 3);
227
228 std::array<Array<OneD, NekDouble>, 3> x, t0, t1;
229 for (int d = 0; d < 3; ++d)
230 {
231 BOOST_REQUIRE_EQUAL(n[d].size(), nq);
232 x[d] = Array<OneD, NekDouble>(nq);
233 t0[d] = Array<OneD, NekDouble>(nq);
234 t1[d] = Array<OneD, NekDouble>(nq);
235 }
236 bnd.GetCoords(x[0], x[1], x[2]);
237 for (int d = 0; d < 3; ++d)
238 {
239 bnd.StdPhysDeriv(x[d], t0[d], t1[d]);
240 }
241
242 std::array<NekDouble, 3> faceCentre;
243 for (int d = 0; d < 3; ++d)
244 {
245 faceCentre[d] = Vmath::Vsum(nq, x[d], 1) / nq;
246 }
247
248 for (int i = 0; i < nq; ++i)
249 {
250 NekDouble nn = 0.0, nt0 = 0.0, nt1 = 0.0, tt0 = 0.0, tt1 = 0.0;
251 NekDouble out = 0.0;
252 for (int d = 0; d < 3; ++d)
253 {
254 nn += n[d][i] * n[d][i];
255 nt0 += n[d][i] * t0[d][i];
256 nt1 += n[d][i] * t1[d][i];
257 tt0 += t0[d][i] * t0[d][i];
258 tt1 += t1[d][i] * t1[d][i];
259 out += n[d][i] * (faceCentre[d] - centre[d]);
260 }
261 BOOST_CHECK_SMALL(nn - 1.0, 1.0e-12);
262 BOOST_CHECK_SMALL(nt0 / std::sqrt(tt0), 1.0e-10);
263 BOOST_CHECK_SMALL(nt1 / std::sqrt(tt1), 1.0e-10);
264 BOOST_CHECK_GT(out, 0.0);
265 }
266}
267
268static std::array<NekDouble, 3> Centre(LocalRegions::Expansion &elmt)
269{
270 const int nq = elmt.GetTotPoints();
271 Array<OneD, NekDouble> x(nq), y(nq), z(nq);
272 elmt.GetCoords(x, y, z);
273 return {Vmath::Vsum(nq, x, 1) / nq, Vmath::Vsum(nq, y, 1) / nq,
274 Vmath::Vsum(nq, z, 1) / nq};
275}
276
277BOOST_AUTO_TEST_CASE(TestAlignedTriFaceNormals)
278{
279 using namespace LibUtilities;
281 const BasisKey b1(eModified_B, 5, PointsKey(6, eGaussRadauMAlpha1Beta0));
282 const BasisKey b2(eModified_C, 5, PointsKey(6, eGaussRadauMAlpha2Beta0));
283
284 std::set<StdRegions::Orientation> orients;
285 for (int flip = 0; flip < 16; flip += 2)
286 {
287 CurvedTet geom = MakeCurvedTet(flip);
289 b0, b1, b2, geom.tet.get());
290 const std::array<NekDouble, 3> centre = Centre(*volume);
291
292 for (int f = 0; f < 4; ++f)
293 {
294 orients.insert(volume->GetTraceOrient(f));
296 volume->GetAlignedTraceExp(f);
297 CheckAlignedNormals(*volume, f, *bnd, centre);
298 }
299 }
300
301 // The faces must not all share the element's frame, or the check above
302 // could not detect a missing reorientation.
303 BOOST_CHECK_GT(orients.size(), 1);
304}
305
306/// Storage for a hexahedron with curved faces; entities must outlive it.
308{
309 std::array<SpatialDomains::PointGeomUniquePtr, 8> verts;
310 std::array<SpatialDomains::SegGeomUniquePtr, 12> edges;
311 std::array<SpatialDomains::QuadGeomUniquePtr, 6> faces;
315 std::vector<SpatialDomains::PointGeomUniquePtr> nodes;
316};
317
318/// Build a hexahedron whose faces are numbered @p rot steps around (and
319/// optionally reversed), so that the element sees non-trivial and transposed
320/// face orientations, then curve every edge and face with an asymmetric
321/// perturbation of their high-order nodes.
322static void MakeCurvedHex(CurvedHex &p, const int rot, const bool reverse)
323{
324 const std::array<std::array<NekDouble, 3>, 8> x = {{{{0.0, 0.0, 0.0}},
325 {{1.0, 0.0, 0.0}},
326 {{1.3, 1.0, 0.0}},
327 {{0.0, 1.1, 0.0}},
328 {{0.1, 0.2, 1.0}},
329 {{1.0, 0.0, 1.2}},
330 {{1.4, 1.2, 1.0}},
331 {{0.0, 1.0, 1.3}}}};
332 for (int i = 0; i < 8; ++i)
333 {
335 new SpatialDomains::PointGeom(3u, i, x[i][0], x[i][1], x[i][2]));
336 }
337
338 const std::array<std::array<int, 2>, 12> edgeVerts = {{{{0, 1}},
339 {{1, 2}},
340 {{2, 3}},
341 {{3, 0}},
342 {{0, 4}},
343 {{1, 5}},
344 {{2, 6}},
345 {{3, 7}},
346 {{4, 5}},
347 {{5, 6}},
348 {{6, 7}},
349 {{7, 4}}}};
350 for (int i = 0; i < 12; ++i)
351 {
352 std::array<SpatialDomains::PointGeom *, 2> ev = {
353 p.verts[edgeVerts[i][0]].get(), p.verts[edgeVerts[i][1]].get()};
355 new SpatialDomains::SegGeom(i, 3, ev));
356 }
357
358 const std::array<std::array<int, 4>, 6> faceEdges = {{{{0, 1, 2, 3}},
359 {{0, 5, 8, 4}},
360 {{1, 6, 9, 5}},
361 {{2, 6, 10, 7}},
362 {{3, 7, 11, 4}},
363 {{8, 9, 10, 11}}}};
364 std::array<SpatialDomains::QuadGeom *, 6> facePtrs;
365 for (int i = 0; i < 6; ++i)
366 {
367 // Rotating or reversing the closed edge loop renumbers the face as a
368 // neighbouring element might have, giving it a different orientation.
369 std::array<SpatialDomains::SegGeom *, 4> fe;
370 for (int j = 0; j < 4; ++j)
371 {
372 const int cyc = reverse ? (4 - j) % 4 : j;
373 fe[j] = p.edges[faceEdges[i][(cyc + rot + i) % 4]].get();
374 }
376 new SpatialDomains::QuadGeom(i, fe));
377 facePtrs[i] = p.faces[i].get();
378 }
380 new SpatialDomains::HexGeom(0, facePtrs));
381 p.hex->Setup();
382
383 std::vector<SpatialDomains::Curve *> curves;
384 auto keep = [&](SpatialDomains::Geometry *geom,
385 SpatialDomains::CurveMap &curved) {
386 geom->FillGeom();
387 auto curveAndNodes =
389 for (auto &node : curveAndNodes.second)
390 {
391 p.nodes.push_back(std::move(node));
392 }
393 curves.push_back(curveAndNodes.first.get());
394 curved[geom->GetGlobalID()] = std::move(curveAndNodes.first);
395 };
396 for (auto &edge : p.edges)
397 {
398 keep(edge.get(), p.curvedEdges);
399 }
400 for (auto &face : p.faces)
401 {
402 keep(face.get(), p.curvedFaces);
403 }
404
405 // Move every node that is not a vertex by a smooth, asymmetric function
406 // of its position. Nodes shared by an edge and a face start at the same
407 // place and so stay coincident.
408 std::set<SpatialDomains::PointGeom *> moved;
409 for (auto *curve : curves)
410 {
411 for (auto *node : curve->m_points)
412 {
413 bool isVertex = false;
414 for (auto &v : p.verts)
415 {
416 isVertex = isVertex || node->dist(*v) < 1.0e-12;
417 }
418 if (isVertex || !moved.insert(node).second)
419 {
420 continue;
421 }
422 const NekDouble px = (*node)(0), py = (*node)(1), pz = (*node)(2);
423 node->UpdatePosition(
424 px + 0.06 * std::sin(2.1 * px + 0.3 * py + 1.7 * pz + 0.5),
425 py + 0.06 * std::sin(0.4 * px + 2.3 * py + 0.9 * pz + 1.1),
426 pz + 0.06 * std::sin(1.5 * px + 0.8 * py + 2.2 * pz + 0.2));
427 }
428 }
429 p.hex->Reset(p.curvedEdges, p.curvedFaces);
430}
431
432BOOST_AUTO_TEST_CASE(TestAlignedQuadFaceNormals)
433{
434 using namespace LibUtilities;
435 // Different point counts per direction, so that a transposed face sees
436 // its extents exchanged.
440
441 std::set<StdRegions::Orientation> orients;
442 for (const bool reverse : {false, true})
443 {
444 for (int rot = 0; rot < 4; ++rot)
445 {
446 CurvedHex geom;
447 MakeCurvedHex(geom, rot, reverse);
448 auto volume =
450 b0, b1, b2, geom.hex.get());
451 const std::array<NekDouble, 3> centre = Centre(*volume);
452
453 for (int f = 0; f < 6; ++f)
454 {
455 orients.insert(volume->GetTraceOrient(f));
457 volume->GetAlignedTraceExp(f);
458 BOOST_REQUIRE_EQUAL(bnd->GetGeomFactors()->GetGtype(),
460 CheckAlignedNormals(*volume, f, *bnd, centre);
461
462 // NormVectorIProductWRTBase must use the same aligned normals.
463 LocalRegions::ExpansionSharedPtr adjacent = volume;
464 bnd->SetAdjacentElementExp(f, adjacent);
465 const int nq = bnd->GetTotPoints();
467 volume->GetAlignedTraceNormal(f, *bnd);
468 Array<OneD, NekDouble> fx(nq), fy(nq), fz(nq), flux(nq);
469 for (int i = 0; i < nq; ++i)
470 {
471 fx[i] = 0.3 + 0.02 * i;
472 fy[i] = -0.4 + 0.01 * i;
473 fz[i] = 0.8 - 0.03 * i;
474 flux[i] =
475 n[0][i] * fx[i] + n[1][i] * fy[i] + n[2][i] * fz[i];
476 }
477 Array<OneD, NekDouble> actual(bnd->GetNcoeffs());
478 Array<OneD, NekDouble> expected(bnd->GetNcoeffs());
479 bnd->NormVectorIProductWRTBase(fx, fy, fz, actual);
480 bnd->IProductWRTBase(flux, expected);
481 for (int i = 0; i < expected.size(); ++i)
482 {
483 BOOST_CHECK_SMALL(actual[i] - expected[i], 1.0e-12);
484 }
485 }
486 }
487 }
488
489 // Exercise both non-trivial and transposing orientations.
490 BOOST_CHECK_GT(orients.size(), 2);
491 BOOST_CHECK(orients.lower_bound(StdRegions::eDir1FwdDir2_Dir2FwdDir1) !=
492 orients.end());
493}
494
495/// The edge normals of a straight-sided quadrilateral that is not a
496/// parallelogram, and so deformed, are the constant outward normals of its
497/// sides, on Gauss points of every count, one point per direction included.
498BOOST_AUTO_TEST_CASE(TestDeformedQuadEdgeNormals)
499{
500 using namespace LibUtilities;
501 const std::array<std::array<NekDouble, 2>, 4> x = {
502 {{{0.0, 0.0}}, {{2.0, 0.1}}, {{1.6, 1.0}}, {{0.3, 1.3}}}};
503
504 std::array<SpatialDomains::PointGeomUniquePtr, 4> verts;
505 for (int i = 0; i < 4; ++i)
506 {
508 new SpatialDomains::PointGeom(2u, i, x[i][0], x[i][1], 0.0));
509 }
510 std::array<SpatialDomains::SegGeomUniquePtr, 4> edges;
511 std::array<SpatialDomains::SegGeom *, 4> edgePtrs;
512 for (int i = 0; i < 4; ++i)
513 {
514 std::array<SpatialDomains::PointGeom *, 2> ev = {
515 verts[i].get(), verts[(i + 1) % 4].get()};
517 new SpatialDomains::SegGeom(i, 2, ev));
518 edgePtrs[i] = edges[i].get();
519 }
521 new SpatialDomains::QuadGeom(0, edgePtrs));
522
523 // Edge i runs from vertex i to vertex i + 1 anticlockwise, so its outward
524 // normal is its direction turned clockwise.
525 std::array<std::array<NekDouble, 2>, 4> exact;
526 for (int i = 0; i < 4; ++i)
527 {
528 const NekDouble dx = x[(i + 1) % 4][0] - x[i][0];
529 const NekDouble dy = x[(i + 1) % 4][1] - x[i][1];
530 const NekDouble len = std::sqrt(dx * dx + dy * dy);
531 exact[i] = {{dy / len, -dx / len}};
532 }
533
534 const std::array<std::array<int, 2>, 5> counts = {
535 {{{1, 1}}, {{2, 2}}, {{3, 3}}, {{1, 3}}, {{3, 1}}}};
536 for (const auto &n : counts)
537 {
538 const BasisKey b0(eOrtho_A, n[0], PointsKey(n[0], eGaussGaussLegendre));
539 const BasisKey b1(eOrtho_A, n[1], PointsKey(n[1], eGaussGaussLegendre));
541 b0, b1, quad.get());
542 BOOST_REQUIRE_EQUAL(exp->GetGeomFactors()->GetGtype(),
544
545 for (int e = 0; e < 4; ++e)
546 {
547 const auto &normal = exp->GetTraceNormal(e);
548 for (size_t q = 0; q < normal[0].size(); ++q)
549 {
550 BOOST_CHECK_MESSAGE(
551 std::abs(normal[0][q] - exact[e][0]) < 1.0e-12 &&
552 std::abs(normal[1][q] - exact[e][1]) < 1.0e-12,
553 "points " << n[0] << " x " << n[1] << ", edge " << e
554 << ": normal (" << normal[0][q] << ", "
555 << normal[1][q] << ") against (" << exact[e][0]
556 << ", " << exact[e][1] << ")");
557 }
558 }
559 }
560}
561
562} // namespace Nektar::AlignedTraceNormalTests
Describes the specification for a Basis.
Definition Basis.h:45
Defines a specification for a set of points.
Definition Points.h:50
NormalVector GetAlignedTraceNormal(const int traceid, const StdRegions::StdExpansion &traceExp)
Return the normals of trace traceid at the quadrature points of traceExp, in the frame of the shared ...
Definition Expansion.h:286
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:465
void FillGeom()
Gather the coefficients of from this object's boundary, unless that has already been done.
Definition Geometry.h:591
std::pair< CurveUniquePtr, std::vector< PointGeomUniquePtr > > MakeOrder(int order, const LibUtilities::PointsType pType)
Re-express this object's curvature at polynomial order order, returning the curve and the points gene...
Definition Geometry.cpp:425
void UpdatePosition(NekDouble x, NekDouble y, NekDouble z)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
void GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
this function returns the physical coordinates of the quadrature points of the expansion
static void CheckAlignedNormals(LocalRegions::Expansion &elmt, const int face, LocalRegions::Expansion &bnd, const std::array< NekDouble, 3 > &centre)
Check that the normals of face, sampled on bnd, are unit vectors orthogonal to the boundary expansion...
BOOST_AUTO_TEST_CASE(TestDeformedFaceNormalWithDifferentQuadrature)
static void MakeCurvedHex(CurvedHex &p, const int rot, const bool reverse)
Build a hexahedron whose faces are numbered rot steps around (and optionally reversed),...
static CurvedTet MakeCurvedTet(const int flip=0)
Build a tetrahedron with a curved face 0. Setting bit i of flip traverses face i (1-3) the other way ...
static std::array< NekDouble, 3 > Centre(LocalRegions::Expansion &elmt)
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
Definition Interp.cpp:101
@ eNodalTriEvenlySpaced
2D Evenly-spaced points on a Triangle
Definition PointsType.h:83
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition PointsType.h:51
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
Definition PointsType.h:73
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition PointsType.h:46
@ eModified_B
Principle Modified Functions .
Definition BasisType.h:49
@ eOrtho_A
Principle Orthogonal Functions .
Definition BasisType.h:42
@ eModified_C
Principle Modified Functions .
Definition BasisType.h:50
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition Expansion.h:66
unique_ptr_objpool< HexGeom > HexGeomUniquePtr
Definition MeshGraph.h:77
std::map< int, CurveUniquePtr > CurveMap
Definition Curve.hpp:61
unique_ptr_objpool< QuadGeom > QuadGeomUniquePtr
Definition MeshGraph.h:73
@ eDeformed
Geometry is curved or has non-constant factors.
unique_ptr_objpool< SegGeom > SegGeomUniquePtr
Definition MeshGraph.h:71
unique_ptr_objpool< PointGeom > PointGeomUniquePtr
Definition Geometry.h:60
unique_ptr_objpool< TriGeom > TriGeomUniquePtr
Definition MeshGraph.h:72
unique_ptr_objpool< TetGeom > TetGeomUniquePtr
Definition MeshGraph.h:74
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition Vmath.hpp:611
Storage for a hexahedron with curved faces; entities must outlive it.
std::vector< SpatialDomains::PointGeomUniquePtr > nodes
std::array< SpatialDomains::QuadGeomUniquePtr, 6 > faces
std::array< SpatialDomains::PointGeomUniquePtr, 8 > verts
std::array< SpatialDomains::SegGeomUniquePtr, 12 > edges
std::vector< SpatialDomains::PointGeomUniquePtr > nodes
std::array< SpatialDomains::SegGeomUniquePtr, 6 > edges
std::array< SpatialDomains::PointGeomUniquePtr, 4 > verts
std::array< SpatialDomains::TriGeomUniquePtr, 4 > faces