53 ProcessScaleInFld::create,
"rescale input field by a constant factor.");
57 if((f->m_inputfiles.count(
"fld") == 0) &&
58 (f->m_inputfiles.count(
"rst") == 0) &&
59 (f->m_inputfiles.count(
"chk") == 0))
61 cout <<
"A fld, chk or rst input file must be specified for the "
62 "scaleinputfld module" << endl;
68 "scaleinputfld: Need to specify a sacle factor");
78 ASSERTL0(
m_f->m_data.size() != 0,
"No input data defined");
80 string scalestr =
m_config[
"scale"].as<
string>();
85 cout <<
"ProcessScaleInFld: Rescaling input fld by factor " << scale << endl;
88 for(
int i = 0; i <
m_f->m_data.size(); ++i)
90 int datalen =
m_f->m_data[i].size();
93 &(
m_f->m_data[i][0]), 1);
98 int nfields =
m_f->m_fielddef[0]->m_fields.size();
101 for (
int j = 0; j < nfields; ++j)
103 for (
int i = 0; i <
m_f->m_data.size(); ++i)
105 m_f->m_exp[j]->ExtractDataToCoeffs(
108 m_f->m_fielddef[i]->m_fields[j],
109 m_f->m_exp[j]->UpdateCoeffs());
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
map< string, ConfigOption > m_config
List of configuration values.
FieldSharedPtr m_f
Field object.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
virtual ~ProcessScaleInFld()
boost::shared_ptr< Field > FieldSharedPtr
Represents a command-line configuration option.
ModuleFactory & GetModuleFactory()
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.