template<typename TData>
class TestExpression< TData >
Definition at line 45 of file TestExpression.hpp.
template<typename TData >
Definition at line 112 of file TestExpression.hpp.
113 {
114
115 const unsigned int nVariables = this->
session->GetVariables().size();
116 const size_t nphys = this->
fixt_explist->GetTotPoints();
117
118
120
121
126
127
129
130
131 std::vector<Array<OneD, const TData>> fielddata;
132 fielddata.push_back(x);
133 fielddata.push_back(y);
134 fielddata.push_back(z);
136 for (unsigned int i = 0; i < nVariables; ++i)
137 {
138 fielddata.push_back(inphys + i * nphys);
139 }
140
141
142 if (this->
session->DefinesFunction(
"Forcing"))
143 {
144
145 for (unsigned int i = 0; i < nVariables; ++i)
146 {
147
149
150
151 auto func = this->
session->GetFunction(
"Forcing", i);
152 func->Evaluate(fielddata, fce_var);
153
154
156 }
157 this->
fixt_expected->template CopyArray<NektarSpaces::HostSpace>(
158 fce);
159 }
160 }
Nektar::Array< Nektar::OneD, TDataOut > ToArray()
Copy the data to a Nektar::Array, component by component and element by element, without padding,...
std::shared_ptr< MultiRegions::ExpList > fixt_explist
Field< TData, stateIn > * fixt_in
Field< TData, stateOut > * fixt_expected
LibUtilities::SessionReaderSharedPtr session
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
References TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_expected, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_in, TestExpression< TData >::m_scale, TestExpression< TData >::m_time, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::session, Vmath::Smul(), and Nektar::LibUtilities::Field< TData, TState >::ToArray().
Referenced by TestExpression< TData >::SetTestCase().
template<typename TData >
Definition at line 87 of file TestExpression.hpp.
88 {
90
91
92 if (execStr == "AVX")
93 {
95 NektarSpaces::GetVectorWidth<TData>(execStr), execStr);
96 }
97
102 std::vector<LibUtilities::EquationSharedPtr> expressions;
103 const auto numfields = this->
session->GetVariables().size();
104 for (int nf = 0; nf < numfields; ++nf)
105 {
106 expressions.push_back(this->
session->GetFunction(
"Forcing", nf));
107 }
108 op->SetExpressions(expressions);
110 }
void ReshapeStorage(const unsigned int &interleaveWidth, const std::string &execSpace)
static std::shared_ptr< ExpressionOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create an Expression operator through the two-stage element-operator factory and initialise its defau...
static std::string GetOpExecSpace(std::shared_ptr< LibUtilities::SessionReader > session, const bool warn=true)
Return the execution space name ("opExecSpace") for an operator.
Field< TData, stateOut > * fixt_out
References Nektar::MultiRegions::ExpressionOp< TData >::Create(), TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_in, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_out, Nektar::MultiRegions::Operator< TData >::GetOpExecSpace(), TestExpression< TData >::m_scale, TestExpression< TData >::m_time, Nektar::LibUtilities::Field< TData, TState >::ReshapeStorage(), and TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::session.
template<typename TData >
Definition at line 51 of file TestExpression.hpp.
52 {
53
55 ++blk)
56 {
58 auto inptr =
59 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
62 ++n)
63 {
64 for (
size_t el = 0, cnt = 0;
el < block.GetNumElements(); ++
el)
65 {
66 for (unsigned int phys = 0; phys < block.GetNumData();
67 ++phys, ++cnt)
68 {
69 inptr[cnt] = 1.0 + n;
70 }
71 }
72 inptr += block.CompSize();
73 }
74 }
75
76 this->
fixt_out->template Initialize<NektarSpaces::HostSpace>(0.0);
77 this->
fixt_expected->template Initialize<NektarSpaces::HostSpace>(0.0);
78
79
82
83
85 }
SpatialDomains::Geometry * el
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.
References el, TestExpression< TData >::ExpectedSolution(), TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_expected, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_in, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::ContField >::fixt_out, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes(), TestExpression< TData >::m_scale, and TestExpression< TData >::m_time.