57 false,
"0",
"Method to obtain Q: 0 user provided; 1 from pressure;");
59 "Bounding box of the integration domain "
60 "box=xmin,xmax,ymin,ymax,zmin,zmax");
72 int nfields =
m_f->m_variables.size();
76 "ProcessForceDecomposeVol must be computed for a 2D, quasi-3D, or "
80 if (
m_f->m_exp[0]->GetNumElmts() == 0)
86 if (
m_config[
"box"].as<string>().compare(
"NotSet") != 0)
88 vector<NekDouble> values;
93 "box string should contain 6 values xmin,xmax,ymin,ymax,zmin,zmax");
95 for (
size_t i = 0; i < values.size(); ++i)
97 BoundBox[i] = values[i];
111 if (
m_config[
"scandir"].as<string>().compare(
"NotSet") != 0)
113 scanDir =
m_config[
"scandir"].as<
int>();
116 std::map<int, std::string> Iphi;
117 for (
size_t i = 0; i <
m_f->m_variables.size(); ++i)
119 if (std::string::npos !=
m_f->m_variables[i].find(
"phi"))
121 Iphi[i] =
m_f->m_variables[i];
124 int addfields = Iphi.size();
126 int npoints =
m_f->m_exp[0]->GetNpoints();
129 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
131 vector<MultiRegions::ExpListSharedPtr> Exp(nstrips * addfields);
133 for (
int s = 0; s < nstrips; ++s)
136 for (
int i = 0; i < nfields; ++i)
138 exp[i] =
m_f->m_exp[s * nfields + i];
144 for (
const auto &phi : Iphi)
148 m_f->m_exp[s * nfields + phi.first]->GetPhys(), 1,
152 Exp[s * addfields + i] =
153 m_f->AppendExpList(
m_f->m_numHomogeneousDir);
155 Exp[s * addfields + i]->UpdatePhys(), 1);
156 Exp[s * addfields + i]->FwdTransLocalElmt(
157 Qphi[i], Exp[s * addfields + i]->UpdateCoeffs());
160 m_f->m_exp.begin() + s * (nfields + addfields) + nfields + i;
161 m_f->m_exp.insert(it, Exp[s * addfields + i]);
169 for (
const auto &phi : Iphi)
171 m_f->m_variables.push_back(
"Q" + phi.second);
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
This processing module calculates the Q Criterion and adds it as an extra-field to the output file.
void GetQ(const Array< OneD, MultiRegions::ExpListSharedPtr > exp, Array< OneD, NekDouble > &Q)
void VolumeIntegrateForce(const MultiRegions::ExpListSharedPtr &field, const Array< OneD, Array< OneD, NekDouble > > &data, const LibUtilities::CommSharedPtr &comm, std::map< int, std::string > &Iphi, Array< OneD, NekDouble > &BoundBox, int dir)
~ProcessForceDecomposeVol() override
void v_Process(po::variables_map &vm) override
Write mesh to output file.
static ModuleKey className
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
ProcessForceDecomposeVol(FieldSharedPtr f)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
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.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Represents a command-line configuration option.