39 #include <boost/core/ignore_unused.hpp> 53 ProcessQCriterion::create,
54 "Computes Q-Criterion.");
66 boost::ignore_unused(vm);
68 int nfields =
m_f->m_variables.size();
69 m_f->m_variables.push_back(
"Q");
71 if (
m_f->m_exp[0]->GetNumElmts() == 0)
77 int expdim =
m_f->m_graph->GetMeshDimension();
78 int spacedim = expdim + (
m_f->m_numHomogeneousDir);
81 "ProcessQCriterion must be computed for a 3D (or quasi-3D) case.");
83 int npoints =
m_f->m_exp[0]->GetNpoints();
98 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
100 for (i = 0; i < spacedim * spacedim; ++i)
107 for (s = 0; s < nstrips; ++s)
109 for (i = 0; i < spacedim; ++i)
111 m_f->m_exp[s * nfields + i]->PhysDeriv(
112 m_f->m_exp[s * nfields + i]->GetPhys(), grad[i * spacedim],
113 grad[i * spacedim + 1], grad[i * spacedim + 2]);
118 grad[1 * spacedim + 2], 1,
121 Vmath::Vmul(npoints, outfield1, 1, outfield1, 1, outfield1, 1);
125 grad[2 * spacedim + 0], 1,
128 Vmath::Vmul(npoints, outfield2, 1, outfield2, 1, outfield2, 1);
132 grad[0 * spacedim + 1], 1,
135 Vmath::Vmul(npoints, outfield3, 1, outfield3, 1, outfield3, 1);
139 Vmath::Vadd(npoints, outfield1, 1, outfield2, 1, omega, 1);
140 Vmath::Vadd(npoints, omega, 1, outfield3, 1, omega, 1);
145 grad[0 * spacedim + 0], 1,
149 grad[1 * spacedim + 1], 1,
153 grad[2 * spacedim + 2], 1,
157 Vmath::Vadd(npoints, outfield1, 1, outfield2, 1, S, 1);
162 grad[1 * spacedim + 2], 1,
164 Vmath::Vmul(npoints, outfield1, 1, outfield1, 1, outfield1, 1);
168 grad[2 * spacedim + 0], 1,
170 Vmath::Vmul(npoints, outfield2, 1, outfield2, 1, outfield2, 1);
174 grad[0 * spacedim + 1], 1,
176 Vmath::Vmul(npoints, outfield3, 1, outfield3, 1, outfield3, 1);
178 Vmath::Vadd(npoints, outfield1, 1, outfield2, 1, outfield2, 1);
179 Vmath::Vadd(npoints, outfield2, 1, outfield3, 1, outfield3, 1);
181 Vmath::Smul(npoints, fac, outfield3, 1, outfield3, 1);
186 Vmath::Smul(npoints, fac, outfield, 1, outfield, 1);
188 Exp =
m_f->AppendExpList(
m_f->m_numHomogeneousDir);
189 Vmath::Vcopy(npoints, outfield, 1, Exp->UpdatePhys(), 1);
190 Exp->FwdTrans_IterPerExp(outfield, Exp->UpdateCoeffs());
192 auto it =
m_f->m_exp.begin() + s * (nfields + 1) + nfields;
193 m_f->m_exp.insert(it, Exp);
#define ASSERTL0(condition, msg)
virtual ~ProcessQCriterion()
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< Field > FieldSharedPtr
virtual void Process(po::variables_map &vm)
Write mesh to output file.
std::pair< ModuleType, std::string > ModuleKey
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Abstract base class for processing modules.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.