Skip to content

Implement a HippoInterface class to streamline access to core underlying OpenFOAM and Hippo objects - #125

Open
mattfalcone1997 wants to merge 5 commits into
aurora-multiphysics:mainfrom
mattfalcone1997:develop-hippo-interface
Open

Implement a HippoInterface class to streamline access to core underlying OpenFOAM and Hippo objects#125
mattfalcone1997 wants to merge 5 commits into
aurora-multiphysics:mainfrom
mattfalcone1997:develop-hippo-interface

Conversation

@mattfalcone1997

@mattfalcone1997 mattfalcone1997 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Creates a HippoInterface base class that stores references to the underlying OpenFOAM objects such as

  • fvMesh
  • Foam::Time
  • FoamProblem
  • ...

We should consider adding other Hippo/OpenFOAM objects here.

Related Issue

Resolves #117

Checklist

  • Tests have been written for the new/changed behaviour.
  • Documentation/examples have been added/updated for the new changes.

@mattfalcone1997
mattfalcone1997 marked this pull request as ready for review June 29, 2026 14:33
@mattfalcone1997
mattfalcone1997 requested a review from k-collie June 29, 2026 14:33
#include "InputParameters.h"
#include "MooseObject.h"
#include <fvMesh.H>
#include <string>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop this include.

class FoamProblem;
class FoamMesh;

class HippoInterface

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a doc comment.

Comment on lines -32 to -38
auto foam_problem = dynamic_cast<FoamProblem *>(_problem.get());

// Adding BCs using [FoamBC] syntax
if (_current_task == "add_foam_bc")
{
if (!foam_problem)
mooseError("FoamBCs system can only be used with FoamProblem.");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check done somewhere else now? I think it is useful

class HippoInterface
{
public:
HippoInterface(const MooseObject * moose_object);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a const reference?

class FoamProblem;
class FoamMesh;

class HippoInterface

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be nicer for client code to compose this class rather than inherit it - I'd generally lean to composition over inheritance where possible.

If we stick with inheritance then I think it should be at least protected rather than public.

Similarly I'd be wary of calling it an "interface" - interfaces generally aren't allowed member variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create HippoInterface base class

2 participants