85 "ProcessInterpPointDataToFld requires frompts parameter");
86 string inFile =
m_config[
"frompts"].as<
string>().c_str();
88 int totpoints =
m_f->m_exp[0]->GetTotPoints();
91 for (
int i = 0; i < 3; ++i)
95 m_f->m_exp[0]->GetCoords(intFields[0], intFields[1], intFields[2]);
97 if (fs::path(inFile).extension() ==
".pts")
102 ptsIO->Import(inFile, fieldPts);
104 else if (fs::path(inFile).extension() ==
".csv")
113 vmax = intFields[0][
Vmath::Imax(totpoints, intFields[0], 1)];
114 vmin = intFields[0][
Vmath::Imin(totpoints, intFields[0], 1)];
115 Range->m_xmax = (vmax - vmin) * margin + vmax;
116 Range->m_xmin = -(vmax - vmin) * margin + vmin;
118 vmax = intFields[1][
Vmath::Imax(totpoints, intFields[1], 1)];
119 vmin = intFields[1][
Vmath::Imin(totpoints, intFields[1], 1)];
120 Range->m_ymax = (vmax - vmin) * margin + vmax;
121 Range->m_ymin = -(vmax - vmin) * margin + vmin;
123 vmax = intFields[2][
Vmath::Imax(totpoints, intFields[2], 1)];
124 vmin = intFields[2][
Vmath::Imin(totpoints, intFields[2], 1)];
125 Range->m_zmax = (vmax - vmin) * margin + vmax;
126 Range->m_zmin = -(vmax - vmin) * margin + vmin;
133 ASSERTL0(
false,
"unknown frompts file type");
136 int nFields = fieldPts->GetNFields();
137 ASSERTL0(nFields > 0,
"No field values provided in input");
141 m_f->m_numHomogeneousDir == 0,
142 "ProcessInterpPointDataToFld does not support homogeneous expansion");
144 m_f->m_exp.resize(nFields);
145 for (i = 1; i < nFields; ++i)
147 m_f->m_exp[i] =
m_f->AppendExpList(
m_f->m_numHomogeneousDir);
152 for (
int i = 0; i < 3; ++i)
154 intFields1[i] = intFields[i];
158 for (
int i = 3; i < 3 + nFields; ++i)
166 int coord_id =
m_config[
"interpcoord"].as<
int>();
167 ASSERTL0(coord_id <=
static_cast<int>(outPts->GetDim()) - 1,
168 "interpcoord is bigger than the Pts files dimension");
173 if (
m_f->m_verbose &&
m_f->m_comm->TreatAsRankZero())
179 if (
m_f->m_verbose &&
m_f->m_comm->TreatAsRankZero())
184 for (i = 0; i < totpoints; ++i)
186 for (j = 0; j < nFields; ++j)
188 m_f->m_exp[j]->SetPhys(i, outPts->GetPointVal(3 + j, i));
192 for (i = 0; i < nFields; ++i)
194 m_f->m_exp[i]->FwdTransLocalElmt(
m_f->m_exp[i]->GetPhys(),
195 m_f->m_exp[i]->UpdateCoeffs());
199 for (
int j = 0; j < fieldPts->GetNFields(); ++j)
201 m_f->m_variables.push_back(fieldPts->GetFieldName(j));
FIELD_UTILS_EXPORT void Interpolate(const T expInField, T &expOutField, NekDouble def_value=0., NekDouble tolerance=NekConstants::kFindDistanceMin)
Interpolate from an expansion to an expansion.