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

Example #22

Merged
merged 4 commits into from
Sep 3, 2020
Merged

Example #22

merged 4 commits into from
Sep 3, 2020

Conversation

MartinKliemank
Copy link
Contributor

Added an example folder and an example file which simulates TGV3D and uses several reporters and does some plotting ect. to demonstrate general usage of lettuce, with hopefully enough comments for easy understanding

@dominikwilde your suggestions sadly didn't reach my branch for some reason, I tried to include what i had noted / remembered, please remind me if stuff is missing

@Olllom
Copy link
Collaborator

Olllom commented Jun 12, 2020

Good initiative, thanks!
Why don't you add the example as a jupyter notebook?
They are perfectly suited for what you are doing here and github renders them nicely.

We could then also include them in the docs. (Either directly through a Sphinx add-on or via a link)

@dominikwilde
Copy link
Contributor

The idea of adding a jupyter notebook is nice and helpful.

I realized that my suggestions went into a separate branch "patch-1", for which I missed to create a pull request. But I think most of my remarks are in the code.

@Olllom
Copy link
Collaborator

Olllom commented Jun 30, 2020

The idea of adding a jupyter notebook is nice and helpful.

Any updates on this?

@MartinKliemank
Copy link
Contributor Author

I'm sorry, I spoke to Dominik about it in person but didn't update you here. We do like the idea and also thought it would be good to also add an example which goes a bit more into detail about the inner workings.
Sadly I'm currently preparing for exams, also the primary objective of my Masterprojekt (masters project I guess?) is to continue Dominik's enstrophy comparison of the flow around a 2D and 3D building/object, so I put work on the example aside for now.

@Olllom Olllom mentioned this pull request Jun 30, 2020
@Olllom
Copy link
Collaborator

Olllom commented Jun 30, 2020

Alright. Thanks for the update. I will assume that the example is correct and merge it for now.

lettuce/io.py Outdated
self.point_dict["p"] = self.lattice.convert_to_numpy(p[0, ..., None])
for d in range(self.lattice.D):
self.point_dict[f"u{'xyz'[d]}"] = self.lattice.convert_to_numpy(u[d, ..., None])
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait ... is this the correct behavior for 1D and 3D?

lettuce/io.py Outdated
else:
self.point_dict["p"] = self.lattice.convert_to_numpy(p[0, ...])
for d in range(self.lattice.D):
self.point_dict[f"u{'xyz'[d]}"] = self.lattice.convert_to_numpy(u[d, ...])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me: Why do we need 2 separate cases here? Does pyevtk require a different shape for 2D and 3D?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does. See #14

@dominikwilde
Copy link
Contributor

@Olllom
I think the VTK issue is solved and already in the master branch.

I retested the example file and it works. From my point of view it can be merged.

@Olllom Olllom merged commit 2e54fa5 into lettucecfd:master Sep 3, 2020
@MartinKliemank MartinKliemank deleted the example branch September 23, 2020 10:21
McBs added a commit to McBs/lettuce that referenced this pull request Jul 12, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants