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

Paraview Plot classes similar to Sensor class #117

Open
srosenbu opened this issue Jun 7, 2023 · 2 comments
Open

Paraview Plot classes similar to Sensor class #117

srosenbu opened this issue Jun 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@srosenbu
Copy link
Member

srosenbu commented Jun 7, 2023

Currently, plotting is left to the developer of the Material Problems, whereas, for Sensors, the user can decide which fields they want to save. Most of paraview plots have a very similar structure (either direct storage of some component of problem.fields or projection of sth, in problem.q_fields), therefore i would suggest to introduce sth. like

class Plot(ABC):
    @abstractmethod
    def write(self):
        pass

class DisplacementPlot(Plot):
    def __init__(self, name):
        ....

    def write(self, problem):
        with df.io.XDMFFile(problem.experiment.mesh.comm, problem.pv_file, "a"):
             ....
@srosenbu srosenbu added the enhancement New feature or request label Jun 7, 2023
@eriktamsen
Copy link
Member

I am not sure how you would use this.
I would rather suggest to directly combine sensors and paraview output.
A "DisplacementPlot" is nothing then a "full field displacement sensor".
Basically only write to paraview, what has been captured by a sensor.
This would also make adopting VMAP later on simple, as this is the idea there. Longterm, we want to use VMAP as the output format and then generate paraview outputs based on that.

@srosenbu
Copy link
Member Author

srosenbu commented Jun 9, 2023

Do you mean that a sensor should get a method to write the full field to paraview and the normal sensor output is still included? Or do you mean that also the PointSensor output should be somehow written to paraview and the full plot is just a special case of that?

@srosenbu srosenbu added this to the Hackathon 2024 milestone Apr 26, 2024
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

No branches or pull requests

2 participants