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