FunctionInterface

class FunctionInterface

Interface for parsed function.

Subclassed by godzilla::DirichletBC, godzilla::FunctionAuxiliaryField, godzilla::FunctionInitialCondition, godzilla::L2Diff

Public Functions

void create()

Build the evaluator.

unsigned int get_num_components() const

Get number of components.

Returns:

The number of components

bool has_time_expression() const

Check if time dependent expression was specified.

Returns:

true if time dependent expression is specified, false otherwise

bool evaluate_func(Real time, const Real x[], Int nc, Real u[])

Evaluate parsed function.

Parameters:
  • time – Time of the time-dependent function

  • x – Spatial coordinate where we evaluate the function (has size of dim)

  • nc – Number of components

  • u – The result of evaluation (one per component)

Returns:

‘true’ if evaluation was successful, false otherwise

bool evaluate_func_t(Real time, const Real x[], Int nc, Real u[])

Evaluate parsed time derivative function.

Parameters:
  • time – Time of the time-dependent function

  • x – Spatial coordinate where we evaluate the function (has size of dim)

  • nc – Number of components

  • u – The result of evaluation (one per component)

Returns:

‘true’ if evaluation was successful, false otherwise