Skip to content

Add Parasolid model support#80

Open
usmanriaz07 wants to merge 16 commits into
masterfrom
parasolidModelSupport
Open

Add Parasolid model support#80
usmanriaz07 wants to merge 16 commits into
masterfrom
parasolidModelSupport

Conversation

@usmanriaz07
Copy link
Copy Markdown
Collaborator

@usmanriaz07 usmanriaz07 commented Feb 18, 2026

This PR:

  • adds Parasolid geometric model support to M3DC1.
    • this is done by enabling PUMI model .dmg support in M3DC1.
    • see section 3.5 in the M3DC1 document to convert Parasolid geometry into PUMI model .dmg and mesh .smb.
    • to load the updated model, just define the name of model file using the parameter mesh_model which is the same parameter that is used for regular .txt model.
    • an additional file containing some of the model information is defined using model_info. This will be generated by the routine that prepares PUMI model and mesh from Simmetrix model and mesh.
    • Example:
      mesh_filename = 'STAR.smb'
      mesh_model = 'STAR.dmg'
      model_info = 'STAR_modelInfo.txt'  
    
  • To compile M3DC1, update SCOREC_DIR in stellar.mk (only available on Stellar for testing). Replace the following block:
ifdef SCORECVER
  SCOREC_DIR=$(SCOREC_BASE_DIR)/$(SCORECVER)
else
  SCOREC_DIR=$(SCOREC_BASE_DIR)
endif

with

/projects/M3DC1/SCOREC/install/m3dc1_scorec/2026-05-22

Try to look for the latest version of m3dc1_scorec in /projects/M3DC1/SCOREC/install/m3dc1_scorec/ and use it. They are organized in terms of dates.

To make sure the code is not breaking for older m3dc1_scorec installs, a flag CAD is added. If CAD=1 at compilation time, the m3dc1 install needs the latest version of the m3dc1_scorec. Otherwise, any version of m3dc1_scorec is compatible. For example, to compile m3dc1_2d with this option:

make OPT=1 RL=1 CAD=1 MAX_PTS=25 ARCH=stellar

Example STAR Test case (just model and mesh files) is provided in:
/projects/M3DC1/SCOREC/examples/2026_02_18_UpdatedModel_STAR

@usmanriaz07 usmanriaz07 force-pushed the parasolidModelSupport branch from 75b26c1 to 89b871e Compare February 27, 2026 13:51
@usmanriaz07 usmanriaz07 force-pushed the parasolidModelSupport branch from 8011dfe to ab549c4 Compare May 6, 2026 23:48
@jacobmerson
Copy link
Copy Markdown
Collaborator

@usmanriaz07 is this PR ready to merge? If so you should remove the draft status. If it is not ready, please clarify what work is remaining.

@usmanriaz07 usmanriaz07 marked this pull request as ready for review May 13, 2026 14:59
@usmanriaz07 usmanriaz07 requested a review from nferraro May 13, 2026 15:00
@usmanriaz07 usmanriaz07 force-pushed the parasolidModelSupport branch from ea221d6 to 1cf7cda Compare May 18, 2026 17:12
usmanriaz07 and others added 14 commits May 18, 2026 13:57
the model. The remaining model based operations need to be modified yet
for compatibility.
model can only holf adjacency information. Some geometric information is
added to model_info file. Reading the data and storing it to model class.
… loop

