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

Platypus to MOOSE migration #29633

Draft
wants to merge 339 commits into
base: next
Choose a base branch
from
Draft

Platypus to MOOSE migration #29633

wants to merge 339 commits into from

Conversation

lindsayad
Copy link
Member

refs #29632

alexanderianblair and others added 30 commits August 13, 2024 12:11
…lair/MFEMSolversAndPreconditioners

Enable user specification of solvers and preconditioners
Note that raw coefficients haven't yet been totally expunged from the
code, as that will require some changes to the boundary conditions.
Also improved error handling for undeclared materials.
Tests all run, but they don't all pass
These provide the functionality of the MFEMCoefficient classes.
…terials

Implement new interface for materials and coefficients
@lindsayad
Copy link
Member Author

@alexanderianblair one thing we'd probably want to do is shorten the tests for your kernels if possible

Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

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

Reminder for myself to expand non no-optional recipes to include MFEM when ready

Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

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

Through 1/3 of the files. appropriately keeping things tracked as viewed so work can continue

* [FESpaces]
* []
*/
class AddFESpaceAction : public MooseObjectAction
Copy link
Member

Choose a reason for hiding this comment

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

Rename AddMFEMFESpaceAction

* This class implements the action controlling the construction of the
* required MFEM ProblemOperator.
*/
class AddProblemOperatorAction : public Action
Copy link
Member

Choose a reason for hiding this comment

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

Rename AddMFEMProblemOperatorAction

* This class implements the action ensuring the mesh uses the same FE space as
* the displacement for mesh updates.
*/
class SetMeshFESpaceAction : public Action
Copy link
Member

Choose a reason for hiding this comment

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

Rename for MFEM

Comment on lines +23 to +26
// Name of (the test variable associated with) the weak form that the kernel is applied to.
std::string _test_var_name;
std::vector<BoundaryName> _boundary_names;
mfem::Array<int> _bdr_attributes;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Name of (the test variable associated with) the weak form that the kernel is applied to.
std::string _test_var_name;
std::vector<BoundaryName> _boundary_names;
mfem::Array<int> _bdr_attributes;
// Name of (the test variable associated with) the weak form that the kernel is applied to.
const std::string _test_var_name;
const std::vector<BoundaryName> _boundary_names;
mfem::Array<int> _bdr_attributes;

Comment on lines +19 to +20
mfem::Array<int> GetMarkers(mfem::Mesh & mesh);
mfem::Array<int> _bdr_markers;
Copy link
Member

Choose a reason for hiding this comment

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

  • Does _bdr_markers need to be public?
  • GetMarkers -> getMarkers
  • const on GetMarkers?

Comment on lines +14 to +23
mfem::Array<int> GetEssentialBdrMarkers(const std::string & name_, mfem::Mesh * mesh_);

void ApplyEssentialBCs(const std::string & name_,
mfem::Array<int> & ess_tdof_list,
mfem::GridFunction & gridfunc,
mfem::Mesh * mesh_);

void ApplyIntegratedBCs(const std::string & name_, mfem::BilinearForm & blf, mfem::Mesh * mesh_);

void ApplyIntegratedBCs(const std::string & name_, mfem::LinearForm & lf, mfem::Mesh * mesh_);
Copy link
Member

Choose a reason for hiding this comment

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

  • camel case
  • no abbreviation in GetEssentialBdrMarkers
  • mesh pointers here should probably all be able to be references?

#include <mfem.hpp>
#include "libmesh/restore_warnings.h"

namespace platypus
Copy link
Member

Choose a reason for hiding this comment

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

resolve namespace

{

/// Lightweight adaptor over an std::map from strings to pointer to T
template <typename T>
Copy link
Member

Choose a reason for hiding this comment

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

Lots of camel case methods here.

Is it it not possible to have moose context here to make errors more rich?

#include "MFEMKernel.h"
#include "ScaleIntegrator.h"

namespace platypus
Copy link
Member

Choose a reason for hiding this comment

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

  • resolve namespace
  • camel case methods
  • move public data that doesn't need to be public

/**
* Set the device to use to solve the FE problem.
*/
void setDevice();
Copy link
Member

Choose a reason for hiding this comment

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

We should have a discussion at some point on devices and how to generalize specifying something like a GPU in moose

-DLAPACK_INCLUDE_DIRS="$PETSC_DIR/include" \
-DCMAKE_INSTALL_PREFIX="$MFEM_DIR" \
-DMFEM_USE_PETSC=YES \
-DPETSC_DIR="$PETSC_DIR" \
Copy link
Member

Choose a reason for hiding this comment

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

Still need to resolve #29635 (comment)

In-tree install of petsc with a PETSC_ARCH requires PETSC_ARCH, and requires all of the PETSC_DIRs for the other deps to be PETSC_DIR/PETSC_ARCH

@lindsayad
Copy link
Member Author

@alexanderianblair is it unsurprising that the MFEM tests diff in parallel?

@moosebuild
Copy link
Contributor

Job Precheck, step Size check on f9d8beb wanted to post the following:

Warning: This PR changes repo size by 23.67 MiB.

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.

8 participants