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

Added example and compilation instructions for Insitu #1661

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

adperezm
Copy link
Collaborator

@adperezm adperezm commented Jan 14, 2025

Hi,

I added a new variable to makeneko to include the ADIOS files during compilation. I’m not sure if this is the best approach. In the future we might have streaming as a simulation component, so it would be good if that file is taken into account during the linking of Neko itself (Maybe it already is). I’m happy to adjust this if needed—this is just one possible solution.

I’ve also added an example that demonstrates starting a simulation in Neko, transferring data to Python, and writing from Python. Do you think there’s a better way to name this example? I avoided integrating it directly into the lid example because requiring ADIOS to run it might be overkill.

## Simulation of a lid-driven cavity
In this case we simulate a lid-driven cavity with smoothened belt velocity to fulfil the continuity equaiton in the corners. There is a 3D example (with 3 elements in the spanwise $z$ direction) and a pseudo-2D example (with a 2D mesh that then generates a case with one element in the spanwise direction).

The `lid.box` file needs to be converted to a .re2 file using the Nek5000 tool genbox, and then using rea2nbin into the `lid.nmsh` Neko mesh file.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good! Would it be possible to use genmeshbox instead? To avoid using rea2nbin.

Would it also be possible to provide a description of what the insitu part does?

@@ -0,0 +1,4 @@
#!/usr/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be here?

@MartinKarp
Copy link
Collaborator

I think the name is fine, as long as we have some description in the readme

@@ -6,6 +6,7 @@ libdir=${exec_prefix}/lib
includedir_pkg=${prefix}/include/neko
FC=@FC@
FCFLAGS='@FCFLAGS@'
extra_files=@adios_files@
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure I understand why it doesn't work without this. The object file should already be in libneko from the main Makefile.am

neko/src/Makefile.am

Lines 482 to 510 in 18e7a84

if ENABLE_ADIOS2
#
# Fortran code related to ADIOS2 can be added directly
# to libneko_fortran_SOURCES (as above)
#
# To avoid linker issues, any C++ code related to ADIOS2
# must be added to libneko_a_LIBADD and neko_LDADD,
# with a manual build rule as illustrated below
#
#io/adios2_example.o: io/adios2_example.cpp
# $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $^
#
#libneko_a_LIBADD = \
# io/adios2_example.o
#
#neko_LDADD = \
# io/adios2_example.o
#
#
io/nek_adios2.o: io/nek_adios2.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $^
libneko_la_LIBADD = \
io/nek_adios2.o
#neko_LDADD = \
# io/nek_adios2.o
endif

Maybe the ax_adios.m4 failed to detect it? (but then it shouldn't have been built hmm

@timofeymukha
Copy link
Collaborator

Just a quick note about the name, as I currently don't have time to properly review. I would simply update the existing lid example. It does not demonstrate much new neko concepts compared to other examples in its current form, and this is an opportunity to make it unique. Kind of echoing your comment from before @MartinKarp that it is better to have a few examples, but richer.

@adperezm
Copy link
Collaborator Author

Hi, I agree with your comments. I will proceed with them.

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.

4 participants