-
Notifications
You must be signed in to change notification settings - Fork 10
Convert FunctionBCs to FunctorBCs accepting Coefficient inputs formed from Functions or Materials #69
Conversation
bf45617 to
53d915e
Compare
cmacmackin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a number of initial comments/asked some questions. A few thoughts:
- I'd really prefer if we could redo the file name changes so they were accomplished with
git mv, as this makes changes to those files much easier to review. - We should be more consistent in using the terms "property", "coefficient", and "functor".
- Property should be reserved for things associated with materials
- We need to choose whether to use functor or coefficient for the rest
- I think the materials should subclass
FunctorMaterial - How much do we want to imitate the MOOSE functor access interface?
- We could just make coefficients be analagous to functors. You can use them regardless of whether they are defined by material properties, functions, auxiliary variables, post-processors, etc., but the functions for declaring and accessing them have completely different interfaces and names.
- We could try to mimic functors as much as possible, including using the name.
- Should we add the ability to access coefficients for variables, auxvariables, and post-processors, as can be done for functors?
I think we should change the naming convention for the declareXProperty methods. Methods that take a list block IDs will keep their names. Those that do not will be called declareXCoefficient instead. This makes it clear that properties are a way of building up piecewise data, associated with particular parts of the mesh that correspond to a material, while coefficients are a more generic concept. Incidentally, this will avoid some overloading and simplify the interface for the variadic templated methods.
This isn't meant to be a final review; there may well be something I'm forgetting or missed.
53d915e to
1db1b87
Compare
…ents for consistency with scalar versions
Also renamed a bunch of classes to be clearer.
1db1b87 to
fefaefa
Compare
|
I've handled the comments I raised on particular parts of the code. Some ongoing questions, however:
@alexanderianblair @Heinrich-BR Do either of you have any comments? |
|
I've made some further changes to simplify things, ensuring that all creation of coefficients is done through the CoefficientManager class. These, in turn, create all coefficients through the CoefficientMap class. The CoefficientMap objects are private members of CoefficientManager, so no one else will be able to use them. All of this means there will be just one way to do things, hopefully making it clearer for future developers and reducing the maintenance burden. |
|
This is almost ready for review. I'd like to add one or two integration tests that use an (aux)variable as a coefficient for a kernel. The only things left to do are answer the queries above. |
|
Which is more important: maintaining consistency with existing functor BCs in MOOSE (in which case we'd say "functor") or using the clearer term (in which case we'd say "coefficient")?
I like this idea, but let's leave it for a follow-up pull request. |
|
@alexanderianblair Technically you're down as the author of this PR, so I can't send you a request to perform a review. Could you leave any comments and once you're satisfied with everything I'll give an approving review to tick the boxes on GitHub. |
Apologies, I wasn't clear here - I meant the latter. MOOSE isn't consistent on this front either (
Yup - sounds good to me, to keep this PR from getting any longer! |
|
I've changed the names of those parameters from "functor" to "coefficient". It looks like the version of VTK being used in the build image differs from that used to create the comparison output files now, though, and this is causing the tests to fail. @alexanderianblair, @Heinrich-BR, any idea what's going on there? |
Looks like it's a side-effect from the upstream merge of mfem/mfem#4797 into MFEM's master branch - probably easiest to pin the MFEM commit in the platypus-deps |
alexanderianblair
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main functionality looks good - I'd update the reference to 'functors' in documentation to refer to coefficients where appropriate, and see if MOOSE's unique names could be used instead of the pointer to string conversion, but otherwise happy. Major QoL improvement for access and set-up of coefficients!
|
I've made the requested changes. I'll let the CI run and you do a final check. |
alexanderianblair
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
…exanderianblair/functor-inputs Convert FunctionBCs to FunctorBCs accepting Coefficient inputs formed from Functions or Materials
…exanderianblair/functor-inputs Convert FunctionBCs to FunctorBCs accepting Coefficient inputs formed from Functions or Materials
Following on from the discussion in #61 and #53 regarding a single store of
mfem::Coefficients,mfem::VectorCoefficients, andmfem::MatrixCoefficientsto enable Functor-like functionality in Platypus using coefficients, this PR converts existing FunctionBCs and kernels to Functor equivalents that can take a Coefficient type in their input, repurposing thePropertyManagerto act as the problem Coefficient store.In addition, some minor readability updates to handling of Coefficient names has also been carried out for improved clarity when referring to different Coefficient types in parameter declarations.