Nektar++
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::SolverUtils::SessionFunction Class Reference

#include <SessionFunction.h>

Public Member Functions

SOLVER_UTILS_EXPORT SessionFunction (const LibUtilities::SessionReaderSharedPtr &session, const MultiRegions::ExpListSharedPtr &field, std::string functionName, bool toCache=false)
 Representation of a FUNCTION defined in the session xml file. More...
 
SOLVER_UTILS_EXPORT void Evaluate (Array< OneD, Array< OneD, NekDouble > > &pArray, const NekDouble pTime=0.0, const int domain=0)
 Evaluates a function defined in the xml session file at each quadrature point. More...
 
SOLVER_UTILS_EXPORT void Evaluate (std::vector< std::string > pFieldNames, Array< OneD, Array< OneD, NekDouble > > &pArray, const NekDouble &pTime=0.0, const int domain=0)
 Evaluates a function defined in the xml session file at each quadrature point. More...
 
SOLVER_UTILS_EXPORT void Evaluate (std::vector< std::string > pFieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &pTime=0.0, const int domain=0)
 Evaluates a function defined in the xml session file at each quadrature point. More...
 
SOLVER_UTILS_EXPORT void Evaluate (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
 
SOLVER_UTILS_EXPORT std::string Describe (std::string pFieldName, const int domain=0)
 Provide a description of a function for a given field name. More...
 
SOLVER_UTILS_EXPORT const LibUtilities::SessionReaderSharedPtrGetSession ()
 
SOLVER_UTILS_EXPORT const MultiRegions::ExpListSharedPtrGetExpansion ()
 

Private Member Functions

SOLVER_UTILS_EXPORT void EvaluateExp (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
 
SOLVER_UTILS_EXPORT void EvaluateFld (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
 
SOLVER_UTILS_EXPORT void EvaluatePts (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
 Evaluates a function from pts file. More...
 
SOLVER_UTILS_EXPORT void PrintProgressbar (const int position, const int goal) const
 

Private Attributes

LibUtilities::SessionReaderSharedPtr m_session
 The session reader. More...
 
MultiRegions::ExpListSharedPtr m_field
 The expansion we want to evaluate this function for. More...
 
std::string m_name
 
bool m_toCache
 Store resulting arrays (and interpolators) More...
 
std::map< std::pair< std::string, int >, NekDoublem_lastCached
 Last time the cache for this variable & domain combo was updated. More...
 
std::map< std::string, FieldUtils::Interpolator< std::vector< MultiRegions::ExpListSharedPtr > > > m_interpolators
 Interpolator for pts file input for a variable & domain combination. More...
 
std::map< std::pair< std::string, int >, Array< OneD, NekDouble > > m_arrays
 Cached result arrays. More...
 

Detailed Description

Definition at line 59 of file SessionFunction.h.

Constructor & Destructor Documentation

◆ SessionFunction()

Nektar::SolverUtils::SessionFunction::SessionFunction ( const LibUtilities::SessionReaderSharedPtr session,
const MultiRegions::ExpListSharedPtr field,
std::string  functionName,
bool  toCache = false 
)

Representation of a FUNCTION defined in the session xml file.

Representation of a FUNCTION defined in the session xml file.

Parameters
sessionThe session where the function was defined.
fieldThe field the function is defined on.
functionNameThe name of the function.
toCacheStore the evaluated function for later use.

Definition at line 55 of file Core/SessionFunction.cpp.

59 : m_session(session), m_field(field), m_name(functionName),
60 m_toCache(toCache)
61{
62 ASSERTL0(m_session->DefinesFunction(m_name),
63 "Function '" + m_name + "' does not exist.");
64}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
MultiRegions::ExpListSharedPtr m_field
The expansion we want to evaluate this function for.
bool m_toCache
Store resulting arrays (and interpolators)
LibUtilities::SessionReaderSharedPtr m_session
The session reader.

References ASSERTL0, m_name, and m_session.

Member Function Documentation

◆ Describe()

std::string Nektar::SolverUtils::SessionFunction::Describe ( std::string  pFieldName,
const int  domain = 0 
)

Provide a description of a function for a given field name.

Parameters
pFieldNameField name.
domainThe domain to evaluate the function in.

Definition at line 214 of file Core/SessionFunction.cpp.

215{
216 std::string retVal;
217
219 m_session->GetFunctionType(m_name, pFieldName, domain);
221 {
223 m_session->GetFunction(m_name, pFieldName, domain);
224 retVal = ffunc->GetExpression();
225 }
226 else if (vType == LibUtilities::eFunctionTypeFile ||
228 {
229 std::string filename =
230 m_session->GetFunctionFilename(m_name, pFieldName, domain);
231 retVal = "from file " + filename;
232 }
233 else
234 {
235 ASSERTL0(false, "unknown eFunctionType");
236 }
237
238 return retVal;
239}
std::shared_ptr< Equation > EquationSharedPtr
Definition: Equation.h:125

References ASSERTL0, Nektar::LibUtilities::eFunctionTypeExpression, Nektar::LibUtilities::eFunctionTypeFile, Nektar::LibUtilities::eFunctionTypeTransientFile, m_name, and m_session.

◆ Evaluate() [1/4]

void Nektar::SolverUtils::SessionFunction::Evaluate ( Array< OneD, Array< OneD, NekDouble > > &  pArray,
const NekDouble  pTime = 0.0,
const int  domain = 0 
)

Evaluates a function defined in the xml session file at each quadrature point.

Evaluates a function defined in the xml session file at each quadrature point.

Parameters
pArrayThe array into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 74 of file Core/SessionFunction.cpp.

76{
77 std::vector<std::string> vFieldNames = m_session->GetVariables();
78
79 for (int i = 0; i < vFieldNames.size(); i++)
80 {
81 Evaluate(vFieldNames[i], pArray[i], pTime, domain);
82 }
83}
SOLVER_UTILS_EXPORT void Evaluate(Array< OneD, Array< OneD, NekDouble > > &pArray, const NekDouble pTime=0.0, const int domain=0)
Evaluates a function defined in the xml session file at each quadrature point.

References Evaluate(), and m_session.

Referenced by Evaluate().

◆ Evaluate() [2/4]

void Nektar::SolverUtils::SessionFunction::Evaluate ( std::string  pFieldName,
Array< OneD, NekDouble > &  pArray,
const NekDouble pTime = 0.0,
const int  domain = 0 
)

Evaluates a function defined in the xml session file at each quadrature point.

Parameters
pFieldNameThe name of the field to evaluate the function for.
pArrayThe array into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 148 of file Core/SessionFunction.cpp.

151{
153 m_session->GetFunctionType(m_name, pFieldName, domain);
154
155 unsigned int nq = m_field->GetNpoints();
156
157 std::pair<std::string, int> key(pFieldName, domain);
158 // sorry
159 if ((m_arrays.find(key) != m_arrays.end()) &&
161 ((m_lastCached.find(key) != m_lastCached.end()) &&
162 (pTime - m_lastCached[key] < NekConstants::kNekZeroTol))))
163 {
164 // found cached field
165 if (pArray.size() < nq)
166 {
167 pArray = Array<OneD, NekDouble>(nq);
168 }
169 Vmath::Vcopy(nq, m_arrays[key], 1, pArray, 1);
170
171 return;
172 }
173
175 {
176 EvaluateExp(pFieldName, pArray, pTime, domain);
177 }
178 else if (vType == LibUtilities::eFunctionTypeFile ||
180 {
181 std::string filename =
182 m_session->GetFunctionFilename(m_name, pFieldName, domain);
183
184 if (fs::path(filename).extension() == ".pts" ||
185 fs::path(filename).extension() == ".csv")
186 {
187 EvaluatePts(pFieldName, pArray, pTime, domain);
188 }
189 else
190 {
191 EvaluateFld(pFieldName, pArray, pTime, domain);
192 }
193 }
194 else
195 {
196 ASSERTL0(false, "unknown eFunctionType");
197 }
198
199 if (m_toCache)
200 {
201 m_arrays[key] = Array<OneD, NekDouble>(nq);
202 Vmath::Vcopy(nq, pArray, 1, m_arrays[key], 1);
203
204 m_lastCached[key] = pTime;
205 }
206}
std::map< std::pair< std::string, int >, Array< OneD, NekDouble > > m_arrays
Cached result arrays.
SOLVER_UTILS_EXPORT void EvaluateFld(std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
SOLVER_UTILS_EXPORT void EvaluatePts(std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
Evaluates a function from pts file.
std::map< std::pair< std::string, int >, NekDouble > m_lastCached
Last time the cache for this variable & domain combo was updated.
SOLVER_UTILS_EXPORT void EvaluateExp(std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0)
static const NekDouble kNekZeroTol
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References ASSERTL0, Nektar::LibUtilities::eFunctionTypeExpression, Nektar::LibUtilities::eFunctionTypeFile, Nektar::LibUtilities::eFunctionTypeTransientFile, EvaluateExp(), EvaluateFld(), EvaluatePts(), Nektar::NekConstants::kNekZeroTol, m_arrays, m_field, m_lastCached, m_name, m_session, m_toCache, and Vmath::Vcopy().

◆ Evaluate() [3/4]

void Nektar::SolverUtils::SessionFunction::Evaluate ( std::vector< std::string >  pFieldNames,
Array< OneD, Array< OneD, NekDouble > > &  pArray,
const NekDouble pTime = 0.0,
const int  domain = 0 
)

Evaluates a function defined in the xml session file at each quadrature point.

Evaluates a function defined in the xml session file at each quadrature point.

Parameters
pFieldNamesThe names of the fields to evaluate the function for.
pArrayThe array into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 94 of file Core/SessionFunction.cpp.

97{
98 ASSERTL1(pFieldNames.size() == pArray.size(),
99 "Function '" + m_name +
100 "' variable list size mismatch with array storage.");
101
102 for (int i = 0; i < pFieldNames.size(); i++)
103 {
104 Evaluate(pFieldNames[i], pArray[i], pTime, domain);
105 }
106}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242

References ASSERTL1, Evaluate(), and m_name.

◆ Evaluate() [4/4]

void Nektar::SolverUtils::SessionFunction::Evaluate ( std::vector< std::string >  pFieldNames,
Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const NekDouble pTime = 0.0,
const int  domain = 0 
)

Evaluates a function defined in the xml session file at each quadrature point.

Evaluates a function defined in the xml session file at each quadrature point.

Parameters
pFieldNamesThe names of the fields to evaluate the function for.
pFieldsThe fields into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 117 of file Core/SessionFunction.cpp.

121{
122 ASSERTL0(pFieldNames.size() == pFields.size(),
123 "Field list / name list size mismatch.");
124
125 for (int i = 0; i < pFieldNames.size(); i++)
126 {
127 Evaluate(pFieldNames[i], pFields[i]->UpdatePhys(), pTime, domain);
128 if (pFields[i]->GetWaveSpace())
129 {
130 pFields[i]->HomogeneousFwdTrans(pFields[i]->GetTotPoints(),
131 pFields[i]->GetPhys(),
132 pFields[i]->UpdatePhys());
133 }
134 pFields[i]->FwdTransLocalElmt(pFields[i]->GetPhys(),
135 pFields[i]->UpdateCoeffs());
136 }
137}

References ASSERTL0, and Evaluate().

◆ EvaluateExp()

void Nektar::SolverUtils::SessionFunction::EvaluateExp ( std::string  pFieldName,
Array< OneD, NekDouble > &  pArray,
const NekDouble pTime = 0.0,
const int  domain = 0 
)
private

Evaluates a function from expression

Parameters
pFieldNameThe name of the field to evaluate the function for.
pArrayThe array into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 249 of file Core/SessionFunction.cpp.

252{
253 unsigned int nq = m_field->GetNpoints();
254 if (pArray.size() < nq)
255 {
256 pArray = Array<OneD, NekDouble>(nq);
257 }
258
259 Array<OneD, NekDouble> x0(nq);
260 Array<OneD, NekDouble> x1(nq);
261 Array<OneD, NekDouble> x2(nq);
262
263 // Get the coordinates (assuming all fields have the same
264 // discretisation)
265 m_field->GetCoords(x0, x1, x2);
267 m_session->GetFunction(m_name, pFieldName, domain);
268
269 ffunc->Evaluate(x0, x1, x2, pTime, pArray);
270}

References m_field, m_name, and m_session.

Referenced by Evaluate().

◆ EvaluateFld()

void Nektar::SolverUtils::SessionFunction::EvaluateFld ( std::string  pFieldName,
Array< OneD, NekDouble > &  pArray,
const NekDouble pTime = 0.0,
const int  domain = 0 
)
private

Evaluates a function from fld file

Parameters
pFieldNameThe name of the field to evaluate the function for.
pArrayThe array into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 280 of file Core/SessionFunction.cpp.

283{
284 unsigned int nq = m_field->GetNpoints();
285 if (pArray.size() < nq)
286 {
287 pArray = Array<OneD, NekDouble>(nq);
288 }
289
290 std::string filename =
291 m_session->GetFunctionFilename(m_name, pFieldName, domain);
292 std::string fileVar =
293 m_session->GetFunctionFilenameVariable(m_name, pFieldName, domain);
294
295 if (fileVar.length() == 0)
296 {
297 fileVar = pFieldName;
298 }
299
300 // In case of eFunctionTypeTransientFile, generate filename from
301 // format string
303 m_session->GetFunctionType(m_name, pFieldName, domain);
305 {
306 try
307 {
308#if (defined _WIN32 && _MSC_VER < 1900)
309 // We need this to make sure boost::format has always
310 // two digits in the exponents of Scientific notation.
311 unsigned int old_exponent_format;
312 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
313 filename = boost::str(boost::format(filename) % pTime);
314 _set_output_format(old_exponent_format);
315#else
316 filename = boost::str(boost::format(filename) % pTime);
317#endif
318 }
319 catch (...)
320 {
321 ASSERTL0(false, "Invalid Filename in function \"" + m_name +
322 "\", variable \"" + fileVar + "\"")
323 }
324 }
325
326 // Define list of global element ids
327 int numexp = m_field->GetExpSize();
328 Array<OneD, int> ElementGIDs(numexp);
329 for (int i = 0; i < numexp; ++i)
330 {
331 ElementGIDs[i] = m_field->GetExp(i)->GetGeom()->GetGlobalID();
332 }
333
334 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
335 std::vector<std::vector<NekDouble>> FieldData;
338 fldIO->Import(filename, FieldDef, FieldData,
340
341 int idx = -1;
342 Array<OneD, NekDouble> vCoeffs(m_field->GetNcoeffs(), 0.0);
343 // Loop over all the expansions
344 for (int i = 0; i < FieldDef.size(); ++i)
345 {
346 // Find the index of the required field in the
347 // expansion segment
348 for (int j = 0; j < FieldDef[i]->m_fields.size(); ++j)
349 {
350 if (FieldDef[i]->m_fields[j] == fileVar)
351 {
352 idx = j;
353 }
354 }
355
356 if (idx >= 0)
357 {
358 m_field->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
359 FieldDef[i]->m_fields[idx], vCoeffs);
360 }
361 else
362 {
363 std::cout << "Field " + fileVar + " not found." << std::endl;
364 }
365 }
366
367 bool wavespace = m_field->GetWaveSpace();
368 m_field->SetWaveSpace(false);
369 m_field->BwdTrans(vCoeffs, pArray);
370 m_field->SetWaveSpace(wavespace);
371}
static std::shared_ptr< FieldIO > CreateForFile(const LibUtilities::SessionReaderSharedPtr session, const std::string &filename)
Construct a FieldIO object for a given input filename.
Definition: FieldIO.cpp:223
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:322
static FieldMetaDataMap NullFieldMetaDataMap
Definition: FieldIO.h:51

References ASSERTL0, Nektar::LibUtilities::FieldIO::CreateForFile(), Nektar::LibUtilities::eFunctionTypeTransientFile, CellMLToNektar.pycml::format, m_field, m_name, m_session, and Nektar::LibUtilities::NullFieldMetaDataMap.

Referenced by Evaluate().

◆ EvaluatePts()

void Nektar::SolverUtils::SessionFunction::EvaluatePts ( std::string  pFieldName,
Array< OneD, NekDouble > &  pArray,
const NekDouble pTime = 0.0,
const int  domain = 0 
)
private

Evaluates a function from pts file.

Evaluates a function from pts file

Parameters
pFieldNameThe name of the field to evaluate the function for.
pArrayThe array into which to write the values.
pTimeThe time at which to evaluate the function.
domainThe domain to evaluate the function in.

Definition at line 381 of file Core/SessionFunction.cpp.

384{
385 unsigned int nq = m_field->GetNpoints();
386 if (pArray.size() < nq)
387 {
388 pArray = Array<OneD, NekDouble>(nq);
389 }
390
391 std::string filename =
392 m_session->GetFunctionFilename(m_name, pFieldName, domain);
393 std::string fileVar =
394 m_session->GetFunctionFilenameVariable(m_name, pFieldName, domain);
395
396 if (fileVar.length() == 0)
397 {
398 fileVar = pFieldName;
399 }
400
401 // In case of eFunctionTypeTransientFile, generate filename from
402 // format string
404 m_session->GetFunctionType(m_name, pFieldName, domain);
406 {
407 try
408 {
409#if (defined _WIN32 && _MSC_VER < 1900)
410 // We need this to make sure boost::format has always
411 // two digits in the exponents of Scientific notation.
412 unsigned int old_exponent_format;
413 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
414 filename = boost::str(boost::format(filename) % pTime);
415 _set_output_format(old_exponent_format);
416#else
417 filename = boost::str(boost::format(filename) % pTime);
418#endif
419 }
420 catch (...)
421 {
422 ASSERTL0(false, "Invalid Filename in function \"" + m_name +
423 "\", variable \"" + fileVar + "\"")
424 }
425 }
426
428 // check if we already loaded this file. For transient files,
429 // funcFilename != filename so we can make sure we only keep the
430 // latest pts field per funcFilename.
431 std::string funcFilename =
432 m_session->GetFunctionFilename(m_name, pFieldName, domain);
433
435 if (fs::path(filename).extension() == ".pts")
436 {
437 LibUtilities::PtsIO ptsIO(m_session->GetComm());
438 ptsIO.Import(filename, inPts);
439 }
440 else if (fs::path(filename).extension() == ".csv")
441 {
442 LibUtilities::CsvIO csvIO(m_session->GetComm());
443 csvIO.Import(filename, inPts);
444 }
445 else
446 {
447 ASSERTL1(false, "Unsupported file type");
448 }
449
450 Array<OneD, Array<OneD, NekDouble>> pts(inPts->GetDim() +
451 inPts->GetNFields());
452 for (int i = 0; i < inPts->GetDim() + inPts->GetNFields(); ++i)
453 {
454 pts[i] = Array<OneD, NekDouble>(nq);
455 }
456 if (inPts->GetDim() == 1)
457 {
458 m_field->GetCoords(pts[0]);
459 }
460 else if (inPts->GetDim() == 2)
461 {
462 m_field->GetCoords(pts[0], pts[1]);
463 }
464 else if (inPts->GetDim() == 3)
465 {
466 m_field->GetCoords(pts[0], pts[1], pts[2]);
467 }
469 inPts->GetDim(), inPts->GetFieldNames(), pts);
470
471 FieldUtils::Interpolator<std::vector<MultiRegions::ExpListSharedPtr>>
472 interp;
473 if (m_interpolators.find(funcFilename) != m_interpolators.end())
474 {
475 interp = m_interpolators[funcFilename];
476 }
477 else
478 {
479 interp = FieldUtils::Interpolator<
480 std::vector<MultiRegions::ExpListSharedPtr>>(
482 if (m_session->GetComm()->GetRank() == 0)
483 {
484 interp.SetProgressCallback(&SessionFunction::PrintProgressbar,
485 this);
486 }
487 interp.CalcWeights(inPts, outPts);
488 if (m_session->GetComm()->GetRank() == 0)
489 {
490 std::cout << std::endl;
491 if (m_session->DefinesCmdLineArgument("verbose"))
492 {
493 interp.PrintStatistics();
494 }
495 }
496 }
497
498 if (m_toCache)
499 {
500 m_interpolators[funcFilename] = interp;
501 }
502
503 // TODO: only interpolate the field we actually want
504 interp.Interpolate(inPts, outPts);
505
506 int fieldInd;
507 std::vector<std::string> fieldNames = outPts->GetFieldNames();
508 for (fieldInd = 0; fieldInd < fieldNames.size(); ++fieldInd)
509 {
510 if (outPts->GetFieldName(fieldInd) == fileVar)
511 {
512 break;
513 }
514 }
515 ASSERTL0(fieldInd != fieldNames.size(), "field not found");
516
517 pArray = outPts->GetPts(fieldInd + outPts->GetDim());
518}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::map< std::string, FieldUtils::Interpolator< std::vector< MultiRegions::ExpListSharedPtr > > > m_interpolators
Interpolator for pts file input for a variable & domain combination.
SOLVER_UTILS_EXPORT void PrintProgressbar(const int position, const int goal) const
std::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:184

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::Interpolator::CalcWeights(), Nektar::LibUtilities::eFunctionTypeTransientFile, Nektar::LibUtilities::eShepard, CellMLToNektar.pycml::format, Nektar::LibUtilities::PtsIO::Import(), Nektar::FieldUtils::Interpolator< T >::Interpolate(), m_field, m_interpolators, m_name, m_session, m_toCache, PrintProgressbar(), Nektar::LibUtilities::Interpolator::PrintStatistics(), and Nektar::LibUtilities::Interpolator::SetProgressCallback().

Referenced by Evaluate().

◆ GetExpansion()

SOLVER_UTILS_EXPORT const MultiRegions::ExpListSharedPtr & Nektar::SolverUtils::SessionFunction::GetExpansion ( )
inline

Definition at line 104 of file SessionFunction.h.

105 {
106 return m_field;
107 }

References m_field.

◆ GetSession()

SOLVER_UTILS_EXPORT const LibUtilities::SessionReaderSharedPtr & Nektar::SolverUtils::SessionFunction::GetSession ( )
inline

Definition at line 99 of file SessionFunction.h.

100 {
101 return m_session;
102 }

References m_session.

◆ PrintProgressbar()

SOLVER_UTILS_EXPORT void Nektar::SolverUtils::SessionFunction::PrintProgressbar ( const int  position,
const int  goal 
) const
inlineprivate

Definition at line 145 of file SessionFunction.h.

147 {
148 LibUtilities::PrintProgressbar(position, goal, "Interpolating");
149 }
int PrintProgressbar(const int position, const int goal, const std::string message, int lastprogress=-1)
Prints a progressbar.
Definition: Progressbar.hpp:65

References Nektar::LibUtilities::PrintProgressbar().

Referenced by EvaluatePts().

Member Data Documentation

◆ m_arrays

std::map<std::pair<std::string, int>, Array<OneD, NekDouble> > Nektar::SolverUtils::SessionFunction::m_arrays
private

Cached result arrays.

Definition at line 125 of file SessionFunction.h.

Referenced by Evaluate().

◆ m_field

MultiRegions::ExpListSharedPtr Nektar::SolverUtils::SessionFunction::m_field
private

The expansion we want to evaluate this function for.

Definition at line 113 of file SessionFunction.h.

Referenced by Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), and GetExpansion().

◆ m_interpolators

std::map<std::string, FieldUtils::Interpolator< std::vector<MultiRegions::ExpListSharedPtr> > > Nektar::SolverUtils::SessionFunction::m_interpolators
private

Interpolator for pts file input for a variable & domain combination.

Definition at line 123 of file SessionFunction.h.

Referenced by EvaluatePts().

◆ m_lastCached

std::map<std::pair<std::string, int>, NekDouble> Nektar::SolverUtils::SessionFunction::m_lastCached
private

Last time the cache for this variable & domain combo was updated.

Definition at line 119 of file SessionFunction.h.

Referenced by Evaluate().

◆ m_name

std::string Nektar::SolverUtils::SessionFunction::m_name
private

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::SolverUtils::SessionFunction::m_session
private

The session reader.

Definition at line 111 of file SessionFunction.h.

Referenced by Describe(), Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), GetSession(), and SessionFunction().

◆ m_toCache

bool Nektar::SolverUtils::SessionFunction::m_toCache
private

Store resulting arrays (and interpolators)

Definition at line 117 of file SessionFunction.h.

Referenced by Evaluate(), and EvaluatePts().