DGProblemInterface

class DGProblemInterface : public godzilla::DiscreteProblemInterface

Interface for discontinuous galerkin finite element problems.

Subclassed by godzilla::ExplicitDGLinearProblem

Public Functions

virtual Int get_num_fields() const override

Get number of fields.

Returns:

The number of fields

virtual std::vector<String> get_field_names() const override

Get list of all field names.

Returns:

List of field names

virtual Expected<String, ErrorCode> get_field_name(FieldID fid) const override

Get field name.

Parameters:

fid – Field ID

virtual Expected<Int, ErrorCode> get_field_num_components(FieldID fid) const override

Get number of field components.

Parameters:

fid – Field ID

Returns:

Number of components

virtual Expected<FieldID, ErrorCode> get_field_id(String name) const override

Get field ID.

Parameters:
  • name – Field name

  • Field – ID

virtual bool has_field_by_id(FieldID 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(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 Expected<Order, ErrorCode> get_field_order(FieldID fid) const override

Get field order.

Parameters:

fid – Field ID

Returns:

Field order

virtual Expected<String, ErrorCode> get_field_component_name(FieldID 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(FieldID fid, Int component, 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<String> get_aux_field_names() const override

Get all auxiliary field names.

Returns:

All auxiliary field names

virtual Expected<String, ErrorCode> get_aux_field_name(FieldID fid) const override

Get auxiliary field name.

Parameters:

fid – Auxiliary field ID

Returns:

Auxiliary field name

virtual Expected<Int, ErrorCode> get_aux_field_num_components(FieldID fid) const override

Get number of auxiliary field components.

Parameters:

fid – Auxiliary field ID

Returns:

Number of components

virtual Expected<FieldID, ErrorCode> get_aux_field_id(String name) const override

Get auxiliary field ID.

Parameters:

name – Auxiliary field name

Returns:

Auxiliary field ID

virtual bool has_aux_field_by_id(FieldID 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(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 Expected<Order, ErrorCode> get_aux_field_order(FieldID fid) const override

Get auxiliary field order.

Parameters:

fid – Auxiliary field ID

Returns:

Auxiliary field order

virtual Expected<String, ErrorCode> get_aux_field_component_name(FieldID 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(FieldID fid, Int component, String name) override

Set the name of a component of an auxiliary field variable.

Parameters:
  • fid – Field ID

  • component – Component index

  • name – Component name

FieldID add_field(String name, Int nc, Order k, const Label &block = Label())

Adds a volumetric field.

Parameters:
  • name – The name of the field

  • nc – The number of components

  • k – The degree k of the space

Returns:

ID of the new field

void set_field(FieldID id, String name, Int nc, Order k, const Label &block = Label())

Set 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

FieldID add_aux_field(String name, Int nc, Order 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

Returns:

ID of the new field

void set_aux_field(FieldID id, String name, Int nc, Order 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

Int get_field_dof(Int elem, Int local_node, FieldID fid) const

Get field degree of freedom.

Parameters:
  • elem – Element ID

  • local_node – Local node index

  • fid – Field ID

Returns:

Degree of freedom

Int get_aux_field_dof(Int elem, Int local_node, FieldID fid) const

Get auxiliary field degree of freedom.

Parameters:
  • elem – Element ID

  • local_node – Local node index

  • fid – Auxiliary field ID

Returns:

Degree of freedom