Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ProblemOperatorBase with ProblemOperator #115

Conversation

EdwardPalmer99
Copy link
Contributor

@EdwardPalmer99 EdwardPalmer99 commented Jun 5, 2024

Brief

  • Merge ProblemOperator with ProblemOperatorBase.
  • TimeDomainProblemOperator now inherits from ProblemOperator etc.

Diamond Inheritance

  • mfem::TimeDependentOperator should inherit from mfem::Operator virtually. Then hephaestus::ProblemOperator would inherit from mfem::Operator virtually and hephaestus::TimeDomainProblemOperator would finally inherit from mfem::TimeDependentOperator and ProblemOperator with no ambiguities (see diamond inheritance on Wikipedia).
  • Unfortunately, this cannot happen without modifying mfem. A workaround is for the ProblemOperator to inherit virtually from mfem::Operator as before and for TimeDomainProblemOperator to inherit from ProblemOperator and virtually from mfem::TimeDependentOperator. We then need to add virtual setters for the width/height member variables stored in mfem::Operator.

Other Changes

  • Solve, Mult, ImplicitSolve methods now have MFEM_ABORT if they are not overriden preventing user from calling empty methods.
  • Solve method inherited from hephaestus::ProblemOperator by hephaestus::TimeDomainProblemOperator has MFEM_ABORT with message explaining that it cannot be used for time-dependent problems.

Design Questions

  • Does it make sense for builder classes to implement ConstructOperator method for a problem operator (i.e. ProblemOperator, TimeDomainProblemOperator) class which does not implement Solve/ImplicitSolve methods?

TimeDomainProblemOperator now inherits from ProblemOperator. Using virtual inheritance to skip diamond inheritance problem.
@EdwardPalmer99 EdwardPalmer99 changed the base branch from master to EdwardPalmer99/mesh-update-feature/problem-operators-for-specific-solvers June 5, 2024 10:23
@EdwardPalmer99 EdwardPalmer99 self-assigned this Jun 5, 2024
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.

1 participant