FVProblemInterface
-
class FVProblemInterface : public godzilla::DiscreteProblemInterface
Interface for finite volume problems.
Any problem using PetscFV should inherit from this for unified API
Subclassed by godzilla::ExplicitFVLinearProblem
Public Functions
-
virtual Int get_num_fields() const override
Get number of fields.
- Returns:
The number of fields
-
virtual std::vector<std::string> get_field_names() const override
Get list of all field names.
- Returns:
List of field names
-
virtual const std::string &get_field_name(Int fid) const override
Get field name.
- Parameters:
fid – Field ID
-
virtual Int get_field_num_components(Int fid) const override
Get number of field components.
- Parameters:
fid – Field ID
- Returns:
Number of components
-
virtual Int get_field_id(const std::string &name) const override
Get field ID.
- Parameters:
name – Field name
Field – ID
-
virtual bool has_field_by_id(Int fid) const override
Do we have field with specified ID.
- Parameters:
fid – The ID of the field
- Returns:
True if the field exists, otherwise False
-
virtual bool has_field_by_name(const std::string &name) const override
Do we have field with specified name.
- Parameters:
name – The name of the field
- Returns:
True if the field exists, otherwise False
-
virtual Int get_field_order(Int fid) const override
Get field order.
- Parameters:
fid – Field ID
- Returns:
Field order
-
virtual std::string get_field_component_name(Int fid, Int component) const override
Get component name of a field.
- Parameters:
fid – Field ID
component – Component index
- Returns:
Component name
-
virtual void set_field_component_name(Int fid, Int component, const std::string &name) override
Set the name of a component of afield variable.
- Parameters:
fid – Field ID
component – Component index
name – Component name
-
virtual Int get_num_aux_fields() const override
Get number of auxiliary fields.
- Returns:
The number of auxiliary fields
-
virtual std::vector<std::string> get_aux_field_names() const override
Get all auxiliary field names.
- Returns:
All auxiliary field names
-
virtual const std::string &get_aux_field_name(Int fid) const override
Get auxiliary field name.
- Parameters:
fid – Auxiliary field ID
- Returns:
Auxiliary field name
-
virtual Int get_aux_field_num_components(Int fid) const override
Get number of auxiliary field components.
- Parameters:
fid – Auxiliary field ID
- Returns:
Number of components
-
virtual Int get_aux_field_id(const std::string &name) const override
Get auxiliary field ID.
- Parameters:
name – Auxiliary field name
- Returns:
Auxiliary field ID
-
virtual bool has_aux_field_by_id(Int fid) const override
Do we have auxiliary field with specified ID.
- Parameters:
fid – The ID of the auxiliary field
- Returns:
True if the auxiliary field exists, otherwise False
-
virtual bool has_aux_field_by_name(const std::string &name) const override
Do we have auxiliary field with specified name.
- Parameters:
name – The name of the auxiliary field
- Returns:
True if the auxiliary field exists, otherwise False
-
virtual Int get_aux_field_order(Int fid) const override
Get auxiliary field order.
- Parameters:
fid – Auxiliary field ID
- Returns:
Auxiliary field order
-
virtual std::string get_aux_field_component_name(Int fid, Int component) const override
Get component name of an auxiliary field.
- Parameters:
fid – Auxiliary field ID
component – Component index
- Returns:
Component name
-
virtual void set_aux_field_component_name(Int fid, Int component, const std::string &name) override
Set the name of a component of an auxiliary field variable.
- Parameters:
fid – Field ID
component – Component index
name – Component name
-
void add_field(Int id, const std::string &name, Int nc, const Label &block = Label())
Adds a volumetric field.
- Parameters:
id – The field ID
name – The name of the field
nc – The number of components
k – The degree k of the space
block – The label this field is restricted to
-
Int add_aux_field(const std::string &name, Int nc, Int k, const Label &block = Label())
Adds a volumetric auxiliary field.
- Parameters:
name – The name of the field
nc – The number of components
k – The degree k of the space
block – The label this field is restricted to
- Returns:
ID of the new field
-
void set_aux_field(Int id, const std::string &name, Int nc, Int k, const Label &block = Label())
Set a volumetric auxiliary field.
- Parameters:
id – The field ID
name – The name of the field
nc – The number of components
k – The degree k of the space
block – The label this field is restricted to
-
virtual Int get_num_fields() const override