50 ModuleKey ProcessC0Projection::className =
53 ProcessC0Projection::create,
"Computes C0 projection.");
68 cout <<
"ProcessC0Projection: Projecting field into C0 space..."
73 bool savedef =
m_f->m_declareExpansionAsContField;
74 m_f->m_declareExpansionAsContField =
true;
77 m_f->m_declareExpansionAsContField = savedef;
79 int nfields =
m_f->m_exp.size();
81 string fields =
m_config[
"fields"].as<
string>();
82 vector<unsigned int> processFields;
84 if(fields.compare(
"All") == 0)
86 for(
int i = 0; i < nfields; ++i)
88 processFields.push_back(i);
95 "Failed to interpret field string in C0Projection");
98 for (
int i = 0; i < processFields.size(); ++i)
100 ASSERTL0(processFields[i] < nfields,
101 "Attempt to process field that is larger than then number of "
106 cout <<
"\t Processing field: " << processFields[i] << endl;
109 m_f->m_exp[processFields[i]]->UpdatePhys());
111 m_f->m_exp[processFields[i]]->UpdateCoeffs());
115 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
116 =
m_f->m_exp[0]->GetFieldDefinitions();
118 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
120 for(
int i = 0; i < nfields; ++i)
122 for (
int j = 0; j < FieldDef.size(); ++j)
124 FieldDef[j]->m_fields.push_back(
m_f->m_fielddef[0]->m_fields[i]);
125 m_f->m_exp[i]->AppendFieldData(FieldDef[j], FieldData[j]);
129 m_f->m_fielddef = FieldDef;
130 m_f->m_data = FieldData;