40#include <SolverCore/GlobalLinSysOps/LinearSolvers/LinearSolverOp.hpp>
41#include <SolverCore/GlobalLinSysOps/LinearSystems/FwdTrans/FwdTransOp.hpp>
42#include <SolverCore/PreconOps/PreconOp.hpp>
54 const unsigned int numComp =
56 const size_t nphys = this->
m_expList->GetTotPoints();
65 if (this->
m_session->DefinesFunction(
"Forcing"))
67 for (
unsigned int n = 0; n < numComp; ++n)
70 "Forcing", n % this->
m_session->GetVariables().size());
72 func->Evaluate(x, y, z, fceVar);
76 for (
unsigned int blk = 0; blk < this->
m_in.
GetBlocks().size(); ++blk)
80 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
81 for (
unsigned int n = 0; n < numComp; ++n)
86 auto fceptr = fce.data() + n * nphys;
88 for (
size_t el = 0, cnt = 0;
el < block.GetNumElements(); ++
el)
90 for (
unsigned int phys = 0; phys < block.GetNumData();
93 if (this->
m_session->DefinesFunction(
"Forcing"))
95 inptr[cnt] = *(fceptr++);
102 for (
unsigned int p = 1; p < 4; ++p)
105 (n + 1) * p * std::pow(*xptr, p);
111 for (
unsigned int p = 1; p < 4; ++p)
113 inptr[cnt] += (n + 1) * p *
122 for (
unsigned int p = 1; p < 4; ++p)
125 (n + 1) * p * std::pow(*xptr, p) *
126 std::pow(*yptr, p) * std::pow(*zptr, p);
136 inptr += block.CompSize();
140 this->
m_out.template Initialize<NektarSpaces::HostSpace>(0.0);
148 std::string execStr(GlobalConfiguration::ExecStr());
149 std::string implStr(GlobalConfiguration::ImplStr());
152 if (implStr ==
"SumFac" || execStr ==
"AVX")
155 NektarSpaces::GetVectorWidth<TData>(execStr), execStr);
157 NektarSpaces::GetVectorWidth<TData>(execStr));
166 linsolve->SetVerboseOutput(
true);
167 op->SetLinearSolver(linsolve);
168 op->SetPrecon(precon);
176 const unsigned int numComp =
178 const size_t nphys = this->
m_expList->GetTotPoints();
179 const size_t ncoeffs = this->
m_expList->GetNcoeffs();
180 const auto &variables = this->
m_session->GetVariables();
188 for (
unsigned int n = 0; n < numComp; ++n)
195 expListVar->FwdTrans(inphysVar, outcoeffsVar);
199 this->
m_expected.template CopyArray<NektarSpaces::HostSpace>(outcoeffs);
207#if defined(NEKTAR_ENABLE_SINGLE_PRECISION)
208#define TESTFLOAT(type, filename) \
209 class type##float : public TestFwdTrans<float> \
214 m_meshName = filename; \
218#define TESTFLOAT(type, filename)
220#if defined(NEKTAR_ENABLE_DOUBLE_PRECISION)
221#define TESTDOUBLE(type, filename) \
222 class type : public TestFwdTrans<double> \
227 m_meshName = filename; \
231#define TESTDOUBLE(type, filename)
233#define TEST(type, filename) \
234 TESTFLOAT(type, filename) \
235 TESTDOUBLE(type, filename)
238TEST(Helmholtz1D_Seg,
"run/Helmholtz1D_P8.xml")
240TEST(Helmholtz2D_Tri_Quad, "run/Helmholtz2D_varP.xml")
241TEST(Helmholtz2D_Tri_Quad_3C, "run/Helmholtz2D_3C.xml")
243TEST(Helmholtz2D_AllBCs, "run/Helmholtz2D_P7_AllBCs.xml")
245TEST(Helmholtz3D_Hex, "run/Helmholtz3D_Hex_Heterogeneous.xml")
246TEST(Helmholtz3D_Hex_3C, "run/Helmholtz3D_Hex_3C.xml")
248TEST(Helmholtz3D_Prism, "run/Helmholtz3D_Prism_VarP.xml")
249TEST(Helmholtz3D_Prism_3C, "run/Helmholtz3D_Prism_3C.xml")
251TEST(Helmholtz3D_Pyr, "run/Helmholtz3D_Pyr_VarP.xml")
253TEST(Helmholtz3D_Tet, "run/Helmholtz3D_Tet_VarP.xml")
254TEST(Helmholtz3D_Tet_3C, "run/Helmholtz3D_Tet_3C.xml")
SpatialDomains::MeshGraphSharedPtr graph
#define TEST(type, filename)
SpatialDomains::Geometry * el
void ReshapeStorage(const unsigned int &interleaveWidth, const std::string &execSpace)
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
Nektar::Array< Nektar::OneD, TDataOut > ToArray()
Copy the data to a Nektar::Array, component by component and element by element, without padding,...
unsigned int GetNumHomoModes() const
Gets the number of homogeneous modes.
void SetInterleaveWidth(const unsigned int &interleaveWidth)
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.
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true, SpatialDomains::MeshGraphSharedPtr partitionedGraph=nullptr)
void RunTestCase(const std::string &method)
Field< TData, FieldState::Coeff > m_out
Field< TData, FieldState::Phys > m_in
ExpListSharedPtr m_expList
SessionReaderSharedPtr m_session
Field< TData, FieldState::Coeff > m_expected