has been added. It supports two model types (0 = innermost, 1 = outermost).
More options can be added in future if needed.
…d m3dc1_mfmgen, 2 for .dmg models from sim_meshgen) has been added
…m3dc1_model_getgeometricloop()` for consistency.

Also, support to other model types (.txt files) has been added to `m3dc1_model_getgeometricloop()`.
…w it's the boundary type (first wall, domain boundary, or other)
…of edges

Added bounds check on assigning boundary type to edges when using dmg model
@usmanriaz07 usmanriaz07 force-pushed the parasolidModelSupport branch from 1cf7cda to 1984926 Compare May 18, 2026 17:57
@usmanriaz07 usmanriaz07 requested a review from jchensw May 22, 2026 13:43
@usmanriaz07
Copy link
Copy Markdown
Collaborator Author

@nferraro @jchensw I have added a flag CAD for compiling latest changes in code. If its not used, m3dc1 should compile with older versions of m3dc1_scorec. Can you please have a look at the changes, and if they look good we can merge the changes to master.

@jchensw
Copy link
Copy Markdown
Collaborator

jchensw commented May 22, 2026

I just tested on Perlmutter GPU nodes. All regtests passed except adapt.
The adapt case failed with a segmentation fault, while the adapt built from master branch works fine.

@usmanriaz07
Copy link
Copy Markdown
Collaborator Author

Thanks Jin. I have never installed m3dc1_scorec on Perlmutter before, if you can share the instructions with me I can debug the issue myself. Or if possible can you please provide me more details of the failed test? Execution report before segmentation fault might help.

@jchensw
Copy link
Copy Markdown
Collaborator

jchensw commented May 22, 2026

Sure. First set up environment using

cd Your-M3DC1-HOME
export M3DC1_CODE_DIR=pwd
module use $M3DC1_CODE_DIR/unstructured/modules/perlmutter
module load m3dc1/devel-gpu-gcc

Then go to "m3dc1_scorec" directory, and configure it with

PETSC_DIR=/global/cfs/cdirs/mp288/jinchen/PETSC/production/petsc.20230606
PETSC_ARCH=perlmuttergpu-gnu-860
PARMETIS_DIR=$PETSC_DIR/$PETSC_ARCH
ZOLTAN_DIR=$PETSC_DIR/$PETSC_ARCH
SCOREC_DIR=/global/cfs/cdirs/mp288/jinchen/PETSC/production/core-240527/upgrade-gnu860-pgpu
PREFIX=$SCOREC_DIR

cmake ..
-DCMAKE_C_COMPILER=cc
-DCMAKE_CXX_COMPILER=CC
-DCMAKE_Fortran_COMPILER=ftn
-DCMAKE_C_FLAGS=" -g -fPIC -O0 -DPETSCMASTER -I$PETSC_DIR/include"
-DCMAKE_CXX_FLAGS=" -g -fPIC -O0 -DPETSCMASTER -I$PETSC_DIR/include"
-DCMAKE_Fortran_FLAGS="-fPIC "
-DENABLE_ZOLTAN=ON
-DZOLTAN_INCLUDE_DIR="$ZOLTAN_DIR/include"
-DZOLTAN_LIBRARY="$ZOLTAN_DIR/lib/libzoltan.a"
-DPARMETIS_INCLUDE_DIR="$PARMETIS_DIR/include"
-DPARMETIS_LIBRARY="$PARMETIS_DIR/lib/libparmetis.a"
-DMETIS_INCLUDE_DIR="$PARMETIS_DIR/include"
-DMETIS_LIBRARY="$PARMETIS_DIR/lib/libmetis.a"
-DENABLE_PETSC=ON
-DPETSC_INCLUDE_DIR="$PETSC_DIR/$PETSC_ARCH/include"
-DPETSC_LIB_DIR="$PETSC_DIR/$PETSC_ARCH/lib"
-DSCOREC_INCLUDE_DIR="$SCOREC_DIR/include"
-DSCOREC_LIB_DIR="$SCOREC_DIR/lib"
-DENABLE_TESTING=OFF
-DENABLE_COMPLEX=OFF
-DCMAKE_INSTALL_PREFIX="$PREFIX"
-DCMAKE_BUILD_TYPE=$CMAKETYPE
-DSCOREC_CXX_WARNINGS=OFF
-DSCOREC_CXX_OPTIMIZE=OFF
-DBUILD_EXES=ON \

followed by "make install". then go to "unstructured" dir, build m3dc1 with "make all ARCH=perlmutter_gpu_gcc".

@usmanriaz07
Copy link
Copy Markdown
Collaborator Author

@jchensw Thanks for the instruction. I don't have access to some of the directories so couldn't install m3dc1_scorec. I tried accessing the following directory but had no permission:
/global/cfs/cdirs/mp288/jinchen/PETSC/production/core-240527/upgrade-gnu860-pgpu/

I am not a part of group mp288, so my guess is I will need to be a part of this group to get access.

@jchensw
Copy link
Copy Markdown
Collaborator

jchensw commented May 22, 2026

permission is granted. pease try agian.

@usmanriaz07
Copy link
Copy Markdown
Collaborator Author

Thanks Jin. I just compiled m3dc1_scorec and m3dc1 targets. And now running test cases. I will update here once I find out what's going wrong with the adapt test case.

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