52template <
typename TData>
55 return x + TData(2.0) * y + TData(3.0) * z;
58template <
typename TData>
60 :
public TestOp<TData, FieldState::Phys, FieldState::Phys>
77 const auto regionIter = bregions.find(boundaryRegionId);
78 ASSERTL0(regionIter != bregions.end(),
79 "Boundary region id not found in this mesh.");
81 const auto &vars = this->
session->GetVariables();
83 this->
session, *(regionIter->second),
graph,
true, vars[0],
false,
92 auto nvars = this->
session->GetVariables().size();
93 auto inblockAttr = GetBlockAttributes<TData, FieldState::Phys>(
96 auto outblockAttr = GetBlockAttributes<TData, FieldState::Phys>(
104 "f_expected", outblockAttr, nvars, nhomo);
120 const auto &expansions = collection.GetExpVector();
123 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
129 for (
size_t el = 0;
el < expansions.size(); ++
el)
131 const auto npts = expansions[
el]->GetTotPoints();
134 expansions[
el]->GetCoords(x, y, z);
135 for (
int q = 0; q < npts; ++q, ++cnt)
137 inptr[cnt] = PhysTraceExtractBndCondTestFn<TData>(
138 static_cast<TData
>(x[q]),
static_cast<TData
>(y[q]),
139 static_cast<TData
>(z[q]));
142 inptr += block.CompSize();
153 const auto &expansions = collection.GetExpVector();
156 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
162 for (
size_t el = 0;
el < expansions.size(); ++
el)
164 const auto npts = expansions[
el]->GetTotPoints();
167 expansions[
el]->GetCoords(x, y, z);
168 for (
int q = 0; q < npts; ++q, ++cnt)
170 expptr[cnt] = PhysTraceExtractBndCondTestFn<TData>(
171 static_cast<TData
>(x[q]),
static_cast<TData
>(y[q]),
172 static_cast<TData
>(z[q]));
175 expptr += block.CompSize();
185 const std::string execStr(GlobalConfiguration::ExecStr());
188 RunTestCase<NektarSpaces::Serial>();
192 RunTestCase<NektarSpaces::AVX>();
197 "TestPhysTraceExtractBndCond runs on Serial and AVX, "
219 BOOST_TEST(this->
Compare(1.0E-10));
225 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
227 outptr + block.CompSize() * block.GetNumComponents() *
228 block.GetNumHomoModes(),
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
SpatialDomains::MeshGraphSharedPtr graph
SpatialDomains::Geometry * el
A Field represents expansion data to be operated on.
void ReshapeStorage(const unsigned int &interleaveWidth, const std::string &execSpace)
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
unsigned int GetNumHomoModes() const
Gets the number of homogeneous modes.
unsigned int GetNumComponents() const
Gets the number of components for a vector field.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
const BoundaryRegionCollection & GetBoundaryRegions(void) const
virtual bool Compare(TData tol)
Compare this field to another field, with absolute tolerance tol. The two must have the same blocks a...
std::shared_ptr< MultiRegions::ExpList > fixt_explist
Field< TData, stateOut > * fixt_out
Field< TData, stateIn > * fixt_in
Field< TData, stateOut > * fixt_expected
LibUtilities::SessionReaderSharedPtr session
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Collections::Collection GetCollection(MultiRegions::ExpListSharedPtr expansionList, unsigned int block_idx)
FieldState
Possible states for Field data.
static const std::string name
static const std::string name