50 "Stretches homogeneous direction of a 3DH1D expansion, requires factor "
52 "defined. The number of modes in the final expansion can be defined "
54 " --output-points-hom-z.");
72 if (
m_f->m_exp[0]->GetNumElmts() == 0)
78 "ProcessHomogeneousStretch only works for Homogeneous1D.");
81 "Missing parameter factor for ProcessHomogeneousStretch");
83 int factor =
m_config[
"factor"].as<
int>();
84 int nfields =
m_f->m_variables.size();
85 int nplanes =
m_f->m_exp[0]->GetHomogeneousBasis()->GetZ().size();
87 ASSERTL0(factor > 1,
"Parameter factor must be an int greater than 1.");
90 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
92 for (
int s = 0; s < nstrips; ++s)
94 for (
int i = 0; i < nfields; ++i)
96 int n = s * nfields + i;
97 int ncoeffs =
m_f->m_exp[n]->GetPlane(0)->GetNcoeffs();
100 for (
int p = nplanes - 1;
p > 1; --
p)
102 int newP = 2 * factor * (
p / 2) +
p % 2;
106 ncoeffs,
m_f->m_exp[n]->GetPlane(
p)->GetCoeffs(), 1,
107 m_f->m_exp[n]->GetPlane(newP)->UpdateCoeffs(), 1);
113 m_f->m_exp[n]->BwdTrans(
m_f->m_exp[n]->GetCoeffs(),
114 m_f->m_exp[n]->UpdatePhys());
115 m_f->m_exp[n]->SetHomoLen(factor *
m_f->m_exp[n]->GetHomoLen());
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
ProcessHomogeneousStretch(FieldSharedPtr f)
~ProcessHomogeneousStretch() 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.
Abstract base class for processing modules.
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()
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Represents a command-line configuration option.