Skip to content

Suggestion for Redesign 1 #158

@srosenbu

Description

@srosenbu

After our discussion, I thought again about what I like about this repo:

  1. I can treat a Simulation as a black-box that just gets parameters and returns sensor-data and plots
  2. Input can probably be serialized into JSON files because all inputs are dicts of ureg.Quantity
  3. Units are checked
  4. I can reuse parts of the code through a seperation of geometry-description and the actual FEM description
  5. Adding any sensor you want to the simulation is nice
  6. Reduction of boilerplate FEniCS code, like for the definition of BCs.

What I don't like:

  1. The classes, as they are designed don't allow me to describe a dynamic simulation and probably a lot of other problems (not flexible enough)
  2. It is unclear what data and methods a class has. For example, experiments sometimes have a boundary condition for temperature, but I don't know that in advance. The "simple cube" currently contains all the bcs to work with all finite element problems in order to be an actual reusable piece of code.
  3. The classes are normal Python classes and class properties can just be added dynamicylly in the __init__. This is i.m.o. too flexiblebe because it encourages to "hack your way around the limitations of the design" but then your hack becomes unusable to others. There is of course no perfect design, but I would be more in favor of updating the interfaces from time to time to allow new features which then all new problems must adhere to.
  4. Plots are defined by the finite-element problem and cannot be changed by the user like sensors
  5. The seperation of experiment and FEM problem is not very strict. The description of BCs currently requires knowledge about the functionspaces which should only be part of the FEM description.

What I would want (in addition to what I like):

  1. Seperation of the experiment and the geometry to improve reusability of code
  2. Describe BCs without needing to know the FEM problem
  3. Use plots as flexible as sensors
  4. A subset of all problems should be serializable as JSON files.
  5. Creation of problems from JSON files (Not possible for everything, but for a certain subset of problems, this would be helpful for the https://github.com/BAMresearch/NFDI4IngModelValidationPlatform)

I have some code suggestions on the branch https://github.com/BAMresearch/FenicsXConcrete/tree/sjard_suggestion.
It's all WIP, but I am currently tending to make the description of the experiment fully independent of FEniCS, because the FEniCS-objects might be different depending on the problem that is solved. All classes use pydantic.dataclasses in order to enforce the class variables that are being used and to enable serializability by default.

To be continued...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions