Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
TestPhysTraceExtract< TData > Class Template Reference

#include <TestPhysTraceExtract.hpp>

Inheritance diagram for TestPhysTraceExtract< TData >:
[legend]

Public Member Functions

 TestPhysTraceExtract ()=default
 
void Configure (const bool useGLLTracePoints=false)
 Build the session, expansion list and fields.
 
void SetFixture (const unsigned int nhomo) override
 
void SetTestCase ()
 
void RunTestCase (bool nonCollocated=false)
 
void RunTestCaseExtractTrace (bool nonCollocated=false)
 
LocalRegions::ExpansionSharedPtr GLLTraceExp (const LocalRegions::ExpansionSharedPtr &expPtr, const unsigned traceid)
 Build the trace expansion on the Gauss-Lobatto trace points.
 
void ExpectedSolution ()
 
- Public Member Functions inherited from TestOp< TData, FieldState::Phys, FieldState::Phys >
 TestOp ()=default
 
virtual ~TestOp ()
 
void Configure (void)
 
void Configure3DH1 (const unsigned int nhomo=1)
 
void Configure3DH2 (const unsigned int nhomoY=1, const unsigned int nhomoZ=1)
 
void SetSession (void)
 
void SetExpList (void)
 
void SetExpList3DH1 (const unsigned int nhomo=1)
 
void SetExpList3DH2 (const unsigned int nhomoY=1, const unsigned int nhomoZ=1)
 
virtual bool Compare (TData tol)
 Compare this field to another field, with absolute tolerance tol. The two must have the same blocks and components; their interleave widths may differ.
 

Protected Attributes

bool m_useGLLTracePoints = false
 Whether the fields are sized for, and the operator asked for, the Gauss-Lobatto trace points rather than the element's own; set by Configure().
 
- Protected Attributes inherited from TestOp< TData, FieldState::Phys, FieldState::Phys >
std::string meshName
 
Field< TData, stateIn > * fixt_in
 
Field< TData, stateOut > * fixt_out
 
Field< TData, stateIn > * fixt_out_2
 
Field< TData, stateOut > * fixt_expected
 
std::shared_ptr< MultiRegions::ExpList > fixt_explist
 
LibUtilities::SessionReaderSharedPtr session
 

Additional Inherited Members

- Static Public Member Functions inherited from TestOp< TData, FieldState::Phys, FieldState::Phys >
static void MixInterleaveWidths (TField &field)
 Put the blocks of field at alternating interleave widths, the execution space's vector width on even blocks and 1 on odd ones, reshaping the data in place: a field whose blocks differ in width, for an operator that must read any mix, such as the trace flux, which addresses each trace at the width of the element block it lies in. On Serial every width is 1 and nothing changes.
 

Detailed Description

template<typename TData>
class TestPhysTraceExtract< TData >

Definition at line 47 of file TestPhysTraceExtract.hpp.

Constructor & Destructor Documentation

◆ TestPhysTraceExtract()

template<typename TData >
TestPhysTraceExtract< TData >::TestPhysTraceExtract ( )
default

Member Function Documentation

◆ Configure()

template<typename TData >
void TestPhysTraceExtract< TData >::Configure ( const bool  useGLLTracePoints = false)
inline

Build the session, expansion list and fields.

Parameters
useGLLTracePointsExtract onto the Gauss-Lobatto trace points rather than the element's own; see PhysTraceExtractOp:: SetUseGLLTracePoints(). It sizes the storage, so it is fixed here rather than at the call to the operator.

Definition at line 63 of file TestPhysTraceExtract.hpp.

64 {
65 m_useGLLTracePoints = useGLLTracePoints;
66 this->SetSession();
67 this->SetExpList();
68 this->fixt_explist->SetDataWarehouse();
69 SetFixture(1);
70 }
std::shared_ptr< MultiRegions::ExpList > fixt_explist
Definition TestOp.hpp:439
bool m_useGLLTracePoints
Whether the fields are sized for, and the operator asked for, the Gauss-Lobatto trace points rather t...
void SetFixture(const unsigned int nhomo) override

References TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_explist, TestPhysTraceExtract< TData >::m_useGLLTracePoints, TestOp< TData, FieldState::Phys, FieldState::Phys >::SetExpList(), TestPhysTraceExtract< TData >::SetFixture(), and TestOp< TData, FieldState::Phys, FieldState::Phys >::SetSession().

◆ ExpectedSolution()

template<typename TData >
void TestPhysTraceExtract< TData >::ExpectedSolution ( )
inline

Definition at line 281 of file TestPhysTraceExtract.hpp.

282 {
283 const unsigned numComp = this->fixt_in->GetNumComponents();
284
285 auto inblockAttr = GetBlockAttributes<TData, FieldState::Phys>(
286 this->fixt_explist,
287 MultiRegions::UnitInterleaveWidths(this->fixt_explist));
288
289 size_t eid = 0;
290 for (unsigned blk = 0; blk < inblockAttr.size(); ++blk)
291 {
292 auto numElmts = inblockAttr[blk].GetNumElements();
293 auto numElmtsPad = inblockAttr[blk].GetNumElementsWithPadding();
294 auto numData = inblockAttr[blk].GetNumData();
295
296 auto inptr =
297 this->fixt_in->GetBlocks()[blk]
298 .template GetPtr<NektarSpaces::HostSpace, ReadOnly>();
299
300 auto outptr =
301 this->fixt_expected->GetBlocks()[blk]
302 .template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
303
304 Array<OneD, TData> outphys(
305 this->fixt_expected->GetBlocks()[blk].GetNumData() / 2);
306
307 for (unsigned nc = 0; nc < numComp; ++nc)
308 {
309 unsigned physoffset = 0;
310 unsigned ntrace = 0;
311 for (unsigned e = 0; e < numElmts; ++e)
312 {
313 auto expPtr = this->fixt_explist->GetExp(eid + e);
314 Array<OneD, double> indata(numData, inptr + physoffset);
315
316 auto Shape = expPtr->DetShapeType();
317
318 // set up local trace expansions
319 auto nface = expPtr->GetNtraces();
320 std::vector<LocalRegions::ExpansionSharedPtr> TraceExp;
321 TraceExp.resize(nface);
322 if (Shape != LibUtilities::Seg) // ignore Segs since
323 // method does not exist
324 {
325 for (unsigned t = 0; t < nface; ++t)
326 {
327 TraceExp[t] = m_useGLLTracePoints
328 ? GLLTraceExp(expPtr, t)
329 : expPtr->GetLocTraceExp(t);
330 }
331 }
332 ntrace = 0;
333
334 switch (Shape)
335 {
337 {
338 expPtr->GetTracePhysVals(0, expPtr, indata, outphys,
340 outptr[0] = outphys[0];
341 expPtr->GetTracePhysVals(1, expPtr, indata, outphys,
343 outptr[1] = outphys[0];
344 outptr += 2;
345 ntrace = 2;
346 }
347 break;
349 {
350 // edge 3
351 auto npts = TraceExp[3]->GetTotPoints();
352 expPtr->GetTracePhysVals(3, TraceExp[3], indata,
353 outphys,
355 std::copy(outphys.data(), outphys.data() + npts,
356 outptr);
357
358 // edge 1
359 expPtr->GetTracePhysVals(1, TraceExp[1], indata,
360 outphys,
362 std::copy(outphys.data(), outphys.data() + npts,
363 outptr + npts);
364
365 outptr += 2 * npts;
366 ntrace = 2 * npts;
367
368 // edge 0
369 npts = TraceExp[0]->GetTotPoints();
370 expPtr->GetTracePhysVals(0, TraceExp[0], indata,
371 outphys,
373 std::copy(outphys.data(), outphys.data() + npts,
374 outptr);
375 outptr += npts;
376 ntrace += npts;
377
378 // edge 2
379 expPtr->GetTracePhysVals(2, TraceExp[2], indata,
380 outphys,
382 std::copy(outphys.data(), outphys.data() + npts,
383 outptr);
384 outptr += npts;
385 ntrace += npts;
386 }
387 break;
390 {
391 // edge 2
392 auto npts = TraceExp[2]->GetTotPoints();
393 expPtr->GetTracePhysVals(2, TraceExp[2], indata,
394 outphys,
396 std::copy(outphys.data(), outphys.data() + npts,
397 outptr);
398
399 // edge 1
400 expPtr->GetTracePhysVals(1, TraceExp[1], indata,
401 outphys,
403 std::copy(outphys.data(), outphys.data() + npts,
404 outptr + npts);
405
406 outptr += 2 * npts;
407 ntrace = 2 * npts;
408
409 // edge 0
410 npts = TraceExp[0]->GetTotPoints();
411 expPtr->GetTracePhysVals(0, TraceExp[0], indata,
412 outphys,
414 std::copy(outphys.data(), outphys.data() + npts,
415 outptr);
416 outptr += npts;
417 ntrace += npts;
418 }
419 break;
425 {
426 auto npts = TraceExp[2]->GetTotPoints();
427 // face 4
428 expPtr->GetTracePhysVals(
429 4, TraceExp[4], indata, outphys,
431 std::copy(outphys.data(), outphys.data() + npts,
432 outptr);
433 outptr += npts;
434 ntrace += npts;
435
436 // face 2
437 expPtr->GetTracePhysVals(
438 2, TraceExp[2], indata, outphys,
440 std::copy(outphys.data(), outphys.data() + npts,
441 outptr);
442 outptr += npts;
443 ntrace += npts;
444
445 // face 1
446 npts = TraceExp[1]->GetTotPoints();
447 expPtr->GetTracePhysVals(
448 1, TraceExp[1], indata, outphys,
450 std::copy(outphys.data(), outphys.data() + npts,
451 outptr);
452 outptr += npts;
453 ntrace += npts;
454
455 // face 3
456 expPtr->GetTracePhysVals(
457 3, TraceExp[3], indata, outphys,
459 std::copy(outphys.data(), outphys.data() + npts,
460 outptr);
461 outptr += npts;
462 ntrace += npts;
463
464 // face 0
465 npts = TraceExp[0]->GetTotPoints();
466 expPtr->GetTracePhysVals(
467 0, TraceExp[0], indata, outphys,
469 std::copy(outphys.data(), outphys.data() + npts,
470 outptr);
471 outptr += npts;
472 ntrace += npts;
473
474 if (Shape == LibUtilities::Hex)
475 {
476 // face 5
477 expPtr->GetTracePhysVals(
478 5, TraceExp[5], indata, outphys,
480 std::copy(outphys.data(), outphys.data() + npts,
481 outptr);
482 outptr += npts;
483 ntrace += npts;
484 }
485 }
486 break;
489 {
490 auto npts = TraceExp[2]->GetTotPoints();
491 // face 3
492 expPtr->GetTracePhysVals(
493 3, TraceExp[3], indata, outphys,
495 std::copy(outphys.data(), outphys.data() + npts,
496 outptr);
497 outptr += npts;
498 ntrace += npts;
499
500 // face 2
501 expPtr->GetTracePhysVals(
502 2, TraceExp[2], indata, outphys,
504 std::copy(outphys.data(), outphys.data() + npts,
505 outptr);
506 outptr += npts;
507 ntrace += npts;
508
509 // face 1
510 npts = TraceExp[1]->GetTotPoints();
511 expPtr->GetTracePhysVals(
512 1, TraceExp[1], indata, outphys,
514 std::copy(outphys.data(), outphys.data() + npts,
515 outptr);
516 outptr += npts;
517 ntrace += npts;
518
519 // face 0
520 npts = TraceExp[0]->GetTotPoints();
521 expPtr->GetTracePhysVals(
522 0, TraceExp[0], indata, outphys,
524 std::copy(outphys.data(), outphys.data() + npts,
525 outptr);
526 outptr += npts;
527 ntrace += npts;
528 }
529 break;
530 default:
532 "Need to define shape details");
533 break;
534 }
535 physoffset += numData;
536 }
537 inptr += numData * numElmtsPad;
538 outptr +=
539 ntrace * (numElmtsPad - numElmts); // offset for padded case
540 }
541 eid += numElmts;
542 }
543 }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
unsigned int GetNumComponents() const
Gets the number of components for a vector field.
LocalRegions::ExpansionSharedPtr GLLTraceExp(const LocalRegions::ExpansionSharedPtr &expPtr, const unsigned traceid)
Build the trace expansion on the Gauss-Lobatto trace points.

References Nektar::StdRegions::eDir1FwdDir1_Dir2FwdDir2, Nektar::ErrorUtil::efatal, Nektar::StdRegions::eForwards, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_expected, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_in, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), TestPhysTraceExtract< TData >::GLLTraceExp(), Nektar::LibUtilities::Hex, TestPhysTraceExtract< TData >::m_useGLLTracePoints, NEKERROR, Nektar::LibUtilities::NodalPrism, Nektar::LibUtilities::NodalPyr, Nektar::LibUtilities::NodalTet, Nektar::LibUtilities::NodalTri, Nektar::LibUtilities::Prism, Nektar::LibUtilities::Pyr, Nektar::LibUtilities::Quad, Nektar::LibUtilities::Seg, Nektar::LibUtilities::Tet, and Nektar::LibUtilities::Tri.

Referenced by TestPhysTraceExtract< TData >::SetTestCase().

◆ GLLTraceExp()

template<typename TData >
LocalRegions::ExpansionSharedPtr TestPhysTraceExtract< TData >::GLLTraceExp ( const LocalRegions::ExpansionSharedPtr &  expPtr,
const unsigned  traceid 
)
inline

Build the trace expansion on the Gauss-Lobatto trace points.

The counterpart of Expansion::GetLocTraceExp() for the variant the operator is being asked for, so that the legacy GetTracePhysVals() below interpolates onto the same points the operator writes. Only a three-dimensional element has anything to choose: a triangle already hands its collapsed edges a Gauss-Lobatto basis with the extra point.

Parameters
expPtrElement whose trace is wanted.
traceidTrace of that element.
Returns
The trace expansion on the Gauss-Lobatto points.

Definition at line 258 of file TestPhysTraceExtract.hpp.

260 {
261 if (expPtr->GetShapeDimension() < 3)
262 {
263 return expPtr->GetLocTraceExp(traceid);
264 }
265
266 auto geom = expPtr->GetGeom();
267 auto faceGeom = geom->GetFace(traceid);
268 const auto Ba = expPtr->GetTraceBasisKey(traceid, 0, true);
269 const auto Bb = expPtr->GetTraceBasisKey(traceid, 1, true);
270
271 if (faceGeom->GetNumVerts() == 3)
272 {
274 Ba, Bb, geom->GetFace(traceid));
275 }
276
278 Ba, Bb, geom->GetFace(traceid));
279 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

Referenced by TestPhysTraceExtract< TData >::ExpectedSolution().

◆ RunTestCase()

template<typename TData >
void TestPhysTraceExtract< TData >::RunTestCase ( bool  nonCollocated = false)
inline

Definition at line 124 of file TestPhysTraceExtract.hpp.

125 {
127 this->fixt_explist, this->session->GetVariables());
128
130 {
131 op->SetUseGLLTracePoints(true);
132 }
133
134 if (nonCollocated)
135 {
136 op->SetIsCollocated(false);
137 }
138
139 op->Apply(*this->fixt_in, *this->fixt_out);
140 }
static std::shared_ptr< PhysTraceExtractOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a trace extraction operator through the operator and block-operator factories.
LibUtilities::SessionReaderSharedPtr session
Definition TestOp.hpp:440

References Nektar::MultiRegions::PhysTraceExtractOp< TData >::Create(), TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_in, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_out, TestPhysTraceExtract< TData >::m_useGLLTracePoints, and TestOp< TData, FieldState::Phys, FieldState::Phys >::session.

◆ RunTestCaseExtractTrace()

template<typename TData >
void TestPhysTraceExtract< TData >::RunTestCaseExtractTrace ( bool  nonCollocated = false)
inline

Definition at line 142 of file TestPhysTraceExtract.hpp.

143 {
145 this->fixt_explist, this->session->GetVariables());
146
148 {
149 op->SetUseGLLTracePoints(true);
150 }
151
152 if (nonCollocated)
153 {
154 op->SetIsCollocated(false);
155 }
156
157 // This test case will only run on problems of fixed p and same shape
158 auto exp = this->fixt_explist->GetExp(0);
159 switch (exp->DetShapeType())
160 {
163 {
164 op->ExtractTrace(2, *this->fixt_in, *this->fixt_out, 0);
165 auto pts = exp->GetTraceBasisKey(2).GetNumPoints();
166 op->ExtractTrace(1, *this->fixt_in, *this->fixt_out, pts);
167 pts += exp->GetTraceBasisKey(1).GetNumPoints();
168 op->ExtractTrace(0, *this->fixt_in, *this->fixt_out, pts);
169 }
170 break;
172 {
173 op->ExtractTrace(3, *this->fixt_in, *this->fixt_out, 0);
174 auto pts = exp->GetTraceBasisKey(3).GetNumPoints();
175 op->ExtractTrace(1, *this->fixt_in, *this->fixt_out, pts);
176 pts += exp->GetTraceBasisKey(1).GetNumPoints();
177 op->ExtractTrace(0, *this->fixt_in, *this->fixt_out, pts);
178 pts += exp->GetTraceBasisKey(0).GetNumPoints();
179 op->ExtractTrace(2, *this->fixt_in, *this->fixt_out, pts);
180 }
181 break;
184 {
185 op->ExtractTrace(3, *this->fixt_in, *this->fixt_out, 0);
186 auto pts = exp->GetTraceBasisKey(3, 0).GetNumPoints() *
187 exp->GetTraceBasisKey(3, 1).GetNumPoints();
188 op->ExtractTrace(2, *this->fixt_in, *this->fixt_out, pts);
189 pts += exp->GetTraceBasisKey(2, 0).GetNumPoints() *
190 exp->GetTraceBasisKey(2, 1).GetNumPoints();
191 op->ExtractTrace(1, *this->fixt_in, *this->fixt_out, pts);
192 pts += exp->GetTraceBasisKey(1, 0).GetNumPoints() *
193 exp->GetTraceBasisKey(1, 1).GetNumPoints();
194 op->ExtractTrace(0, *this->fixt_in, *this->fixt_out, pts);
195 }
196 break;
201 {
202 op->ExtractTrace(4, *this->fixt_in, *this->fixt_out, 0);
203 auto pts = exp->GetTraceBasisKey(4, 0).GetNumPoints() *
204 exp->GetTraceBasisKey(4, 1).GetNumPoints();
205 op->ExtractTrace(2, *this->fixt_in, *this->fixt_out, pts);
206 pts += exp->GetTraceBasisKey(2, 0).GetNumPoints() *
207 exp->GetTraceBasisKey(2, 1).GetNumPoints();
208 op->ExtractTrace(1, *this->fixt_in, *this->fixt_out, pts);
209 pts += exp->GetTraceBasisKey(1, 0).GetNumPoints() *
210 exp->GetTraceBasisKey(1, 1).GetNumPoints();
211 op->ExtractTrace(3, *this->fixt_in, *this->fixt_out, pts);
212 pts += exp->GetTraceBasisKey(3, 0).GetNumPoints() *
213 exp->GetTraceBasisKey(3, 1).GetNumPoints();
214 op->ExtractTrace(0, *this->fixt_in, *this->fixt_out, pts);
215 }
216 break;
218 {
219 op->ExtractTrace(4, *this->fixt_in, *this->fixt_out, 0);
220 auto pts = exp->GetTraceBasisKey(4, 0).GetNumPoints() *
221 exp->GetTraceBasisKey(4, 1).GetNumPoints();
222 op->ExtractTrace(2, *this->fixt_in, *this->fixt_out, pts);
223 pts += exp->GetTraceBasisKey(2, 0).GetNumPoints() *
224 exp->GetTraceBasisKey(2, 1).GetNumPoints();
225 op->ExtractTrace(1, *this->fixt_in, *this->fixt_out, pts);
226 pts += exp->GetTraceBasisKey(1, 0).GetNumPoints() *
227 exp->GetTraceBasisKey(1, 1).GetNumPoints();
228 op->ExtractTrace(3, *this->fixt_in, *this->fixt_out, pts);
229 pts += exp->GetTraceBasisKey(3, 0).GetNumPoints() *
230 exp->GetTraceBasisKey(3, 1).GetNumPoints();
231 op->ExtractTrace(0, *this->fixt_in, *this->fixt_out, pts);
232 pts += exp->GetTraceBasisKey(0, 0).GetNumPoints() *
233 exp->GetTraceBasisKey(0, 1).GetNumPoints();
234 op->ExtractTrace(5, *this->fixt_in, *this->fixt_out, pts);
235 }
236 break;
237 default:
238 NEKERROR(ErrorUtil::efatal, "Shape not set up ");
239 break;
240 }
241 }

References Nektar::MultiRegions::PhysTraceExtractOp< TData >::Create(), Nektar::ErrorUtil::efatal, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_in, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_out, Nektar::LibUtilities::Hex, TestPhysTraceExtract< TData >::m_useGLLTracePoints, NEKERROR, Nektar::LibUtilities::NodalPrism, Nektar::LibUtilities::NodalPyr, Nektar::LibUtilities::NodalTet, Nektar::LibUtilities::NodalTri, Nektar::LibUtilities::Prism, Nektar::LibUtilities::Pyr, Nektar::LibUtilities::Quad, TestOp< TData, FieldState::Phys, FieldState::Phys >::session, Nektar::LibUtilities::Tet, and Nektar::LibUtilities::Tri.

◆ SetFixture()

template<typename TData >
void TestPhysTraceExtract< TData >::SetFixture ( const unsigned int  nhomo)
inlineoverridevirtual

Reimplemented from TestOp< TData, FieldState::Phys, FieldState::Phys >.

Definition at line 72 of file TestPhysTraceExtract.hpp.

73 {
74 auto nin = this->session->GetVariables().size();
75 auto nout = this->session->GetVariables().size();
76 auto inblockAttr = GetBlockAttributes<TData, FieldState::Phys>(
77 this->fixt_explist,
78 MultiRegions::UnitInterleaveWidths(this->fixt_explist));
79 auto outblockAttr = GetLocTraceBlockAttributes<TData, FieldState::Phys>(
81
82 auto f_in =
83 Field<TData, FieldState::Phys>("f_in", inblockAttr, nin, nhomo);
84 auto f_out =
85 Field<TData, FieldState::Phys>("f_out", outblockAttr, nout, nhomo);
86
87 auto f_expected = Field<TData, FieldState::Phys>(
88 "f_expected", outblockAttr, nout, nhomo);
89 this->fixt_in = new Field<TData, FieldState::Phys>(std::move(f_in));
90 this->fixt_out = new Field<TData, FieldState::Phys>(std::move(f_out));
91 this->fixt_expected =
92 new Field<TData, FieldState::Phys>(std::move(f_expected));
93 }
A Field represents expansion data to be operated on.

References TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_expected, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_in, TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_out, TestPhysTraceExtract< TData >::m_useGLLTracePoints, and TestOp< TData, FieldState::Phys, FieldState::Phys >::session.

Referenced by TestPhysTraceExtract< TData >::Configure().

◆ SetTestCase()

template<typename TData >
void TestPhysTraceExtract< TData >::SetTestCase ( )
inline

Definition at line 95 of file TestPhysTraceExtract.hpp.

96 {
97 // Set initial conditions.
98 for (unsigned blk = 0; blk < this->fixt_in->GetBlocks().size(); ++blk)
99 {
100 auto &block = this->fixt_in->GetBlocks()[blk];
101 auto inptr =
102 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
103
104 for (unsigned n = 0; n < this->fixt_in->GetNumComponents() *
105 this->fixt_in->GetNumHomoModes();
106 ++n)
107 {
108 for (size_t el = 0, cnt = 0; el < block.GetNumElements(); ++el)
109 {
110 for (unsigned phys = 0; phys < block.GetNumData();
111 ++phys, ++cnt)
112 {
113 inptr[cnt] = phys + n;
114 }
115 }
116 inptr += block.CompSize();
117 }
118 }
119
120 // Compute expected solution.
122 }
SpatialDomains::Geometry * el
unsigned int GetNumHomoModes() const
Gets the number of homogeneous modes.

References el, TestPhysTraceExtract< TData >::ExpectedSolution(), TestOp< TData, FieldState::Phys, FieldState::Phys >::fixt_in, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), and Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes().

Member Data Documentation

◆ m_useGLLTracePoints

template<typename TData >
bool TestPhysTraceExtract< TData >::m_useGLLTracePoints = false
protected

Whether the fields are sized for, and the operator asked for, the Gauss-Lobatto trace points rather than the element's own; set by Configure().

Definition at line 549 of file TestPhysTraceExtract.hpp.

Referenced by TestPhysTraceExtract< TData >::Configure(), TestPhysTraceExtract< TData >::ExpectedSolution(), TestPhysTraceExtract< TData >::RunTestCase(), TestPhysTraceExtract< TData >::RunTestCaseExtractTrace(), and TestPhysTraceExtract< TData >::SetFixture().