63 int nfields =
m_f->m_variables.size();
64 m_f->m_variables.push_back(
"Q");
66 if (
m_f->m_exp[0]->GetNumElmts() == 0)
72 int expdim =
m_f->m_graph->GetMeshDimension();
73 int spacedim = expdim + (
m_f->m_numHomogeneousDir);
76 spacedim == 3 || spacedim == 2,
77 "ProcessQCriterion must be computed for a 2D, quasi-3D, or 3D case.");
79 int npoints =
m_f->m_exp[0]->GetNpoints();
91 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
93 for (i = 0; i < spacedim * spacedim; ++i)
100 for (s = 0; s < nstrips; ++s)
102 Exp =
m_f->AppendExpList(
m_f->m_numHomogeneousDir);
103 auto it =
m_f->m_exp.begin() + s * (nfields + 1) + nfields;
104 m_f->m_exp.insert(it, Exp);
110 for (s = 0; s < nstrips; ++s)
112 for (i = 0; i < spacedim; ++i)
114 m_f->m_exp[s * nfields + i]->PhysDeriv(
115 m_f->m_exp[s * nfields + i]->GetPhys(), grad[i * spacedim],
116 grad[i * spacedim + 1]);
121 grad[0 * spacedim + 1], 1, outfield, 1);
123 Vmath::Vmul(npoints, outfield, 1, outfield, 1, omega, 1);
127 grad[0 * spacedim + 0], 1, S, 1);
130 grad[1 * spacedim + 1], 1, S, 1, S, 1);
134 grad[0 * spacedim + 1], 1, outfield, 1);
135 Vmath::Vmul(npoints, outfield, 1, outfield, 1, outfield, 1);
138 Vmath::Svtvm(npoints, fac, omega, 1, S, 1, outfield, 1);
139 Vmath::Smul(npoints, fac, outfield, 1, outfield, 1);
141 int fid = s * (nfields + 1) + nfields;
144 Exp->FwdTransLocalElmt(outfield,
m_f->m_exp[fid]->UpdateCoeffs());
147 else if (spacedim == 3)
152 for (s = 0; s < nstrips; ++s)
154 for (i = 0; i < spacedim; ++i)
156 m_f->m_exp[s * nfields + i]->PhysDeriv(
157 m_f->m_exp[s * nfields + i]->GetPhys(), grad[i * spacedim],
158 grad[i * spacedim + 1], grad[i * spacedim + 2]);
163 grad[1 * spacedim + 2], 1, outfield1, 1);
165 Vmath::Vmul(npoints, outfield1, 1, outfield1, 1, outfield1, 1);
169 grad[2 * spacedim + 0], 1, outfield2, 1);
171 Vmath::Vmul(npoints, outfield2, 1, outfield2, 1, outfield2, 1);
175 grad[0 * spacedim + 1], 1, outfield3, 1);
177 Vmath::Vmul(npoints, outfield3, 1, outfield3, 1, outfield3, 1);
180 Vmath::Vadd(npoints, outfield1, 1, outfield2, 1, omega, 1);
181 Vmath::Vadd(npoints, omega, 1, outfield3, 1, omega, 1);
186 grad[0 * spacedim + 0], 1, outfield1, 1);
189 grad[1 * spacedim + 1], 1, outfield2, 1);
192 grad[2 * spacedim + 2], 1, outfield3, 1);
195 Vmath::Vadd(npoints, outfield1, 1, outfield2, 1, S, 1);
200 grad[1 * spacedim + 2], 1, outfield1, 1);
201 Vmath::Vmul(npoints, outfield1, 1, outfield1, 1, outfield1, 1);
205 grad[2 * spacedim + 0], 1, outfield2, 1);
206 Vmath::Vmul(npoints, outfield2, 1, outfield2, 1, outfield2, 1);
210 grad[0 * spacedim + 1], 1, outfield3, 1);
211 Vmath::Vmul(npoints, outfield3, 1, outfield3, 1, outfield3, 1);
213 Vmath::Vadd(npoints, outfield1, 1, outfield2, 1, outfield2, 1);
214 Vmath::Vadd(npoints, outfield2, 1, outfield3, 1, outfield3, 1);
216 Vmath::Smul(npoints, fac, outfield3, 1, outfield3, 1);
221 Vmath::Smul(npoints, fac, outfield, 1, outfield, 1);
223 int fid = s * (nfields + 1) + nfields;
226 Exp->FwdTransLocalElmt(outfield,
m_f->m_exp[fid]->UpdateCoeffs());