Skip to content

Conversation

@andrsd
Copy link
Collaborator

@andrsd andrsd commented Feb 2, 2026

No description provided.

@andrsd andrsd self-assigned this Feb 2, 2026
@andrsd andrsd added the enhancement New feature or request label Feb 2, 2026
@andrsd andrsd marked this pull request as draft February 2, 2026 20:08
@andrsd
Copy link
Collaborator Author

andrsd commented Feb 2, 2026

This is on top of #896 - only the top 3 patches are related to PPS.

I am looking for feedback if this is the direction to go to support the other capability described in #856 .
Currently, this can do min, max, average, and integral.
It can be restricted to "group" or "groupset". Restriction to logical volume is possible, but not for materials (I will be adding that).

User can do these things now:

    # integral
    pps_int = VolumePostprocessor(problem=phys, value_type="integral")
    pps_int.Initialize()
    pps_int.Execute()
    vals = pps_int.GetValue()
    print(vals)

    #
    pps_min = VolumePostprocessor(problem=phys, value_type="min")
    pps_min.Initialize()
    pps_min.Execute()
    vals = pps_min.GetValue()
    print(vals)

    #
    pps_max = VolumePostprocessor(problem=phys, value_type="max")
    pps_max.Initialize()
    pps_max.Execute()
    vals = pps_max.GetValue()
    print(vals)

    #
    vol0 = RPPLogicalVolume(infx=True, infy=True, zmin=0.2, zmax=1.6)
    pps_avg = VolumePostprocessor(problem=phys, value_type="avg", logical_volume=vol0, group=0)
    pps_avg.Initialize()
    pps_avg.Execute()
    vals = pps_avg.GetValue()
    print(vals)

NOTE: ignore all the duplicated code, I needed something quick that I can test.

I will be creating tests for the current capability - I tried only very simple things.

@ragusa
Copy link
Contributor

ragusa commented Feb 2, 2026

quick and likely silly quesiton: why an initilaizer() function? can we execute multiple times a PP?

@andrsd
Copy link
Collaborator Author

andrsd commented Feb 4, 2026

quick and likely silly quesiton: why an initilaizer() function?

Currently the only reason is to match the API pattern in things like Solvers, some FieldFunctions. If we ever needed polymorphism, it is where it would need to go. But, maybe I can just make it protected and call it from the ctor for right now..

can we execute multiple times a PP?

Yes. However, I do not have any API that would change the class so that Execute would give a different answer ATM. Do you think that would be needed (e.g. in transient runs)? Or should there be just Compute() that would compute the value and would return it back (i.e. Execute + GetValue would become a single API)?

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants