52 {
53
54 const unsigned int numComp =
56 const size_t nphys = this->
m_expList->GetTotPoints();
58
64
65 if (this->
m_session->DefinesFunction(
"Forcing"))
66 {
67 for (unsigned int n = 0; n < numComp; ++n)
68 {
70 "Forcing", n % this->
m_session->GetVariables().size());
72 func->Evaluate(x, y, z, fceVar);
73 }
74 }
75
76 for (
unsigned int blk = 0; blk < this->
m_in.
GetBlocks().size(); ++blk)
77 {
79 auto inptr =
80 block.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
81 for (unsigned int n = 0; n < numComp; ++n)
82 {
86 auto fceptr = fce.data() + n * nphys;
87
88 for (
size_t el = 0, cnt = 0;
el < block.GetNumElements(); ++
el)
89 {
90 for (unsigned int phys = 0; phys < block.GetNumData();
91 ++phys, ++cnt)
92 {
93 if (this->
m_session->DefinesFunction(
"Forcing"))
94 {
95 inptr[cnt] = *(fceptr++);
96 }
97 else
98 {
99 inptr[cnt] = 1.0 + n;
101 {
102 for (
unsigned int p = 1;
p < 4; ++
p)
103 {
104 inptr[cnt] +=
105 (n + 1) * p * std::pow(*xptr, p);
106 }
107 xptr++;
108 }
110 {
111 for (
unsigned int p = 1;
p < 4; ++
p)
112 {
113 inptr[cnt] += (n + 1) * p *
114 std::pow(*xptr, p) *
115 std::pow(*yptr, p);
116 }
117 xptr++;
118 yptr++;
119 }
120 else
121 {
122 for (
unsigned int p = 1;
p < 4; ++
p)
123 {
124 inptr[cnt] +=
125 (n + 1) * p * std::pow(*xptr, p) *
126 std::pow(*yptr, p) * std::pow(*zptr, p);
127 }
128 xptr++;
129 yptr++;
130 zptr++;
131 }
132 }
133 }
134 }
135
136 inptr += block.CompSize();
137 }
138 }
139
140 this->
m_out.template Initialize<NektarSpaces::HostSpace>(0.0);
141
142
144 }
SpatialDomains::Geometry * el
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
std::vector< double > p(NPUPPER)