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

Functor System Enhancements #19420

Open
3 of 5 tasks
lindsayad opened this issue Nov 17, 2021 · 6 comments
Open
3 of 5 tasks

Functor System Enhancements #19420

lindsayad opened this issue Nov 17, 2021 · 6 comments
Assignees
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.

Comments

@lindsayad
Copy link
Member

lindsayad commented Nov 17, 2021

Reason

Functors are great and we want more of them

Proposed updates

This is copying some of the items from #19420 (comment)

Priority:

  • nodal evaluations. So we can deprecate FunctionAux with FunctorAux and watch the world burn
  • fv-type evaluations for FE variables
  • fe-type evaluations for FV variables

Secondary:

  • interface to regular material properties. This would give much wide adoption to the Functor system if people could ease into with a working yet slow interface (reinit before computing computeQp, then pick that value, then cache it!)
  • make functors work better with the aux system. Details in Extend functors to aux system #19396

Design

Functors that can be requested in the input file will need to inherit from MooseObject and then we'll set them up just like we do for any other MooseObject with MooseObjectAction derivatives.

TBD

Impact

Make for more flexible simulations and in my current context prevent, not abuse of but perhaps, overextension of aux variables.

Make functors even greater

@lindsayad lindsayad added the T: task An enhancement to the software. label Nov 17, 2021
@lindsayad lindsayad self-assigned this Nov 17, 2021
@lindsayad lindsayad added this to To do in FY22 NEAMS MP - TA Support via automation Nov 17, 2021
@lindsayad lindsayad changed the title Make Functors first-class input file capability Make Functors a first-class input file capability Nov 17, 2021
@lindsayad
Copy link
Member Author

My immediate issue can be resolved with FVPropValPerSubdomain, soon to be PiecewiseContactPerBlock material. But as stated on Slack, I am fine continuing on with the existing functor derivatives as long as we can, but at some point I think allowing user creation and arbitrary chaining of evaluation events will be a great thing

@lindsayad
Copy link
Member Author

The newest issue I had was that if I execute reconstruction on initialSetup in the user object, the aux variable initial condition has not yet executed so the reconstructed field is zero everywhere 😭 But this again will be fixed by using FVPropValPerSubdomain

@GiudGiud
Copy link
Contributor

GiudGiud commented Nov 17, 2021

Let's summarize here what we have in functors now:

  • functions. Dependence on space and time mostly, usually not sub-dependence but could depend on other functors if needed. We attach a function definition, and the functor is just evaluating that definition.
  • variables and aux-variables. They are fields, so have a memory cost, and they cant be attached a functor, they are the functor. The functor is essentially an evaluation of that field at the request location, with the requested interpolation
  • functor material properties. We attach a functor (lambda) to them, and this lambda is the functor. This is done in the constructor.

What we want in functors that isn't provided across the board (eg not all 3 forms, but 1 or 2 have it). This usually means you should just change the object you are trying to use

  • field-less (eg no mesh storage) capability. This is only provided by Functions and FunctorMatprops.
  • chaining of functors. Comes with attaching a functor, so only Functions and FunctorMatprops

What we want in functors that isn't provided at all (currently):

  1. ordering of execution of objects acting on functors. We should be able to chain auxkernels to act on an auxvariable. If we had a FunctorAuxKernel (or simply Functor) we could make them depend on each other
  2. nodal evaluations. So we can deprecate FunctionAux with FunctorAux and watch the world burn. Helps for 3)
  3. interface from regular material properties. This would give much wide adoption to the Functor system if people could ease into with a working yet slow interface (reinit before computing computeQp, then pick that value, then cache it!)
  4. interface to regular material properties. Users can code their new materials as functors, and have them be computed on computeQp
  5. implicit conversion between AD and non-AD for the types that are safe. Eg it should be possible to convert a non-AD function to an AD functor, an auxvariable to a non-AD functor etc. Basically all the ones where we dont lose the Jacobian. This would make mixed formulation input files much more tractable

A new Functor class could help with 1) I think.

@lindsayad
Copy link
Member Author

FunctorAuxKernel refs #19396. However, I'm not sure if it's necessary any more. In my mind a FunctorMaterialProperty supplies the same desired functionality

@lindsayad
Copy link
Member Author

Once I have some time, I may try applying a FunctorMaterialProperty design to @tanoret's segregated application where he had to workaround the fact that we cannot currently chain aux kernel dependencies that leverage functors.

