50 "dummy module used to create m_exp.");
67 if (
m_f->m_comm->TreatAsRankZero())
74 bool fldfilegiven = (
m_f->m_fielddef.size() != 0);
75 bool expFromFld = fldfilegiven && !vm.count(
"use-session-expansion");
79 m_f->m_numHomogeneousDir = 0;
82 m_f->m_numHomogeneousDir =
m_f->m_fielddef[0]->m_numHomogeneousDir;
85 m_f->m_graph->SetExpansionInfo(
m_f->m_fielddef);
89 if (
m_f->m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
92 m_f->m_session->GetSolverInfo(
"HOMOGENEOUS");
94 if ((HomoStr ==
"HOMOGENEOUS1D") ||
95 (HomoStr ==
"Homogeneous1D") || (HomoStr ==
"1D") ||
96 (HomoStr ==
"Homo1D"))
98 m_f->m_numHomogeneousDir = 1;
100 if ((HomoStr ==
"HOMOGENEOUS2D") ||
101 (HomoStr ==
"Homogeneous2D") || (HomoStr ==
"2D") ||
102 (HomoStr ==
"Homo2D"))
104 m_f->m_numHomogeneousDir = 2;
109 m_f->m_exp.resize(1);
112 auto domain =
m_f->m_graph->GetDomain();
113 for (
int d = 0;
d < domain.size(); ++
d)
115 for (
auto &compIter : domain[
d])
117 for (
auto &x : compIter.second->m_geomVec)
119 IDs.push_back(x->GetGlobalID());
134 if (vm.count(
"output-points"))
136 int nPointsNew = vm[
"output-points"].as<
int>();
137 m_f->m_graph->SetExpansionInfoToPointOrder(nPointsNew);
142 if (
m_f->m_comm->TreatAsRankZero())
148 ss << cpuTime <<
"s";
149 cout <<
"\t ProcessCreateExp setexpansion CPU Time: " << setw(8)
150 << left << ss.str() << endl;
155 if (
m_f->m_numHomogeneousDir == 1 && vm.count(
"output-points-hom-z"))
157 int expdim =
m_f->m_graph->GetMeshDimension();
158 m_f->m_fielddef[0]->m_numModes[expdim] =
159 vm[
"output-points-hom-z"].as<
int>();
162 m_f->SetUpFirstExpList(
m_f->m_numHomogeneousDir, expFromFld);
165 if (
m_f->m_comm->TreatAsRankZero())
172 ss1 << cpuTime <<
"s";
173 cout <<
"\t ProcessCreateExp set first exp CPU Time: "
174 << setw(8) << left << ss1.str() << endl;
188 int nfields, nstrips;
189 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
190 vector<string> vars =
m_f->m_session->GetVariables();
192 if (useSessionVariables)
194 m_f->m_variables = vars;
196 nfields =
m_f->m_variables.size();
198 m_f->m_exp.resize(nfields * nstrips);
200 for (
int s = 0; s < nstrips; ++s)
202 for (i = 0; i < nfields; ++i)
207 if (!
m_f->m_exp[s * nfields + i])
209 m_f->m_exp[s * nfields + i] =
210 m_f->AppendExpList(
m_f->m_numHomogeneousDir, vars[i]);
217 m_f->m_exp[s * nfields + i] =
218 m_f->AppendExpList(
m_f->m_numHomogeneousDir, vars[0]);
222 m_f->m_exp[s * nfields + i] =
223 m_f->AppendExpList(
m_f->m_numHomogeneousDir);
230 for (
int s = 0; s < nstrips; ++s)
232 for (j = 0; j < nfields; ++j)
234 for (i = 0; i <
m_f->m_data.size() / nstrips; ++i)
236 int n = i * nstrips + s;
239 auto it =
find(
m_f->m_fielddef[n]->m_fields.begin(),
240 m_f->m_fielddef[n]->m_fields.end(),
241 m_f->m_variables[j]);
242 if (it !=
m_f->m_fielddef[n]->m_fields.end())
244 m_f->m_exp[s * nfields + j]->ExtractDataToCoeffs(
245 m_f->m_fielddef[n],
m_f->m_data[n],
m_f->m_variables[j],
246 m_f->m_exp[s * nfields + j]->UpdateCoeffs());
249 m_f->m_exp[s * nfields + j]->BwdTrans(
250 m_f->m_exp[s * nfields + j]->GetCoeffs(),
251 m_f->m_exp[s * nfields + j]->UpdatePhys());
256 m_f->m_fielddef = vector<LibUtilities::FieldDefinitionsSharedPtr>();
257 m_f->m_data = vector<std::vector<NekDouble>>();
FieldSharedPtr m_f
Field object.
~ProcessCreateExp() override
void v_Process(po::variables_map &vm) override
Write mesh to output file.
ProcessCreateExp(FieldSharedPtr f)
static ModuleKey className
void LoadFieldData(bool useSessionVariables=false)
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.
NekDouble TimePerTest(unsigned int n)
Returns amount of seconds per iteration in a test with n iterations.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
std::vector< double > d(NPUPPER *NPUPPER)