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

ASTE with time dependent functions #176

Open
fsimonis opened this issue May 19, 2023 · 2 comments
Open

ASTE with time dependent functions #176

fsimonis opened this issue May 19, 2023 · 2 comments

Comments

@fsimonis
Copy link
Member

ASTE is a great tool to analyze the error of a single map operation.
To simulate multiple time windows, we need to generate a complete mesh for every time step. This is not only very space inefficient, but also results in a lot of unnecessary IO.

It would be a great simple tool for testing transient mappings for functions that depend on t, as well as testing mappings with a time independent function to study their runtime stability over time.

Currently we have the following data flow:

flowchart TB
    IM[Mesh] -->|"eval f(x,y,z)"| IMD
    IMD[Mesh+Data] --> |partition| IMDP
    OM[Mesh] --> |partition| OMP
    OMP[Partitioned Mesh] --> |B Mesh| ASTE
    IMDP[Partitioned Mesh+Data] --> |A Mesh| ASTE
    ASTE(ASTE)--> |map Data form A to B| MMP
    MMP[Paritioned Mesh+Data] --> MM
    MM[Mesh+Data]
Loading

We could pass the function directly to ASTE (preciceMap) and evaluate it on the input mesh using VTK.
Adding the time t as further input allows us to evaluate this for each time step/window without the need to read a completely new mesh.
Time window size and max time windows are configurable in the configuration file.

flowchart TB
    IM[Mesh] --> |partition| IMDP
    OM[Mesh] --> |partition| OMP
    OMP[Partitioned Mesh] --> BIM
    IMDP[Partitioned Mesh] -->  AIM
    F("f(x,y,z,t)") --> AF


    subgraph ASTEA [Participant A]
        direction TB
        AF(Function) --> |"apply"| AIMD
        AIM[A Mesh] -->  AIMD
        AIMD[A Mesh + Data] --> |"writeData()"| AP
        AP(preCICE)
    end

    subgraph ASTEB [Participant B]
        direction TB
        BP(preCICE) --> |"readData()"| BIMD
        BIM[B Mesh] --> BIMD[B Mesh + Data]
    end
    AP -.-> BP

    BIMD --> MMP

    MMP[Paritioned Mesh+Data] --> MM
    MM[Mesh+Data] --> MME[Mesh+Error]
    F --> |calc error| MME
Loading

Taking this one step further, using the function as input for both participants allows us to calculate the error directly in ASTE.

flowchart TB
    IM[Mesh] --> |partition| IMDP
    OM[Mesh] --> |partition| OMP
    OMP[Partitioned Mesh] --> BIM
    IMDP[Partitioned Mesh] -->  AIM
    F("f(x,y,z,t)") --> AF
    F --> BF

    MMP[Paritioned Mesh+Error] --> MM
    MM[Mesh+Error]

    subgraph ASTEA [Participant A]
        direction TB
        AF(Function) --> |"apply"| AIMD
        AIM[A Mesh] -->  AIMD
        AIMD[A Mesh + Data] --> |"writeData()"| AP
        AP(preCICE)
    end

    subgraph ASTEB [Participant B]
        direction TB
        BF(Function) --> |"|f(x,y,z,u) - d(x,y,z)|"| BE
        BP(preCICE) --> |"readData()"| BIMD
        BIM[B Mesh] --> BIMD["B Mesh + Data d"]
        BIMD --> BE
        BE[B Mesh + Error]
    end
    BE --> MMP
    AP -.-> BP
Loading
@BenjaminRodenberg
Copy link
Member

BenjaminRodenberg commented Jun 5, 2024

I discussed this topic with @davidscn to some degree because this overlaps with the fake.py script I contributed via precice/tutorials#472. I need a tool that allows me to define a general (time dependent) function; potentially with subcycling. I think having these fake solvers as parts of the tutorials is a quite nice feature. ASTE currently does not fulfill this requirement as far as I know.

With the fake.py script I don't have to provide complicated or precomputed data to define the function (replay mode?) or csv files to define the mesh. Instead, I have a purely symbolic representation in Python for

The main drawback of fake.py is that there literally exists no clear interface. It's a plain python script. I could imagine something along the following lines:

python3 fake.py ../precice-config.xml --participant=Fluid --write={"Force":"(y * sin(t),0)"} --mesh={"Fluid-Mesh": ...tricky...}

If I could do the same with ASTE (assuming installation is as simple as running a plain python script), I would be glad to replace the fake.py script with some ASTE-based workflow.

@uekerman
Copy link
Member

uekerman commented Jun 6, 2024

I think there is no need to replace the one with the other. We should simply be aware that both exist and how they differ. And carefully think before investing more time in the one or the other.

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

No branches or pull requests

3 participants