Skip to content

Add the parallel flow routing code gallery example.#238

Merged
tjhei merged 1 commit into
dealii:masterfrom
bangerth:parallel_flow_routing
Apr 23, 2026
Merged

Add the parallel flow routing code gallery example.#238
tjhei merged 1 commit into
dealii:masterfrom
bangerth:parallel_flow_routing

Conversation

@bangerth

Copy link
Copy Markdown
Member

This goes along with a paper I'm about ready to submit. I'll link to the preprint from here once that's available. A PDF that shows how this program will look like when run through doxygen is
here.

AI statement: I wrote 100% of the code myself. Github Copilot wrote about 50% of the comments and the Readme.md, which I then heavily edited for language and correctness.

@bangerth

Copy link
Copy Markdown
Member Author

@tjhei FYI

@bangerth bangerth force-pushed the parallel_flow_routing branch from 7f45502 to 04bcf7a Compare April 2, 2026 20:16
@bangerth

Copy link
Copy Markdown
Member Author

Anyone want to take a stab at this? It would be helpful (but is necessary) for the paper I'm about to submit.

@bangerth bangerth force-pushed the parallel_flow_routing branch from 04bcf7a to 0fe664d Compare April 20, 2026 22:48
@Rombur

Rombur commented Apr 22, 2026

Copy link
Copy Markdown
Member

I'll take a look at it this week

@bangerth

Copy link
Copy Markdown
Member Author

@Rombur Thank you!

@Rombur Rombur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good. I only have a minor comment. Please fix it and merge yourself

"or set an environment variable \"DEAL_II_DIR\" that contains this path."
)
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could check at this point that trilinos or petsc was installed. You don't no need to change the code.

const unsigned int /*component*/) const
{
// First pull back p to longitude/latitude, expressed in degrees
const Point<2> p_long_lat(std::atan2(p[1], p[0]) * 360 / (2 * numbers::PI),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know it's the same but it's strange that the formulas in the documentation use 180/pi and here you use 360/(2*pi). Can you update the program so that the code and the documentation match.

@tjhei tjhei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. I only have a few minor comments.

Comment thread parallel_flow_routing/CMakeLists.txt Outdated
@@ -0,0 +1,39 @@
##
# CMake script for the step-91 tutorial program:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please update

#elif defined(DEAL_II_WITH_TRILINOS)
using namespace LinearAlgebraTrilinos;
#else
# error DEAL_II_WITH_PETSC or DEAL_II_WITH_TRILINOS required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

catch this in cmake

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, good point. I added it there. I left the #error here because that's also what we do in step-40 (from which this part was copied).

y = 0;
for (const auto &[src, dst] : my_local_flow_routing)
{
// Solve the 'from'th equation. In the notation from

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

src?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, thank you. I had originally called these variables from and to until I realized that I can't use these names in my Python code snippets because from is a keyword. So I renamed it src and dst but forgot to rename this place.

@bangerth bangerth force-pushed the parallel_flow_routing branch from 0fe664d to c5f391d Compare April 23, 2026 16:13
@bangerth

Copy link
Copy Markdown
Member Author

Fixed as requested!

@tjhei tjhei merged commit 6974768 into dealii:master Apr 23, 2026
1 of 4 checks passed

@marcfehling marcfehling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please have a look.

Comment on lines +26 to +28
find_package(deal.II 9.7.0
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Our CI fails the 9.6.0 check because of this requirement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will do as a follow-up.

@bangerth bangerth deleted the parallel_flow_routing branch April 23, 2026 18:13
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