47 "Add transformed coordinates to output file.");
64 if (
m_f->m_exp[0]->GetNumElmts() == 0)
73 int nfields =
m_f->m_variables.size();
75 int npoints =
m_f->m_exp[0]->GetNpoints();
76 string fieldNames[3] = {
"xCoord",
"yCoord",
"zCoord"};
77 for (
int i = 0; i < addfields; ++i)
79 m_f->m_variables.push_back(fieldNames[i]);
81 m_f->m_exp.resize(nfields + addfields);
82 vector<Array<OneD, NekDouble>> coords(
m_spacedim);
89 m_f->m_exp[0]->GetCoords(coords[0]);
93 m_f->m_exp[0]->GetCoords(coords[0], coords[1]);
97 m_f->m_exp[0]->GetCoords(coords[0], coords[1], coords[2]);
110 for (
int i = 0; i < addfields; ++i)
112 m_f->m_exp[nfields + i] =
m_f->AppendExpList(
m_f->m_numHomogeneousDir);
114 m_f->m_exp[nfields + i]->UpdatePhys(), 1);
115 m_f->m_exp[nfields + i]->FwdTransLocalElmt(
116 coords[i],
m_f->m_exp[nfields + i]->UpdateCoeffs());
120 vector<Array<OneD, NekDouble>> data(
m_spacedim);
122 if (
m_config[
"vectors"].as<string>().compare(
"NotSet"))
125 m_f->m_variables, vars);
128 "The number of vector variables is not divisible by the space "
130 for (
int i = 0; i < vars.size() /
m_spacedim; ++i)
140 m_f->m_exp[nv]->FwdTransLocalElmt(data[
d],
141 m_f->m_exp[nv]->UpdateCoeffs());
148 vector<string> strOrigin = {
"X",
"Y",
"Z"};
149 vector<string> strTheta = {
"Theta_x",
"Theta_y",
"Theta_z"};
150 vector<string> strPivot = {
"X0",
"Y0",
"Z0"};
153 for (
size_t i = 0; i < strOrigin.size(); ++i)
155 if (
m_f->m_fieldMetaDataMap.count(strOrigin[i]))
157 m_origin[i] = stod(
m_f->m_fieldMetaDataMap[strOrigin[i]]);
160 for (
size_t i = 0; i < strTheta.size(); ++i)
162 if (
m_f->m_fieldMetaDataMap.count(strTheta[i]))
168 m_theta[i] = stod(
m_f->m_fieldMetaDataMap[strTheta[i]]);
171 for (
size_t i = 0; i < strPivot.size(); ++i)
173 if (
m_f->m_fieldMetaDataMap.count(strPivot[i]))
175 m_pivot[i] = stod(
m_f->m_fieldMetaDataMap[strPivot[i]]);
189 "data size is small than the space dimension.");
192 int npoint = data[0].size();
196 for (
int i = 0; i < dim; ++i)
201 Vmath::Svtsvtp(npoint, cz, tmp[0], 1, -sz, tmp[1], 1, data[0], 1);
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
void TransformVector(std::vector< Array< OneD, NekDouble > > &data)
std::vector< NekDouble > m_theta
std::vector< NekDouble > m_origin
static ModuleKey className
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
ProcessMRF(FieldSharedPtr f)
void v_Process(po::variables_map &vm) override
Write mesh to output file.
std::vector< NekDouble > m_pivot
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static bool GenerateVariableVector(const std::string &str, const std::vector< std::string > &variables, std::vector< int > &out)
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
std::vector< double > d(NPUPPER *NPUPPER)
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
Svtsvtp (scalar times vector plus scalar times vector):
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Represents a command-line configuration option.