@lindsayad lindsayad changed the title Make Functors a first-class input file capability Functor System Enhancements Nov 17, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Nov 30, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 1, 2021
…ant material, refs idaholab#19420

Add exception checks test to functor conversion material
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 3, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 3, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 3, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 3, 2021
…ant material, refs idaholab#19420

Add exception checks test to functor conversion material
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 3, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 4, 2021
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 4, 2021
Ideally, we would use a postprocessor that currently does not have an issue with insufficient
ghosting when used on its own, see idaholab#19534. But I dont think there is one that will trigger
the ghosting we want. I could admittedly make a new one, which would be a rework of SideAverageMaterialProperty,
but it could make that one confusing.

Use MatpropName and FunctorName instead of strings for parameters for the AD converters
Refs idaholab#19420
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 5, 2021
Ideally, we would use a postprocessor that currently does not have an issue with insufficient
ghosting when used on its own, see idaholab#19534. But I dont think there is one that will trigger
the ghosting we want. I could admittedly make a new one, which would be a rework of SideAverageMaterialProperty,
but it could make that one confusing.

Use MatpropName and FunctorName instead of strings for parameters for the AD converters
Refs idaholab#19420

Use interface diffusive flux instead of side to use both sides
GiudGiud added a commit to GiudGiud/moose that referenced this issue Dec 5, 2021
Ideally, we would use a postprocessor that currently does not have an issue with insufficient
ghosting when used on its own, see idaholab#19534. But I dont think there is one that will trigger
the ghosting we want. I could admittedly make a new one, which would be a rework of SideAverageMaterialProperty,
but it could make that one confusing.

Use MatpropName and FunctorName instead of strings for parameters for the AD converters
Refs idaholab#19420

Use interface diffusive flux instead of side to use both sides

regold
@lindsayad lindsayad added the P: normal A defect affecting operation with a low possibility of significantly affects. label Jan 6, 2022
@permcody permcody removed this from To do in FY22 NEAMS MP - TA Support Feb 1, 2022
@permcody permcody added this to To do in FY22 NEAMS MP - CRAB via automation Feb 1, 2022
@lindsayad
Copy link
Member Author

@humrickhouse needs nodal "material property" evaluations

GiudGiud added a commit to GiudGiud/moose that referenced this issue May 26, 2023
GiudGiud added a commit to GiudGiud/moose that referenced this issue May 26, 2023
GiudGiud added a commit to GiudGiud/moose that referenced this issue May 26, 2023
Add test for converting vector functors
refs idaholab#19420
GiudGiud added a commit to GiudGiud/moose that referenced this issue May 26, 2023
Add test for converting vector functors
refs idaholab#19420
tanoret pushed a commit to tanoret/moose that referenced this issue Jul 10, 2023
tanoret pushed a commit to tanoret/moose that referenced this issue Jul 10, 2023
Add test for converting vector functors
refs idaholab#19420
lindsayad pushed a commit to AlbertJP7/moose that referenced this issue Sep 13, 2023
lindsayad pushed a commit to lindsayad/moose that referenced this issue Oct 4, 2023
lindsayad pushed a commit to lindsayad/moose that referenced this issue Oct 9, 2023
lindsayad pushed a commit to lindsayad/moose that referenced this issue Oct 14, 2023
lindsayad pushed a commit to lindsayad/moose that referenced this issue Oct 17, 2023
lindsayad added a commit to lindsayad/moose that referenced this issue Oct 18, 2023
lindsayad added a commit to lindsayad/moose that referenced this issue Oct 18, 2023
lindsayad added a commit to lindsayad/moose that referenced this issue Oct 18, 2023
GiudGiud added a commit to GiudGiud/moose that referenced this issue Oct 23, 2023
…ic functor material

To avoid conflicts with the GeneralFluidProps which define the time derivative but not the density
refs idaholab#19420
refs idaholab/ncrc/bluecrab#228
snschune pushed a commit to snschune/moose that referenced this issue Nov 1, 2023
lynnmunday pushed a commit to zachmprince/moose that referenced this issue Nov 6, 2023
lynnmunday pushed a commit to zachmprince/moose that referenced this issue Nov 6, 2023
lynnmunday pushed a commit to zachmprince/moose that referenced this issue Nov 6, 2023
…ic functor material

To avoid conflicts with the GeneralFluidProps which define the time derivative but not the density
refs idaholab#19420
refs idaholab/ncrc/bluecrab#228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.
Projects
No open projects
Development

No branches or pull requests

2 participants