51 "Computes vorticity field.");
66 int expdim =
m_f->m_graph->GetMeshDimension();
68 if ((
m_f->m_numHomogeneousDir) == 1 || (
m_f->m_numHomogeneousDir) == 2)
72 int nfields =
m_f->m_variables.size();
74 "Error: Vorticity for a 1D problem cannot be computed");
80 m_f->m_variables.push_back(
"W_z");
84 m_f->m_variables.push_back(
"W_x");
85 m_f->m_variables.push_back(
"W_y");
86 m_f->m_variables.push_back(
"W_z");
90 if (
m_f->m_exp[0]->GetNumElmts() == 0)
94 int npoints =
m_f->m_exp[0]->GetNpoints();
100 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
107 for (i = 0; i < addfields; ++i)
119 for (s = 0; s < nstrips; ++s)
121 for (i = 0; i < addfields; ++i)
124 m_f->AppendExpList(
m_f->m_numHomogeneousDir);
125 m_f->m_exp.insert(
m_f->m_exp.begin() + s * (nfields + addfields) +
134 for (s = 0; s < nstrips; ++s)
140 if (
m_f->m_fieldMetaDataMap.count(
"MappingCartesianVel"))
142 if (
m_f->m_fieldMetaDataMap[
"MappingCartesianVel"] ==
"False")
145 if (
m_f->m_exp[0]->GetWaveSpace())
149 m_f->m_exp[0]->HomogeneousBwdTrans(npoints, vel[i],
154 mapping->ContravarToCartesian(vel, vel);
156 if (
m_f->m_exp[0]->GetWaveSpace())
160 m_f->m_exp[0]->HomogeneousFwdTrans(npoints, vel[i],
172 m_f->m_exp[s * nfields + i]->PhysDeriv(vel[i], tmp[0], tmp[1]);
173 mapping->CovarToCartesian(tmp, tmp);
188 m_f->m_exp[s * nfields + i]->PhysDeriv(vel[i], tmp[0], tmp[1],
190 mapping->CovarToCartesian(tmp, tmp);
209 for (i = 0; i < addfields; ++i)
211 int fid = s * (nfields + addfields) + nfields + i;
214 m_f->m_exp[fid]->FwdTransLocalElmt(outfield[i],
215 m_f->m_exp[fid]->UpdateCoeffs());
221 int totfields,
int strip)
223 int npoints =
m_f->m_exp[0]->GetNpoints();
224 if (boost::iequals(
m_f->m_variables[0],
"u"))
234 else if (boost::iequals(
m_f->m_variables[0],
"rho") &&
235 boost::iequals(
m_f->m_variables[1],
"rhou"))
242 npoints,
m_f->m_exp[strip * totfields + i + 1]->GetPhys(), 1,
243 m_f->m_exp[strip * totfields + 0]->GetPhys(), 1, vel[i], 1);
249 ASSERTL0(
false,
"Could not identify velocity for ProcessVorticity");
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
static GlobalMapping::MappingSharedPtr GetMapping(FieldSharedPtr f)
Abstract base class for processing modules.
~ProcessVorticity() override
ProcessVorticity(FieldSharedPtr f)
void GetVelocity(Array< OneD, Array< OneD, NekDouble > > &vel, int totfields, int strip=0)
static ModuleKey className
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
void v_Process(po::variables_map &vm) override
Write mesh to output file.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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.