Skip to content

Compilation error with BOUT-next #17

Description

@mikekryjak

Problem
Compiling with the latest BOUT-next results in the below error:

/ssd_scratch/SD1D/sd1d.cxx: In member function ‘int SD1D::precon(BoutReal, BoutReal, BoutReal)’:
/ssd_scratch/SD1D/sd1d.cxx:1696:24: error: ‘Create’ is not a member of ‘InvertPar’
 1696 |       inv = InvertPar::Create();
      |                        ^~~~~~

This is coming from this section starting on line 1640 in sd1d.cxx:

    static InvertPar *inv = NULL;
    if (!inv) {
      // Initialise parallel inversion class
      inv = InvertPar::Create();
      inv->setCoefA(1.0);
    }

Potential fix
I have had Hasan help me with this in the past and I have this code block in my own version of SD1D which makes it work:

    static std::unique_ptr<InvertPar> inv = nullptr;
    if (!inv) {
      // Initialise parallel inversion class
      inv = InvertPar::create();
      inv->setCoefA(1.0);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions