40#include <SolverCore/GlobalLinSysOps/LinearSolvers/LinearSolverOp.hpp>
41#include <SolverCore/GlobalLinSysOps/LinearSystems/HelmSolve/HelmSolveOp.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);
144 ? this->
m_session->GetParameter(
"Lambda")
174 std::string execStr(GlobalConfiguration::ExecStr());
175 std::string implStr(GlobalConfiguration::ImplStr());
178 if (implStr ==
"SumFac" || execStr ==
"AVX")
181 NektarSpaces::GetVectorWidth<TData>(execStr), execStr);
183 NektarSpaces::GetVectorWidth<TData>(execStr));
196 m_op->SetPrecon(precon);
197 m_op->UpdatePrecon();
214 const std::string &value)
217 this->
m_session->GetVariables()[0], property, value);
228 const unsigned int numComp =
230 const size_t nphys = this->
m_expList->GetTotPoints();
231 const size_t ncoeffs = this->
m_expList->GetNcoeffs();
232 const auto &variables = this->
m_session->GetVariables();
261 for (
unsigned int n = 0; n < numComp; ++n)
268 expListVar->HelmSolve(inphysVar, outcoeffsVar, factors);
272 this->
m_expected.template CopyArray<NektarSpaces::HostSpace>(outcoeffs);
279 std::shared_ptr<HelmSolveOp<TData>>
m_op;
284#if defined(NEKTAR_ENABLE_SINGLE_PRECISION)
285#define TESTFLOAT(type, filename) \
286 class type##float : public TestHelmSolve<float> \
291 m_meshName = filename; \
295#define TESTFLOAT(type, filename)
297#if defined(NEKTAR_ENABLE_DOUBLE_PRECISION)
298#define TESTDOUBLE(type, filename) \
299 class type : public TestHelmSolve<double> \
304 m_meshName = filename; \
308#define TESTDOUBLE(type, filename)
310#define TEST(type, filename) \
311 TESTFLOAT(type, filename) \
312 TESTDOUBLE(type, filename)
315TEST(Helmholtz1D_Seg,
"run/Helmholtz1D_P8.xml")
316TEST(Helmholtz1D_Seg_3C, "run/Helmholtz1D_3C.xml")
318TEST(Helmholtz2D_Tri_Quad, "run/Helmholtz2D_varP.xml")
319TEST(Helmholtz2D_Tri_Quad_3C, "run/Helmholtz2D_3C.xml")
321TEST(Helmholtz2D_AllBCs, "run/Helmholtz2D_P7_AllBCs.xml")
323TEST(Helmholtz3D_Hex, "run/Helmholtz3D_Hex_Heterogeneous.xml")
324TEST(Helmholtz3D_Hex_3C, "run/Helmholtz3D_Hex_3C.xml")
326TEST(Helmholtz3D_Prism, "run/Helmholtz3D_Prism_VarP.xml")
328TEST(Helmholtz3D_Pyr, "run/Helmholtz3D_Pyr_VarP.xml")
330TEST(Helmholtz3D_Tet, "run/Helmholtz3D_Tet_VarP.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)
void RepeatSolve()
Solve again with the current output as the initial guess.
std::shared_ptr< LinearSolverOp< TData > > m_linsolve
unsigned int GetNiterations()
void SetGlobalSysSolnInfo(const std::string &property, const std::string &value)
Set a GLOBALSYSSOLNINFO property for the first variable only, which the linear solver applies to all ...
std::vector< TData > m_diffCoeff
std::shared_ptr< HelmSolveOp< TData > > m_op
Field< TData, FieldState::Coeff > m_out
Field< TData, FieldState::Phys > m_in
ExpListSharedPtr m_expList
SessionReaderSharedPtr m_session
Field< TData, FieldState::Coeff > m_expected
std::map< ConstFactorType, NekDouble > ConstFactorMap