Skip to content

Epicure optimizations for mesh read-in#22

Merged
amrueda merged 16 commits intodevelopfrom
epicure_preprocess
Nov 7, 2025
Merged

Epicure optimizations for mesh read-in#22
amrueda merged 16 commits intodevelopfrom
epicure_preprocess

Conversation

@amrueda
Copy link
Collaborator

@amrueda amrueda commented Nov 5, 2025

This PR adds a serial and parallel uniform-flow test for HOPR HDF5 meshes and incorporates the Epicure BSC optimizations for mesh read-in (all Epicure BSC optimizations have been added in #8). Some fixes were required to allow the mesh read-in optimizations to compile with support for HDF5 meshes.

@amrueda amrueda changed the base branch from develop to main November 5, 2025 11:43
@loganoz loganoz requested a review from Copilot November 5, 2025 13:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new NavierStokes UniformFlow test case to verify that the solver correctly maintains a uniform flow field. The test is designed to validate that a constant flow state remains unchanged throughout the simulation.

  • Adds a new NavierStokes test case for uniform flow validation with HDF5 mesh support
  • Updates CI workflows to enable testing on both main and develop branches
  • Integrates the UniformFlow test into parallel and serial CI pipelines with HDF5 support

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Solver/test/NavierStokes/UniformFlow/UniformFlow_HDF5.control New control file defining test parameters for uniform flow case with HDF5 mesh
Solver/test/NavierStokes/UniformFlow/SETUP/ProblemFile.f90 Complete test implementation including initial conditions, boundary conditions, and validation logic
Solver/configure Registers the new UniformFlow test case in the build configuration
.github/workflows/CI_serial_MU.yml Enables CI triggers for the develop branch
.github/workflows/CI_parallel_NS.yml Adds UniformFlow test to parallel NS CI pipeline with HDF5 support and standardizes build flags across tests
.github/workflows/CI_parallel_MU.yml Enables CI triggers for the develop branch

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

amrueda and others added 2 commits November 5, 2025 15:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@amrueda amrueda marked this pull request as draft November 6, 2025 16:45
…HOPR hdf5 meshes

Co-authored-by: zalbanob <171132623+zalbanob@users.noreply.github.com>
Co-authored-by: Gonzalo Rubio <g.rubio@upm.es>
@amrueda amrueda changed the title WIP: Epicure optimizations for pre-processing WIP: Epicure optimizations for HOPR HDF5 meshes Nov 6, 2025
@amrueda amrueda changed the title WIP: Epicure optimizations for HOPR HDF5 meshes WIP: Epicure optimizations for mesh read-in Nov 6, 2025
@amrueda amrueda changed the title WIP: Epicure optimizations for mesh read-in Epicure optimizations for mesh read-in Nov 6, 2025
@amrueda amrueda marked this pull request as ready for review November 6, 2025 17:28
@loganoz loganoz requested a review from Copilot November 7, 2025 06:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +118 to +120
u = qq*cos(theta)*COS(phi)
v = qq*sin(theta)*COS(phi)
w = qq*SIN(phi)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Inconsistent case usage for trigonometric functions. Within the same expressions, cos/sin are used in lowercase while COS/SIN are used in uppercase. While Fortran is case-insensitive, consistent casing improves readability. Consider using either all lowercase (cos, sin) or all uppercase (COS, SIN) throughout.

Suggested change
u = qq*cos(theta)*COS(phi)
v = qq*sin(theta)*COS(phi)
w = qq*SIN(phi)
u = qq*cos(theta)*cos(phi)
v = qq*sin(theta)*cos(phi)
w = qq*sin(phi)

Copilot uses AI. Check for mistakes.
Comment on lines +340 to +342
u = qq*cos(theta)*COS(phi)
v = qq*sin(theta)*COS(phi)
w = qq*SIN(phi)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Inconsistent case usage for trigonometric functions. Within the same expressions, cos/sin are used in lowercase while COS/SIN are used in uppercase. While Fortran is case-insensitive, consistent casing improves readability. Consider using either all lowercase (cos, sin) or all uppercase (COS, SIN) throughout.

Suggested change
u = qq*cos(theta)*COS(phi)
v = qq*sin(theta)*COS(phi)
w = qq*SIN(phi)
u = qq*cos(theta)*cos(phi)
v = qq*sin(theta)*cos(phi)
w = qq*sin(phi)

Copilot uses AI. Check for mistakes.
Comment on lines +105 to +107
integer :: nvertex, i, j, k, ipoint, jpoint
integer :: idomain, npoints, ielem
logical :: isnewpoint, meshIsHOPR
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The variables ipoint and isnewpoint are declared but never used in the refactored code. They should be removed to avoid compiler warnings about unused variables.

Suggested change
integer :: nvertex, i, j, k, ipoint, jpoint
integer :: idomain, npoints, ielem
logical :: isnewpoint, meshIsHOPR
integer :: nvertex, i, j, k, jpoint
integer :: idomain, npoints, ielem
logical :: meshIsHOPR

Copilot uses AI. Check for mistakes.
integer , intent(in) :: HOPRGlobalID
integer , intent(out) :: nodeID ! Node ID in HORSES3D!
!--------------------------------------------
integer :: i ! Counter
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The variable i is declared but never used in the refactored code. The old loop that used this variable has been replaced with a direct lookup. This unused variable declaration should be removed.

Suggested change
integer :: i ! Counter

Copilot uses AI. Check for mistakes.
!
! The procedures, *even if empty* that must be defined are
!
! UserDefinedSetUp
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The comment lists "UserDefinedSetUp" as a required procedure, but the actual subroutine implemented is "UserDefinedStartup" (line 20). The comment should be corrected to match the implementation.

Suggested change
! UserDefinedSetUp
! UserDefinedStartup

Copilot uses AI. Check for mistakes.
QExpected(:,i,j,k) = Q
end do; end do; end do
end associate
maxError = MAXVAL(ABS(QExpected - mesh % elements(eID) % storage % Q))
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The maxError calculation appears to have a logic issue. The QExpected array is populated inside the element loop (lines 334-353), and then maxError is computed for each element individually (line 354). However, maxError is not accumulated across elements - it's simply overwritten for each element. This means only the error from the last element is retained. Consider either: 1) moving the maxError calculation outside the loop and comparing all elements at once, or 2) using maxError = MAX(maxError, MAXVAL(ABS(QExpected - mesh % elements(eID) % storage % Q))) to accumulate the maximum across all elements.

Suggested change
maxError = MAXVAL(ABS(QExpected - mesh % elements(eID) % storage % Q))
maxError = MAX(maxError, MAXVAL(ABS(QExpected - mesh % elements(eID) % storage % Q)))

Copilot uses AI. Check for mistakes.
Copy link
Owner

@loganoz loganoz left a comment

Choose a reason for hiding this comment

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

I reviewed the changes on the workflows and test cases and they look fine to me. About the changes in the HOPR reader and Mesh partitioning, are these only epicure cherry picked by you right? I understand if they pass the test case you added they should be fine. Not sure about the efficiency, that we might need to check.

Can you write down somewhere what is already implemented from their PR and what's missing? We will forget if we don't do it now.

@loganoz loganoz changed the base branch from main to develop November 7, 2025 13:53
@amrueda amrueda merged commit 1ffed4c into develop Nov 7, 2025
9 checks passed
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.

3 participants