46 "Computes stream-function for 2D field.");
51 m_f->m_declareExpansionAsContField =
true;
62 int nfields =
m_f->m_variables.size();
64 m_f->m_variables.push_back(
"StreamFunc");
67 if (
m_f->m_exp[0]->GetNumElmts() == 0)
73 int expdim =
m_f->m_graph->GetMeshDimension();
74 int spacedim = expdim +
m_f->m_numHomogeneousDir;
75 ASSERTL0(spacedim == 2,
"Stream function can only be obtained in 2D.");
78 int npoints =
m_f->m_exp[0]->GetNpoints();
84 m_f->m_exp.resize(nfields + 1);
85 m_f->m_exp[nfields] =
m_f->AppendExpList(
m_f->m_numHomogeneousDir);
89 m_f->m_exp[0]->GetPhys(), uy);
91 m_f->m_exp[1]->GetPhys(), vx);
101 m_f->m_exp[1]->HelmSolve(vortNeg,
m_f->m_exp[nfields]->UpdateCoeffs(),
103 m_f->m_exp[1]->BwdTrans(
m_f->m_exp[nfields]->GetCoeffs(),
104 m_f->m_exp[nfields]->UpdatePhys());
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
Abstract base class for processing modules.
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
ProcessStreamFunction(FieldSharedPtr f)
~ProcessStreamFunction() override
static ModuleKey className
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()
MultiRegions::Direction const DirCartesianMap[]
std::map< ConstFactorType, NekDouble > ConstFactorMap
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.