├── .editorconfig ├── .gitattributes ├── .github └── workflows │ ├── CI.yml │ ├── FORD.yml │ ├── Mirror-wiki.yml │ ├── Mirror.yml │ ├── Nightly-Mirror.yml │ ├── main.sh │ └── wiki-update.sh ├── .gitignore ├── .gitmodules ├── API-doc-FORD-file.md ├── API-doc-style.css ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── developer-doc ├── FD-API.md ├── FD-API.md.bak ├── FV-API.md ├── examples │ └── index.md ├── getting-started.md ├── index.md ├── media │ ├── Flowchart.png │ ├── GSElogo.png │ ├── Morfeus-FV-program-flow.png │ ├── README.md │ ├── fast.json │ ├── gsellcfavicons.png │ ├── sphere.png │ └── toninel_phd.pdf ├── style-guide.md └── using-ford.md ├── developer-tools ├── fix-white-space.elisp ├── macOS-env.sh ├── requirements.txt └── software-stack.ditaa └── src ├── FD ├── .gitignore ├── CMakeLists.txt ├── README.md ├── geometry │ ├── block_metadata_implementation.f90 │ ├── block_metadata_interface.F90 │ ├── cylinder_2D_implementation.F90 │ ├── cylinder_2D_interface.F90 │ ├── geometry_implementation.f90 │ ├── geometry_interface.f90 │ ├── plate_3D_implementation.F90 │ ├── plate_3D_interface.F90 │ ├── sphere_1D_implementation.F90 │ └── sphere_1D_interface.F90 ├── grid │ ├── CMakeLists.txt │ ├── cartesian_grid_implementation.f90 │ ├── cartesian_grid_interface.f90 │ ├── curvilinear_grid_interface.f90 │ ├── cylindrical_grid_implementation.f90 │ ├── cylindrical_grid_interface.f90 │ ├── differentiable_field_interface.f90 │ ├── ellipsoidal_field_implementation.f90 │ ├── ellipsoidal_field_interface.f90 │ ├── grid_implementation.f90 │ ├── grid_interface.F90 │ ├── package_implementation.F90 │ ├── package_interface.F90 │ ├── problem_discretization_implementation.F90 │ ├── problem_discretization_interface.F90 │ ├── spherical_1D_solver_module.F90 │ ├── spherical_1D_solver_submodule.F90 │ ├── spherical_grid_implementation.f90 │ ├── spherical_grid_interface.f90 │ ├── structured_grid_implementation.F90 │ ├── structured_grid_interface.F90 │ ├── surfaces_implementation.F90 │ ├── surfaces_interface.F90 │ ├── units_implementation.F90 │ └── units_interface.F90 ├── tests │ ├── CMakeLists.txt │ ├── integration │ │ ├── CMakeLists.txt │ │ ├── test-differentiate-cartesian-grid.F90 │ │ ├── test-differentiate-cylindrical-grid.F90 │ │ ├── test-differentiate-spherical-grid.F90 │ │ ├── test-discretize-2D-cylinder.F90 │ │ ├── test-discretize-3D-plate.F90 │ │ ├── test-plate-material-mapping.F90 │ │ ├── test-write-slab-vtk.F90 │ │ └── test-write-voxels-vtk.F90 │ └── unit │ │ ├── 1Dsphere.json │ │ ├── 2Dcylinder.json │ │ ├── 3Dplate-high-resolution-layers.json │ │ ├── 3Dplate-low-resolution-halo.json │ │ ├── 3Dplate-low-resolution-layers-material-map.json │ │ ├── 3Dplate-low-resolution-layers.json │ │ ├── CMakeLists.txt │ │ ├── label-corner-blocks.F90 │ │ ├── material-map.F90 │ │ ├── test-1d-sphere.f90 │ │ ├── test-adi-time-advancing.f90 │ │ ├── test-array-functions.f90 │ │ ├── test-assertions.f90 │ │ ├── test-block-structure.f90 │ │ ├── test-emulated-intrinsics.F90 │ │ ├── test-halo-exchange.f90 │ │ ├── test-problem-discretization.f90 │ │ ├── test-read-geometry.f90 │ │ ├── test-spatial-derivatives-new.f90 │ │ ├── test-spatial-derivatives.f90 │ │ ├── test-structured-grid.F90 │ │ ├── test-units.f90 │ │ └── test-write-problem-discretization.f90 └── utilities │ ├── CMakeLists.txt │ ├── array_functions_implementation.f90 │ ├── array_functions_interface.f90 │ ├── assertions_implementation.F90 │ ├── assertions_interface.F90 │ ├── co_object_implementation.f90 │ ├── co_object_interface.f90 │ ├── emulated_intrinsics_implementation.F90 │ ├── emulated_intrinsics_interface.F90 │ ├── kind_parameters.f90 │ ├── object_implementation.f90 │ ├── object_interface.f90 │ ├── string_functions_implementation.f90 │ └── string_functions_interface.f90 └── FV ├── CMakeLists.txt ├── README.outdated ├── cmake ├── FindModules │ ├── FindCGNS.cmake │ ├── FindMETIS.cmake │ ├── FindNETCDF.cmake │ └── FindPSBLAS.cmake ├── modules │ └── AddParallelTest.cmake └── uninstall.cmake.in ├── docs ├── install.pdf ├── mesh_motion.pdf ├── pdf │ ├── Bib │ │ ├── acmtrans.bst │ │ ├── asmems4.bst │ │ └── nemo_doc.bib │ ├── Fig │ │ ├── projection.fig │ │ └── surfaces.fig │ ├── GNU │ │ └── qplot.gnu │ ├── Gambit │ │ ├── curved_surface.dbs │ │ ├── curved_surface.jou │ │ └── curved_surface.trn │ ├── Images │ │ ├── curved_surface.eps │ │ ├── min_max_cropped.eps │ │ ├── projection.eps │ │ ├── qplot.eps │ │ ├── submesh.eps │ │ └── surfaces.eps │ ├── JPG │ │ ├── Fig │ │ │ ├── projection.fig │ │ │ └── surfaces.fig │ │ ├── Images │ │ │ ├── curved_surface.eps │ │ │ ├── min_max_cropped.eps │ │ │ ├── projection.eps │ │ │ ├── qplot.eps │ │ │ ├── submesh.eps │ │ │ └── surfaces.eps │ │ └── surfaces.jpg │ ├── Odg │ │ ├── curved_surface.odg │ │ ├── min_max.odg │ │ └── submesh.odg │ ├── install.tex │ └── mesh_motion.tex └── uml │ └── nemo.uml ├── nemo-ab-notes.txt ├── prerequisites-versions └── src ├── basics ├── class_connectivity.f90 ├── class_connectivity_procedures.f90 ├── class_dimensions.f90 ├── class_dimensions_procedures.f90 ├── class_keytable.f90 ├── class_keytable_procedures.f90 ├── class_psblas.f90 ├── class_psblas_procedures.f90 ├── class_stopwatch.f90 ├── class_stopwatch_procedures.f90 ├── class_vector.f90 ├── class_vector_procedures.f90 ├── tools_psblas.f90 ├── tools_psblas_procedures.f90 ├── type_table.f90 └── type_table_procedures.f90 ├── bc ├── class_bc.f90 ├── class_bc_math.f90 ├── class_bc_math_procedures.f90 ├── class_bc_procedures.f90 ├── class_bc_wall.f90 ├── class_bc_wall_procedures.f90 ├── rd_inp_bc.f90 ├── rd_inp_bc_math.f90 └── tools_bc.f90 ├── field ├── class_discretization.f90 ├── class_discretization_procedures.f90 ├── class_field.f90 ├── class_field_procedures.f90 ├── class_scalar_field.f90 ├── class_scalar_field_procedures.f90 ├── class_vector_field.f90 └── class_vector_field_procedures.f90 ├── input ├── find_section.f90 ├── get_par_d.f90 ├── get_par_h.f90 ├── get_par_i.f90 ├── get_par_l.f90 ├── get_par_v.f90 ├── open_file.F90 ├── read_par_d.f90 ├── read_par_h.f90 ├── read_par_i.f90 ├── read_par_l.f90 ├── read_par_v.f90 └── tools_input.f90 ├── material ├── class_material.f90 ├── class_material_procedures.f90 ├── load_material.f90 ├── mat_copper.f90 ├── mat_copper_procedures.f90 ├── mat_water.f90 ├── mat_water_procedures.f90 ├── rd_inp_material.f90 └── tools_material.f90 ├── math ├── cart_to_polar_implementation.f90 ├── cholesky_implementation.f90 ├── class_iterating.f90 ├── class_iterating_procedures.f90 ├── isort_implementation.f90 ├── lin_interp_implementation.f90 ├── lu_implementation.F90 ├── psb_build_prec.f90 ├── psb_solve_sys_implementation.f90 ├── pwl_implementation.f90 └── tools_math.f90 ├── mesh ├── class_mesh.F90 ├── class_mesh_procedures.F90 ├── cmp_mesh_desc.f90 ├── cmp_mesh_implementation.f90 ├── part_block.f90 ├── part_block_procedures.f90 ├── part_graph.f90 ├── part_graph_procedures.f90 ├── part_random.f90 ├── part_random_procedures.f90 ├── rd_cgns_mesh.F90 ├── rd_exodus_mesh.f90 ├── rd_gambit_implementation.f90 ├── rd_gmsh_implementation.f90 ├── rd_inp_mesh_implementation.f90 ├── renum.F90 ├── renum_gps.f90 ├── renum_procedures.F90 ├── supplement_implementation.f90 ├── tools_mesh.f90 ├── tools_part.f90 └── tools_part_procedures.f90 ├── mesh_basics ├── class_cell.F90 ├── class_cell_procedures.F90 ├── class_cylinder.f90 ├── class_cylinder_procedures.f90 ├── class_face.F90 ├── class_face_procedures.F90 ├── class_least_squares.f90 ├── class_least_squares_procedures.f90 ├── class_plane.f90 ├── class_plane_procedures.f90 ├── class_surface.f90 ├── class_surface_procedures.f90 ├── class_vertex.f90 ├── class_vertex_procedures.f90 ├── geom_cell.f90 ├── geom_diff.f90 ├── geom_face.f90 ├── geom_hex_dihedral_angle.f90 ├── geom_hex_quality.f90 ├── geom_tet_center.f90 ├── geom_tet_dihedral_angle.f90 ├── geom_tet_quality.f90 ├── geom_tet_volume.f90 └── tools_mesh_basics.f90 ├── mesh_check ├── check_mesh_quality.f90 ├── check_tet_quality.f90 ├── check_vertex_quality.f90 └── tools_mesh_check.f90 ├── mesh_move ├── class_motion.f90 ├── class_motion_procedures.f90 ├── rd_inp_motion_law.f90 └── tools_mesh_move.f90 ├── mesh_optimize ├── OptMS │ ├── OptMS.h │ ├── README │ ├── SMactive.c │ ├── SMdata_structs.h │ ├── SMdefs.h │ ├── SMderiv.h │ ├── SMdihed_func.h │ ├── SMequil.c │ ├── SMerror.c │ ├── SMerror.h │ ├── SMfree.c │ ├── SMfunc2d.c │ ├── SMfunc3d.c │ ├── SMfunction.c │ ├── SMgrad3d.c │ ├── SMinit.c │ ├── SMinternalFunction.h │ ├── SMintrinsic.c │ ├── SMintrinsic.h │ ├── SMlaplace.c │ ├── SMlog.h │ ├── SMlog_reg.c │ ├── SMmatrix.c │ ├── SMoptimize.c │ ├── SMorient.c │ ├── SMqual_func.h │ ├── SMsearch.c │ ├── SMsmooth.c │ ├── SMsmooth.h │ ├── SMstats.c │ ├── SMuntangle.c │ ├── SMuserDefs.h │ ├── SMuserFunc.c │ ├── SMvalid.c │ ├── SMwritesmooth.c │ └── wininclude │ │ └── unistd.h ├── call_smooth.c ├── call_smooth2d.c ├── call_smooth2d.h ├── check_right_handed.f90 ├── freeoptms.c ├── freeoptms2d.c ├── initoptms.c ├── initoptms2d.c ├── laplacian_smooth.f90 ├── mobile_verts.f90 ├── right_handed.c ├── right_handed2d.c ├── smooth_interior_vtx.f90 ├── smooth_mesh.f90 ├── smooth_surf_vtx.f90 ├── tools_mesh_optimize.f90 └── valid_tet.f90 ├── modules └── tools_nemo.f90 ├── operators ├── flux_pde_div.f90 ├── op_d2dt2.f90 ├── op_d2dt2_procedures.f90 ├── op_ddt.f90 ├── op_ddt_procedures.f90 ├── op_div.f90 ├── op_field.f90 ├── op_grad.f90 ├── op_laplacian.f90 ├── op_laplacian_procedures.f90 ├── op_source.f90 ├── rhie_chow.f90 ├── scalar_field_grad.f90 ├── scalar_fld_vector_mul.f90 ├── scalar_pde_d2dt2.f90 ├── scalar_pde_ddt.f90 ├── scalar_pde_div.f90 ├── scalar_pde_laplacian.f90 ├── scalar_pde_source.f90 ├── scalar_vector_fld_mul.f90 ├── tools_operators.f90 ├── tools_operators_procedures.f90 ├── vector_field_flux.f90 ├── vector_field_grad.f90 ├── vector_pde_d2dt2.f90 ├── vector_pde_ddt.f90 ├── vector_pde_div.f90 ├── vector_pde_grad.f90 ├── vector_pde_laplacian.f90 └── vector_pde_source.f90 ├── output ├── class_exodus.f90 ├── class_exodus_procedures.f90 ├── class_output.f90 ├── class_output_procedures.F90 ├── class_vtk_output.f90 ├── class_vtk_output_procedures.f90 ├── htoi.f90 ├── itoh.f90 ├── tools_output.f90 ├── tools_output_basics.f90 ├── wr_mtx_matrix.f90 ├── wr_mtx_pattern.f90 ├── wr_mtx_vector.f90 ├── write_mesh.f90 ├── write_scalar_field.f90 └── write_vector_field.f90 ├── pde ├── class_pde.f90 ├── class_pde_procedures.f90 ├── class_scalar_pde.f90 ├── class_scalar_pde_procedures.f90 ├── class_scalar_source.f90 ├── class_scalar_source_procedures.f90 ├── class_vector_pde.f90 └── class_vector_pde_procedures.f90 └── unit-tests ├── CMakeLists.txt ├── fv-test-class_dimensions.f90 ├── fv-test-class_keytable.f90 ├── fv-test-class_stopwatch.f90 ├── fv-test-class_vector.f90 ├── fv-test-field-extends-grid.f90 └── test-rd_gambit_mesh.f90 /.editorconfig: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | 8 | 9 | # EditorConfig file. For more info, please see: 10 | # https://EditorConfig.org 11 | 12 | # top-most EditorConfig file 13 | root = true 14 | 15 | # All files should have a final newline and not have trailing whitespace 16 | # but we need to explicitly enumerate files we care about to prevent random junk 17 | # from being linted 18 | 19 | [*.{f90,F90}] 20 | indent_style = space 21 | indent_size = 2 22 | trim_trailing_whitespace = true 23 | max_line_length = 132 24 | insert_final_newline = true 25 | 26 | # There's some very old C code 27 | # [*.{c,h}] 28 | # indent_style = space 29 | # indent_size = 4 30 | # trim_trailing_whitespace = true 31 | # insert_final_newline = true 32 | 33 | [Dockerfile] 34 | indent_style = tab 35 | indent_size = 4 36 | trim_trailing_whitespace = true 37 | max_line_length = 80 38 | insert_final_newline = true 39 | 40 | [{CMakeLists.txt, *.cmake}] 41 | indent_style = space 42 | indent_size = 2 43 | trim_trailing_whitespace = true 44 | max_line_length = 132 45 | insert_final_newline = true 46 | 47 | [{package.json,package-lock.json}] 48 | max_line_length = off 49 | insert_final_newline = true 50 | 51 | [*.md] 52 | max_line_length = off 53 | trim_trailing_whitespace = false 54 | charset = utf-8 55 | insert_final_newline = true 56 | 57 | [*.sln,*.vcproj}] 58 | max_line_length = off 59 | trim_trailing_whitespace = off 60 | end_of_line = crlf 61 | 62 | [*.bat] 63 | indent_style = space 64 | indent_size = 4 65 | trim_trailing_whitespace = true 66 | max_line_length = 132 67 | end_of_line = crlf 68 | insert_final_newline = true 69 | 70 | # Matches multiple files with brace expansion notation 71 | # Set default charset 72 | [*.{js,py}] 73 | indent_style = space 74 | indent_size = 4 75 | trim_trailing_whitespace = true 76 | max_line_length = 132 77 | charset = utf-8 78 | insert_final_newline = true 79 | 80 | # Tab indentation (no size specified) 81 | [Makefile] 82 | indent_style = tab 83 | indent_size = 4 84 | trim_trailing_whitespace = true 85 | max_line_length = 132 86 | insert_final_newline = true 87 | 88 | [*.sh] 89 | indent_style = space 90 | indent_size = 2 91 | trim_trailing_whitespace = true 92 | max_line_length = 132 93 | insert_final_newline = true 94 | 95 | [*.nml] 96 | trim_trailing_whitespace = true 97 | max_line_length = 132 98 | insert_final_newline = true 99 | 100 | [*.{el,elisp}] 101 | indent_style = space 102 | indent_size = 2 103 | trim_trailing_whitespace = true 104 | max_line_length = 132 105 | insert_final_newline = true 106 | 107 | [main.workflow] 108 | indent_style = space 109 | indent_size = 2 110 | trim_trailing_whitespace = true 111 | max_line_length = 132 112 | insert_final_newline = true 113 | 114 | [*.{yml,json}] 115 | indent_style = space 116 | indent_size = 2 117 | trim_trailing_whitespace = true 118 | insert_final_newline = true 119 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | *.vcproj text eol=crlf 4 | *.bat text eol=crlf 5 | vendor/cmake-*/** -text 6 | **/*.pdf -text 7 | **/*.PDF -text 8 | *.pdf binary 9 | *.PDF binary 10 | 11 | # Custom for Visual Studio 12 | *.cs diff=csharp 13 | 14 | # Standard to msysgit 15 | *.doc diff=astextplain 16 | *.DOC diff=astextplain 17 | *.docx diff=astextplain 18 | *.DOCX diff=astextplain 19 | *.dot diff=astextplain 20 | *.DOT diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.github/workflows/Mirror-wiki.yml: -------------------------------------------------------------------------------- 1 | on: gollum 2 | name: Wiki-update 3 | jobs: 4 | mirrorWiki: 5 | name: Mirror wiki 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@master 9 | - name: Mirror wiki 10 | uses: docker://buildpack-deps:testing-scm 11 | env: 12 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 13 | IBB_PWLESS_DEPLOY_KEY: ${{ secrets.IBB_PWLESS_DEPLOY_KEY }} 14 | MIRROR_WIKI: ${{ secrets.MIRROR_URL }}.wiki.git 15 | SOURCE_WIKI: git@github.com:sourceryinstitute/MORFEUS-Source.wiki.git 16 | with: 17 | entrypoint: .github/workflows/wiki-update.sh 18 | -------------------------------------------------------------------------------- /.github/workflows/Mirror.yml: -------------------------------------------------------------------------------- 1 | on: [create, delete, push] 2 | name: Mirror repo 3 | jobs: 4 | delay: 5 | name: Delay 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@master 9 | - name: Delay 10 | uses: docker://alpine:latest 11 | with: 12 | entrypoint: sh 13 | args: -c "sleep 30" 14 | - name: Possible dupe 15 | uses: docker://buildpack-deps:testing-scm 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | IBB_PWLESS_DEPLOY_KEY: ${{ secrets.IBB_PWLESS_DEPLOY_KEY }} 19 | MIRROR_URL: ${{ secrets.MIRROR_URL }}.git 20 | with: 21 | entrypoint: .github/workflows/main.sh 22 | -------------------------------------------------------------------------------- /.github/workflows/Nightly-Mirror.yml: -------------------------------------------------------------------------------- 1 | on: 2 | schedule: 3 | - cron: 49 7 * * * 4 | name: Nightly-mirror 5 | jobs: 6 | mirrorWiki: 7 | name: Mirror wiki 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@master 11 | - name: Mirror wiki 12 | uses: docker://buildpack-deps:testing-scm 13 | env: 14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 15 | IBB_PWLESS_DEPLOY_KEY: ${{ secrets.IBB_PWLESS_DEPLOY_KEY }} 16 | MIRROR_WIKI: ${{ secrets.MIRROR_URL }}.wiki.git 17 | SOURCE_WIKI: git@github.com:sourceryinstitute/MORFEUS-Source.wiki.git 18 | with: 19 | entrypoint: .github/workflows/wiki-update.sh 20 | - name: Mirror to repo 21 | uses: docker://buildpack-deps:testing-scm 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | IBB_PWLESS_DEPLOY_KEY: ${{ secrets.IBB_PWLESS_DEPLOY_KEY }} 25 | MIRROR_URL: ${{ secrets.MIRROR_URL }}.git 26 | with: 27 | entrypoint: .github/workflows/main.sh 28 | -------------------------------------------------------------------------------- /.github/workflows/main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | # Print diagnostic info 6 | echo "Workflow name: $GITHUB_WORKFLOW" 7 | echo "Action name: $GITHUB_ACTION" 8 | echo "Person/app initiating action: $GITHUB_ACTOR" 9 | echo "Current repository: $GITHUB_REPOSITORY" 10 | echo "Event name triggering workflow: $GITHUB_EVENT_NAME" 11 | echo "Workspace path: $GITHUB_WORKSPACE" 12 | echo "GITHUB_SHA: $GITHUB_SHA" 13 | echo "GitHub branch/tag/ref: $GITHUB_REF" 14 | echo "Current directory: $(pwd)" 15 | 16 | echo "Contents of Workspace:" 17 | ls -al "$GITHUB_WORKSPACE" 18 | 19 | echo "Git version:" 20 | git --version 21 | 22 | echo "Git Status:" 23 | git status 24 | 25 | echo "Checking git remotes" 26 | git remote -v 27 | 28 | echo "Branches found:" 29 | git branch -avvv 30 | 31 | echo "Setting up SSH" 32 | [ -d ~/.ssh ] || mkdir -p ~/.ssh 33 | chmod 700 ~/.ssh 34 | echo "$IBB_PWLESS_DEPLOY_KEY" > ~/.ssh/id_ed25519 35 | chmod 600 ~/.ssh/id_ed25519 36 | echo "Checking the sha256 checksum of the ssh key..." 37 | sha256sum ~/.ssh/id_ed25519 38 | eval "$(ssh-agent -s)" 39 | ssh-add ~/.ssh/id_ed25519 40 | 41 | echo "Configure git for authorized user" 42 | git config --global user.name "Izaak Beekman" 43 | git config --global user.email "ibeekman@paratools.com" 44 | git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" 45 | git config --show-origin --list 46 | 47 | echo "Verifying ssh access to github" 48 | ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -T git@github.com || \ 49 | echo "Test ssh authentication failed!" >&2 50 | 51 | git show-ref 52 | 53 | cd ~ || exit 54 | echo "Creating a local mirror of ${GITHUB_REPOSITORY}" 55 | git clone --mirror "git@github.com:${GITHUB_REPOSITORY}.git" 56 | pwd 57 | ls -ld "${GITHUB_REPOSITORY#*/}.git" 58 | 59 | cd "${GITHUB_REPOSITORY#*/}.git" || true 60 | 61 | echo "Setting mirror remote url" 62 | git remote set-url origin "${MIRROR_URL}" 63 | git remote -v 64 | 65 | echo "Pruning PR refs" 66 | git show-ref | cut -d' ' -f2 | grep 'refs/pull/' | xargs -r -L1 git update-ref -d 67 | git show-ref 68 | 69 | git config --show-origin --list 70 | 71 | echo "Attempting push to MIRROR repository..." 72 | if ! git push --mirror --force --progress ; then 73 | sleep 25 74 | git push --mirror --force --progress || exit 78 # nuetral exit 75 | fi 76 | -------------------------------------------------------------------------------- /.github/workflows/wiki-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | # Print diagnostic info 6 | echo "Workflow name: $GITHUB_WORKFLOW" 7 | echo "Action name: $GITHUB_ACTION" 8 | echo "Person/app initiating action: $GITHUB_ACTOR" 9 | echo "Current repository: $GITHUB_REPOSITORY" 10 | echo "Event name triggering workflow: $GITHUB_EVENT_NAME" 11 | echo "Workspace path: $GITHUB_WORKSPACE" 12 | echo "GITHUB_SHA: $GITHUB_SHA" 13 | echo "GitHub branch/tag/ref: $GITHUB_REF" 14 | echo "Current directory: $(pwd)" 15 | 16 | echo "Contents of Workspace:" 17 | ls -al "$GITHUB_WORKSPACE" 18 | 19 | echo "Git version:" 20 | git --version 21 | 22 | echo "Git Status:" 23 | git status 24 | 25 | echo "Checking git remotes" 26 | git remote -v 27 | 28 | echo "Branches found:" 29 | git branch -avvv 30 | 31 | echo "Setting up SSH" 32 | [ -d ~/.ssh ] || mkdir -p ~/.ssh 33 | chmod 700 ~/.ssh 34 | echo "$IBB_PWLESS_DEPLOY_KEY" > ~/.ssh/id_ed25519 35 | chmod 600 ~/.ssh/id_ed25519 36 | echo "Checking the sha256 checksum of the ssh key..." 37 | sha256sum ~/.ssh/id_ed25519 38 | eval "$(ssh-agent -s)" 39 | ssh-add ~/.ssh/id_ed25519 40 | 41 | echo "Configure git for authorized user" 42 | git config --global user.name "Izaak Beekman" 43 | git config --global user.email "ibeekman@paratools.com" 44 | git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" 45 | git config --show-origin --list 46 | 47 | echo "Creating a local mirror of ${SOURCE_WIKI}" 48 | cd ~ || exit 77 49 | git clone --mirror "${SOURCE_WIKI}" 50 | 51 | echo "Attempting push to MIRROR wiki repository..." 52 | cd "${SOURCE_WIKI##*/}" || exit 77 53 | 54 | echo "Setting mirrored wiki remote url" 55 | git remote set-url origin "${MIRROR_WIKI}" 56 | git remote -v 57 | 58 | git show-ref 59 | 60 | git config --show-origin --list 61 | 62 | # Push to the mirrored wiki repository 63 | if ! git push --force --progress ; then 64 | sleep 15 65 | git push --force --progress || exit 78 # nuetral exit 66 | fi 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeCache.txt 2 | CMakeFiles 3 | CMakeScripts 4 | Testing 5 | Makefile 6 | cmake_install.cmake 7 | install_manifest.txt 8 | compile_commands.json 9 | CTestTestfile.cmake 10 | API-doc 11 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/FV/applications"] 2 | path = src/FV/applications 3 | url = ../../nrc-fuels/MORFEUS-application.git 4 | -------------------------------------------------------------------------------- /API-doc-style.css: -------------------------------------------------------------------------------- 1 | table { 2 | border-collapse: collapse; 3 | } 4 | 5 | th, td { 6 | padding: 8px; 7 | } 8 | 9 | tr:nth-child(even) {background-color: #f2f2f2;} 10 | 11 | #responsive-image { width: 100%; height: auto; } 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Sourcery Institute 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /developer-doc/examples/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Usage 3 | --- 4 | 5 |
Table of Contents 6 | 7 | [TOC] 8 | 9 |
10 | 11 | FD Examples 12 | ----------- 13 | 14 | @todo 15 | Add example code, discussion, instructions, etc. 16 | 17 | FV Examples 18 | ----------- 19 | 20 | @todo 21 | Add example code, discussion, instructions, etc. 22 | -------------------------------------------------------------------------------- /developer-doc/getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting Started 3 | --- 4 | 5 |
Table of Contents 6 | 7 | [TOC] 8 | 9 |
10 | 11 | @warning This page is currently under construction 12 | 13 | Prerequisites 14 | ------------- 15 | 16 | List dependencies here, MPI, BLAS/LAPACK etc. 17 | 18 | Configuring the Library 19 | ----------------------- 20 | 21 | Describe steps required to configure with CMake on different OSes with different compilers 22 | 23 | Building the Library 24 | -------------------- 25 | 26 | ``` shell 27 | cmake --build [target] 28 | ``` 29 | 30 | Running Tests 31 | ------------- 32 | 33 | ``` shell 34 | cmake --build test 35 | ``` 36 | -------------------------------------------------------------------------------- /developer-doc/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Developer Documentation 3 | --- 4 | 5 |
Table of Contents 6 | 7 | [TOC] 8 | 9 |
10 | 11 | About 12 | ----- 13 | 14 | This page and directory contain links to various high-level [Morfeus] developer documentation pages. 15 | This content is written in Pythonic Markdown and rendered to HTML by [FORD] and served at [https://sourceryinstitute.github.io/MORFEUS-Source]. 16 | For more details on writing documentation with [FORD], please see the [FORD wiki]. 17 | 18 | Contents 19 | -------- 20 | 21 | * __[Getting Started]__: Information required for building [Morfeus] from source 22 | * __[Prerequisites]__: Required software libraries and tooling 23 | * __[Configuring the Library]__: Running [CMake] to configure the [Morfeus] build, find compilers and optional and required prerequisites 24 | * __[Building the Library]__: Compiling [Morfeus] from source 25 | * __[Running Tests]__: How to run unit and integration tests with [CTest] 26 | * __[High-level FV API and Usage]__: An overview, discussion and list of the high-level finite volume (FV) framework 27 | * __[High-level FD API and Usage]__: An overview, discussion and list of the high-level finite difference (FD) framework 28 | * __[Documenting New and Modified Code]__: How to write [FORD] documentation, and what documentation is required in contributed code 29 | * __[Style Guide]__: Style requirements, many of which are enforced with [EditorConfig] or [findent]. 30 | * __[Example Usage]__: Example code and discussion on how to use [Morfeus] in your application 31 | 32 | 33 | [Morfeus]: https://github.com/sourceryinstitute/MORFEUS-Source#readme 34 | [https://sourceryinstitute.github.io/MORFEUS-Source]: https://sourceryinstitute.github.io/MORFEUS-Source 35 | [FORD]: https://github.com/Fortran-FOSS-Programmers/ford#readme 36 | [FORD wiki]: https://github.com/Fortran-FOSS-Programmers/ford/wiki 37 | [EditorConfig]: https://editorconfig.org/ 38 | [findent]: https://www.ratrabbit.nl/ratrabbit/content/findent/introduction 39 | [CMake]: https://cmake.org/ 40 | [CTest]: https://cmake.org/cmake/help/latest/manual/ctest.1.html 41 | [Getting Started]: ./getting-started.html 42 | [Prerequisites]: ./getting-started.html#prerequisites 43 | [Configuring the Library]: ./getting-started.html#configuring-the-library 44 | [Building the Library]: ./getting-started.html#building-the-library 45 | [Running Tests]: ./getting-started.html#running-tests 46 | [Documenting New and Modified Code]: ./using-ford.html 47 | [Style Guide]: ./style-guide.html 48 | [Example Usage]: ./examples/ 49 | [High-level FV API and Usage]: ./FV-API.html 50 | [High-level FD API and Usage]: ./FD-API.html 51 | -------------------------------------------------------------------------------- /developer-doc/media/Flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/developer-doc/media/Flowchart.png -------------------------------------------------------------------------------- /developer-doc/media/GSElogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/developer-doc/media/GSElogo.png -------------------------------------------------------------------------------- /developer-doc/media/Morfeus-FV-program-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/developer-doc/media/Morfeus-FV-program-flow.png -------------------------------------------------------------------------------- /developer-doc/media/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FORD documentation media directory 3 | --- 4 | 5 | # [FORD] documentation media directory for [Morfeus] 6 | 7 | This directory serves as the [FORD] documentation [media directory (`media_dir`)][media_dir] for [Morfeus]. 8 | Put any images or other media assets here, and you can reference them throughout the [FORD] documentation with the `|media|` macro. 9 | 10 | [FORD]: https://github.com/Fortran-FOSS-Programmers/ford#readme 11 | [media_dir]: https://github.com/Fortran-FOSS-Programmers/ford/wiki/Project-File-Options#media_dir 12 | [Morfeus]: https://github.com/sourceryinstitute/MORFEUS-Source#readme 13 | -------------------------------------------------------------------------------- /developer-doc/media/gsellcfavicons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/developer-doc/media/gsellcfavicons.png -------------------------------------------------------------------------------- /developer-doc/media/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/developer-doc/media/sphere.png -------------------------------------------------------------------------------- /developer-doc/media/toninel_phd.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/developer-doc/media/toninel_phd.pdf -------------------------------------------------------------------------------- /developer-doc/style-guide.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Style Guide 3 | --- 4 | -------------------------------------------------------------------------------- /developer-tools/fix-white-space.elisp: -------------------------------------------------------------------------------- 1 | :;exec emacs -batch -l "$0" -f : "$@" --no-site-file -q # -*- Emacs-Lisp -*- 2 | ; @emacs -batch -l "%~f0" -f : %* --no-site-file -q & goto :EOF 3 | ; 4 | ; This script will delete trailing whitespace in a file 5 | ; 6 | ; Usage: script-name text-file-name 7 | ; 8 | (defun : () 9 | (find-file (nth 5 command-line-args)) 10 | (condition-case nil 11 | (delete-trailing-whitespace 0 nil) 12 | (error nil) ) 13 | (save-buffer) ) 14 | ;:EOF -------------------------------------------------------------------------------- /developer-tools/macOS-env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # 4 | # 5 | # Source this script on macOS to setup environment for compiling MORFEUS and its prerequisites 6 | # 7 | 8 | 9 | # Unlink GCC > 8 if linked 10 | brew unlink gcc || true 11 | 12 | # Unlink OpenMPI if linked 13 | brew unlink openmpi || true 14 | 15 | # Link MPICH if not linked 16 | brew link mpich || true 17 | 18 | # Setup all the compilers 19 | # Find the GCC@8 opt directory 20 | _gcc8_loc="$(brew --prefix)/opt/gcc@8/bin" 21 | 22 | # Set compilers 23 | export FC="${_gcc8_loc}/gfortran-8" 24 | export CC="${_gcc8_loc}/gcc-8" 25 | export CXX="${_gcc8_loc}/g++-8" 26 | 27 | # Set compilers to use for MPICH 28 | export MPICH_FC="${FC}" 29 | export MPICH_CC="${CC}" 30 | export MPICH_CXX="${CXX}" 31 | 32 | ccache_opt="$(brew --prefix)/opt/ccache/libexec" 33 | 34 | if [[ -x "${ccache_opt}/gcc-8" && -x "${ccache_opt}/g++-8" ]] ; then 35 | export CC="${ccache_opt}/gcc-8" 36 | export CXX="${ccache_opt}/g++-8" 37 | fi 38 | -------------------------------------------------------------------------------- /developer-tools/requirements.txt: -------------------------------------------------------------------------------- 1 | cmake>=3.14.3 2 | lxml>=4.4.2 3 | FORD>=6.0.0 4 | -------------------------------------------------------------------------------- /developer-tools/software-stack.ditaa: -------------------------------------------------------------------------------- 1 | 2 | 3 | +-------------------------------------------------------------------------+ 4 | | cC02 | 5 | | FAST | 6 | | | 7 | +------------+------------------------------------------------------------+ 8 | | c529 | c529 | 9 | | | | 10 | | Morfeus FD | Morfeus FV | 11 | | +--------+ +------+---------------+ 12 | | | c057 | | c0BB | c099 | 13 | | | MLD2P4 | | | SEACAS Exodus | 14 | | | | | | | 15 | | +--------+----------------------------+ CGNS +---------------+ 16 | | | c069 | | c099 | 17 | | | PSBLAS | | | 18 | | | | | NetCDF | 19 | | +-----+-------------+--------+------+-------+ +--+---+ | 20 | | | c999 | c069 | c069 | c07B | | c077 | | 21 | | | MPI (MPICH/Intel) | LAPACK | BLAS | Metis | | HDF5 | | 22 | | | | | | | | | | 23 | +------+-------------------+--------+------+-------+---+------+-----------+ -------------------------------------------------------------------------------- /src/FD/.gitignore: -------------------------------------------------------------------------------- 1 | doc 2 | -------------------------------------------------------------------------------- /src/FD/README.md: -------------------------------------------------------------------------------- 1 | Morfeus-FD: Finite Difference Solvers 2 | ===================================== 3 | 4 | To generate documentation, install the [ford] Fortran documentation generator 5 | and execute: 6 | 7 | ```bash 8 | ford -r $(git describe --always) doc-generator.md 9 | ``` 10 | 11 | Then point a web browser to [API-doc/index.html]. 12 | 13 | Browsing Documentation Online 14 | ----------------------------- 15 | 16 | The API documentation generated by [FORD] is browsable online at: 17 | 18 | [https://sourceryinstitute.github.io/MORFEUS-Source/] 19 | 20 | Supported Compilers 21 | ------------------- 22 | 23 | * GNU Compiler Collection (GCC) 8 24 | * Intel 18 25 | 26 | Supported Operating Systems 27 | --------------------------- 28 | 29 | * Windows 30 | * Linux 31 | * macOS 32 | 33 | [ford]: https://github.com/Fortran-FOSS-Programmers/ford 34 | [API-doc/index.html]: https://sourceryinstitute.github.io/MORFEUS-Source/index.html 35 | [https://sourceryinstitute.github.io/MORFEUS-Source/]: https://sourceryinstitute.github.io/MORFEUS-Source/ 36 | -------------------------------------------------------------------------------- /src/FD/geometry/block_metadata_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(block_metadata_interface) block_metadata_implementation 8 | implicit none 9 | !! author: Damian Rouson 10 | !! date: August 8, 2019 11 | !! summary: procedure implementations for encapsulatingd metadata for blocks in block-structured grids 12 | 13 | contains 14 | 15 | module procedure set_tag 16 | this%tag_ = tag 17 | end procedure 18 | 19 | module procedure set_label 20 | this%label_ = label 21 | end procedure 22 | 23 | module procedure set_subdomain 24 | ! HAVE_PURE_IN_ERROR_STOP is not working 25 | !call assert( shape(subdomain%edges)==[space_dimension, num_end_points], & 26 | ! "shape(subdomain%edges)==[space_dimension, num_end_points]" ) 27 | this%subdomain%edges = subdomain%edges 28 | end procedure 29 | 30 | module procedure set_max_spacing 31 | this%max_spacing_ = max_spacing 32 | end procedure 33 | 34 | module procedure get_tag 35 | this_tag = this%tag_ 36 | end procedure 37 | 38 | module procedure get_label 39 | this_label = this%label_ 40 | end procedure 41 | 42 | module procedure get_subdomain 43 | edges = this%subdomain%edges 44 | end procedure 45 | 46 | module procedure get_max_spacing 47 | this_max_spacing = this%max_spacing_ 48 | end procedure 49 | 50 | end submodule block_metadata_implementation 51 | -------------------------------------------------------------------------------- /src/FD/geometry/geometry_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(geometry_interface) geometry_implementation 8 | !! author: Damian Rouson 9 | !! date: 8/20/2019 10 | !! summary: geometry procedures 11 | implicit none 12 | 13 | contains 14 | 15 | module procedure build 16 | call this%set_grid_specification( grid_description_file ) 17 | call this%set_block_metadata() 18 | end procedure 19 | 20 | end submodule geometry_implementation 21 | -------------------------------------------------------------------------------- /src/FD/geometry/geometry_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module geometry_interface 8 | !! author: Damian Rouson 9 | !! date: 8/16/2019 10 | !! summary: abstract representation of problem geometry 11 | implicit none 12 | 13 | private 14 | public :: geometry 15 | 16 | type, abstract :: geometry 17 | !! Abstract representation of the problem geometry in a problem-independent fashion; 18 | !! defer case-specific steps to child classes 19 | private 20 | contains 21 | procedure :: build 22 | procedure(set_json_file), deferred :: set_grid_specification 23 | procedure(set_metadata), deferred :: set_block_metadata 24 | end type 25 | 26 | 27 | interface 28 | 29 | module subroutine build(this, grid_description_file) 30 | !! template method pattern for building a geometry description from a json_file 31 | use json_module, only : json_file 32 | implicit none 33 | class(geometry), intent(out) :: this 34 | character(len=*), intent(in) :: grid_description_file 35 | end subroutine 36 | 37 | end interface 38 | 39 | abstract interface 40 | 41 | subroutine set_json_file(this, grid_description_file) 42 | !! define json_file problem description 43 | import geometry 44 | implicit none 45 | class(geometry), intent(out) :: this 46 | character(len=*), intent(in) :: grid_description_file 47 | end subroutine 48 | 49 | subroutine set_metadata(this) 50 | !! read grid metadata from json_file stored in child class 51 | import geometry 52 | implicit none 53 | class(geometry), intent(inout) :: this 54 | end subroutine 55 | 56 | end interface 57 | 58 | end module geometry_interface 59 | -------------------------------------------------------------------------------- /src/FD/geometry/plate_3D_interface.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module plate_3D_interface 8 | !! author: Damian Rouson and Karla Morris 9 | !! 10 | !! Encapsulate a 3D plate geometry and grid-verification method 11 | use geometry_interface, only : geometry 12 | use json_module, only : json_file 13 | use block_metadata_interface, only : block_metadata, subdomain_t, max_name_length, space_dimension, num_end_points 14 | use kind_parameters, only : r8k 15 | 16 | implicit none 17 | 18 | private 19 | public :: plate_3D 20 | 21 | type, extends(geometry) :: plate_3D 22 | !! encapsulate the grid specification for a plate_3D object 23 | private 24 | type(json_file) :: grid_specification 25 | type(block_metadata), dimension(:,:,:), allocatable :: metadata 26 | character(len=:), allocatable :: units_system 27 | contains 28 | procedure :: set_grid_specification 29 | procedure :: set_block_metadata 30 | procedure :: get_block_metadata_shape 31 | procedure :: get_block_domain 32 | procedure :: get_block_metadatum 33 | procedure :: get_block_metadata 34 | end type 35 | 36 | interface 37 | 38 | module subroutine set_grid_specification(this, grid_description_file) 39 | !! define json_file problem description 40 | implicit none 41 | class(plate_3D), intent(out) :: this 42 | character(len=*), intent(in) :: grid_description_file 43 | end subroutine 44 | 45 | module subroutine set_block_metadata(this) 46 | !! read grid metadata from json_file stored in child class 47 | implicit none 48 | class(plate_3D), intent(inout) :: this 49 | end subroutine 50 | 51 | module function get_block_metadata_shape(this) result(shape_) 52 | !! define the shape of the array of grid blocks 53 | implicit none 54 | class(plate_3D), intent(in) :: this 55 | integer, dimension(space_dimension) :: shape_ 56 | end function 57 | 58 | module function get_block_domain(this, indicial_coordinates) result(this_domain) 59 | !! result is the spatial subdomain for the grid block with the given indicial_coordinates 60 | implicit none 61 | class(plate_3D), intent(in) :: this 62 | integer, dimension(space_dimension) :: indicial_coordinates 63 | integer, parameter :: num_end_points=2 64 | real(r8k), dimension(space_dimension,num_end_points) :: this_domain 65 | end function 66 | 67 | module function get_block_metadatum(this, indicial_coordinates) result(this_metadata_xyz) 68 | !! result is the block_metadata component for the block with the given indicial_coordinates 69 | implicit none 70 | class(plate_3D), intent(in) :: this 71 | integer, dimension(space_dimension) :: indicial_coordinates 72 | type(block_metadata) :: this_metadata_xyz 73 | end function 74 | 75 | module function get_block_metadata(this) result(this_metadata) 76 | !! result is the block_metadata component for all blocks 77 | implicit none 78 | class(plate_3D), intent(in) :: this 79 | type(block_metadata), dimension(:,:,:), allocatable :: this_metadata 80 | end function 81 | 82 | end interface 83 | 84 | end module plate_3D_interface 85 | -------------------------------------------------------------------------------- /src/FD/grid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | set( morfeus_fd_sources 8 | package_interface.F90 9 | package_implementation.F90 10 | surfaces_implementation.F90 11 | curvilinear_grid_interface.f90 12 | units_implementation.F90 13 | units_interface.F90 14 | grid_implementation.f90 15 | grid_interface.F90 16 | problem_discretization_implementation.F90 17 | problem_discretization_interface.F90 18 | cartesian_grid_interface.f90 19 | cartesian_grid_implementation.f90 20 | cylindrical_grid_interface.f90 21 | cylindrical_grid_implementation.f90 22 | spherical_grid_interface.f90 23 | spherical_grid_implementation.f90 24 | spherical_1D_solver_module.F90 25 | spherical_1D_solver_submodule.F90 26 | structured_grid_implementation.F90 27 | structured_grid_interface.F90 28 | differentiable_field_interface.f90 29 | ellipsoidal_field_interface.f90 30 | ellipsoidal_field_implementation.f90 31 | ../geometry/geometry_interface.f90 32 | ../geometry/geometry_implementation.f90 33 | ../geometry/sphere_1D_implementation.F90 34 | ../geometry/sphere_1D_interface.F90 35 | ../geometry/cylinder_2D_implementation.F90 36 | ../geometry/cylinder_2D_interface.F90 37 | ../geometry/plate_3D_implementation.F90 38 | ../geometry/plate_3D_interface.F90 39 | ../geometry/block_metadata_interface.F90 40 | ../geometry/block_metadata_implementation.f90 41 | ) 42 | add_library(morfeus_fd ${morfeus_fd_sources}) 43 | target_link_libraries(morfeus_fd PUBLIC 44 | morfeus_utils) 45 | install(TARGETS morfeus_fd DESTINATION lib) 46 | 47 | set_property(TARGET morfeus_fd 48 | PROPERTY 49 | FOLDER "MORFEUS-FD") 50 | if(TARGET jsonfortran-static) 51 | target_link_libraries ( morfeus_fd 52 | PUBLIC jsonfortran-static ) 53 | else() 54 | message(FATAL_ERROR "Couldn't find JSON-Fortran! include_var=${jsonfortran_INCLUDE_DIRS}") 55 | endif() 56 | if(TARGET vtkmofo) 57 | target_link_libraries ( morfeus_fd 58 | PUBLIC vtkmofo) 59 | else() 60 | message(FATAL_ERROR "Couldn't find VTKmofo! include_var=${vtkmofo_INCLUDE_DIRS}") 61 | endif() 62 | -------------------------------------------------------------------------------- /src/FD/grid/curvilinear_grid_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module curvilinear_grid_interface 8 | use structured_grid_interface, only : structured_grid 9 | implicit none 10 | 11 | private 12 | public :: curvilinear_grid 13 | 14 | type, extends(structured_grid), abstract :: curvilinear_grid 15 | class(structured_grid), allocatable :: metric_tensor(:,:) 16 | end type 17 | 18 | end module 19 | -------------------------------------------------------------------------------- /src/FD/grid/differentiable_field_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module differentiable_field_interface 8 | !! author: Damian Rouson 9 | !! date: 12/19/2019 10 | !! 11 | !! A differentiable field abstraction, deferring function evaluation and differential operator implementations to child classes 12 | use grid_interface, only : grid 13 | implicit none 14 | 15 | private 16 | public :: differentiable_field 17 | 18 | type, abstract :: differentiable_field 19 | contains 20 | procedure(field_interface), deferred :: evaluate 21 | procedure(field_interface), deferred :: laplacian 22 | end type 23 | 24 | abstract interface 25 | function field_interface(this, grid_points) result(f) 26 | !! Compute function values sampled at the provided locations 27 | import differentiable_field, grid 28 | implicit none 29 | class(differentiable_field), intent(in) :: this 30 | class(grid), intent(in) :: grid_points 31 | class(grid), allocatable :: f 32 | end function 33 | end interface 34 | 35 | end module differentiable_field_interface 36 | -------------------------------------------------------------------------------- /src/FD/grid/ellipsoidal_field_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module ellipsoidal_field_interface 8 | !! author: Damian Rouson 9 | !! date: 12/19/2019 10 | !! 11 | !! Define a 3D scalar field with ellipsoidal isosurfaces and provide differential operators 12 | use differentiable_field_interface, only : differentiable_field 13 | use grid_interface, only : grid 14 | implicit none 15 | 16 | private 17 | public :: ellipsoidal_field 18 | 19 | type, extends(differentiable_field) :: ellipsoidal_field 20 | contains 21 | procedure :: evaluate 22 | procedure :: laplacian 23 | end type 24 | 25 | interface 26 | 27 | module function evaluate(this, grid_points) result(f) 28 | !! Evaluate the function at the provided grid points 29 | implicit none 30 | class(ellipsoidal_field), intent(in) :: this 31 | class(grid), intent(in) :: grid_points 32 | class(grid), allocatable :: f 33 | end function 34 | 35 | module function laplacian(this, grid_points) result(laplacian_f) 36 | !! Compute the Laplacian of the ellipsoidal function employed in "evaluate" above 37 | implicit none 38 | class(ellipsoidal_field), intent(in) :: this 39 | class(grid), intent(in) :: grid_points 40 | class(grid), allocatable :: laplacian_f 41 | end function 42 | 43 | end interface 44 | 45 | end module ellipsoidal_field_interface 46 | -------------------------------------------------------------------------------- /src/FD/grid/grid_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(grid_interface) grid_implementation 8 | use assertions_interface, only : assertions,assert 9 | implicit none 10 | 11 | contains 12 | 13 | module procedure set_units 14 | implicit none 15 | !! define grid units 16 | this%units_ = units_obj 17 | call this%mark_as_defined 18 | end procedure 19 | 20 | module procedure get_units 21 | implicit none 22 | if (assertions) call assert(this%user_defined(),"grid%get_units: operand defined") 23 | !! Require user-defined passed-object dummy argument 24 | this_units = this%units_ 25 | end procedure 26 | 27 | end submodule grid_implementation 28 | -------------------------------------------------------------------------------- /src/FD/grid/grid_interface.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module grid_interface 8 | !! author: Damian Rouson 9 | !! date: 9/9/2019 10 | !! 11 | !! One parent abstraction for interacing with Morfeus-FD structured_grid objects or FV field objects 12 | use object_interface, only : object 13 | use units_interface, only : units 14 | implicit none 15 | 16 | private 17 | public :: grid 18 | 19 | type, extends(object) :: grid 20 | !! Morfeus universal base type for all grids 21 | private 22 | type(units) :: units_ 23 | contains 24 | procedure :: set_units 25 | procedure :: get_units 26 | end type 27 | 28 | interface 29 | 30 | #ifndef HAVE_ERROR_STOP_IN_PURE 31 | impure & 32 | #endif 33 | elemental module subroutine set_units(this,units_obj) 34 | implicit none 35 | class(grid), intent(inout) :: this 36 | type(units), intent(in) :: units_obj 37 | end subroutine 38 | 39 | #ifndef HAVE_ERROR_STOP_IN_PURE 40 | impure & 41 | #endif 42 | elemental module function get_units(this) result(this_units) 43 | implicit none 44 | class(grid), intent(in) :: this 45 | type(units) :: this_units 46 | end function 47 | 48 | end interface 49 | 50 | end module 51 | -------------------------------------------------------------------------------- /src/FD/grid/spherical_1D_solver_module.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module spherical_1D_solver_module 8 | !! author: Xiaofeng Xu and Damian Rouson 9 | !! date: 2/24/2020 10 | !! 11 | !! Solve the 1D heat equation in spherically symmetric radial coordinates 12 | use kind_parameters, only : r8k, i4k 13 | implicit none 14 | 15 | private 16 | public :: spherical_1D_solver 17 | 18 | type spherical_1D_solver 19 | !! encapsulate all grid data 20 | private 21 | real(r8k), allocatable :: v(:,:) !! v(:,1) = r, v(:,2) = T, shape = [nr,2] 22 | real(r8k), allocatable :: rho(:), cp(:) !! density and specific heat (size = nr) 23 | real(r8k), allocatable :: T_analytical(:) !! expected solution (size = nr) 24 | contains 25 | procedure :: set_v 26 | procedure :: set_material_properties_size 27 | procedure :: set_expected_solution_size 28 | procedure :: set_rho 29 | procedure :: set_cp 30 | procedure :: time_advance_heat_equation 31 | end type spherical_1D_solver 32 | 33 | interface 34 | 35 | module subroutine set_v( this, nr, constants ) 36 | implicit none 37 | class(spherical_1D_solver), intent(inout) :: this 38 | integer, intent(in) :: nr 39 | real(r8k), intent(in) :: constants(:) 40 | end subroutine 41 | 42 | module subroutine set_material_properties_size(this) 43 | implicit none 44 | class(spherical_1D_solver), intent(inout) :: this 45 | end subroutine 46 | 47 | module subroutine set_expected_solution_size(this) 48 | implicit none 49 | class(spherical_1D_solver), intent(inout) :: this 50 | end subroutine 51 | 52 | module subroutine set_rho(this) 53 | implicit none 54 | class(spherical_1D_solver), intent(inout) :: this 55 | end subroutine 56 | 57 | module subroutine set_cp(this) 58 | implicit none 59 | class(spherical_1D_solver), intent(inout) :: this 60 | end subroutine 61 | 62 | module subroutine time_advance_heat_equation(this, duration) 63 | implicit none 64 | class(spherical_1D_solver), intent(inout) :: this 65 | real(r8k), intent(in) :: duration 66 | end subroutine 67 | 68 | end interface 69 | 70 | end module spherical_1D_solver_module 71 | -------------------------------------------------------------------------------- /src/FD/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | set( test_dir_list 8 | unit 9 | integration 10 | ) 11 | foreach(test_dir ${test_dir_list}) 12 | add_subdirectory( ${test_dir} ) 13 | endforeach() 14 | -------------------------------------------------------------------------------- /src/FD/tests/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | set( base_names 8 | plate-material-mapping 9 | differentiate-cartesian-grid 10 | differentiate-cylindrical-grid 11 | differentiate-spherical-grid 12 | discretize-3D-plate 13 | discretize-2D-cylinder 14 | write-slab-vtk 15 | write-voxels-vtk 16 | ) 17 | foreach(integration_test ${base_names}) 18 | add_executable( test-${integration_test} test-${integration_test}.F90 ) 19 | target_link_libraries( test-${integration_test} 20 | morfeus_fd 21 | vtkmofo 22 | ) # also links in morfeus_utils through transitive dependencies 23 | set_property( TARGET test-${integration_test} 24 | PROPERTY FOLDER "MORFEUS-FD-Tests" 25 | ) 26 | endforeach() 27 | -------------------------------------------------------------------------------- /src/FD/tests/integration/test-differentiate-cartesian-grid.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson and Karla Morris 9 | !! date: 11/15/2019 10 | !! Test the computation of spatial derivatives on a structured_grid 11 | 12 | use plate_3D_interface, only : plate_3D 13 | use problem_discretization_interface, only : problem_discretization 14 | use ellipsoidal_field_interface, only : ellipsoidal_field 15 | implicit none 16 | 17 | integer, parameter :: max_digits=9 18 | character(len=max_digits) image_number 19 | character(len=*), parameter:: input_file = "3Dplate-high-resolution-layers.json" 20 | character(len=*), parameter:: base_name = "3Dplate-high-resolution-layers-derivatives" 21 | character(len=:), allocatable :: output_file 22 | type(problem_discretization) global_grid 23 | type(plate_3D) plate_geometry 24 | type(ellipsoidal_field) ellipsoidal_function 25 | 26 | associate( me => this_image() ) 27 | write(image_number,'(i4)') me 28 | output_file = base_name //"-image-"// trim(adjustl(image_number)) // ".vtu" 29 | 30 | call plate_geometry%build( input_file ) !! read geometrical information 31 | call global_grid%initialize_from_geometry( plate_geometry ) !! partition block-structured grid & define grid vertex locations 32 | call global_grid%set_scalars( [ellipsoidal_function] ) 33 | call global_grid%set_scalar_flux_divergence( exact_result=[ellipsoidal_function] ) 34 | call global_grid%write_output (output_file) 35 | 36 | sync all 37 | if (me==1) print *,"Test passed." 38 | end associate 39 | 40 | end program 41 | -------------------------------------------------------------------------------- /src/FD/tests/integration/test-differentiate-cylindrical-grid.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson and Karla Morris 9 | !! date: 2/7/2020 10 | !! Test the computation of spatial derivatives on a 2D cylindrical structured_grid 11 | 12 | use plate_3D_interface, only : plate_3D 13 | use problem_discretization_interface, only : problem_discretization 14 | use ellipsoidal_field_interface, only : ellipsoidal_field 15 | implicit none 16 | 17 | integer, parameter :: max_digits=9 18 | character(len=max_digits) image_number 19 | !character(len=*), parameter:: input_file = "2Dcylinder.json" 20 | character(len=*), parameter:: input_file = "3Dplate-high-resolution-layers.json" 21 | character(len=*), parameter:: base_name = "2Dcylinder-derivatives" 22 | character(len=:), allocatable :: output_file 23 | type(problem_discretization) global_grid 24 | type(plate_3D) plate_geometry 25 | type(ellipsoidal_field) ellipsoidal_function 26 | 27 | associate( me => this_image() ) 28 | write(image_number,'(i4)') me 29 | output_file = base_name //"-image-"// trim(adjustl(image_number)) // ".vtu" 30 | 31 | call plate_geometry%build( input_file ) !! read geometrical information 32 | call global_grid%initialize_from_geometry( plate_geometry ) !! partition block-structured grid & define grid vertex locations 33 | call global_grid%set_scalars( [ellipsoidal_function] ) 34 | call global_grid%set_scalar_flux_divergence( exact_result=[ellipsoidal_function] ) 35 | call global_grid%write_output (output_file) 36 | 37 | sync all 38 | if (me==1) print *,"Test passed." 39 | end associate 40 | 41 | end program 42 | -------------------------------------------------------------------------------- /src/FD/tests/integration/test-differentiate-spherical-grid.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson and Karla Morris 9 | !! date: 2/24/2020 10 | !! 11 | !! Test solution of the governing equationsn in a 1D spherical geometry 12 | 13 | use sphere_1D_interface, only : sphere_1D 14 | use problem_discretization_interface, only : problem_discretization 15 | use kind_parameters, only : r8k 16 | implicit none 17 | 18 | integer, parameter :: max_digits=9 19 | character(len=max_digits) image_number 20 | character(len=*), parameter:: input_file = "1Dsphere.json" 21 | character(len=*), parameter:: base_name = "1Dsphere-derivatives" 22 | character(len=:), allocatable :: output_file 23 | type(problem_discretization) global_grid 24 | type(sphere_1D) sphere_geometry 25 | 26 | associate( me => this_image() ) 27 | write(image_number,'(i4)') me 28 | output_file = base_name //"-image-"// trim(adjustl(image_number)) // ".csv" 29 | 30 | call sphere_geometry%build( input_file ) !! read geometrical information 31 | call global_grid%initialize_from_geometry( sphere_geometry ) !! partition block-structured grid & define grid vertex locations 32 | call global_grid%solve_governing_equations( duration = sphere_geometry%get_end_time() ) 33 | call global_grid%write_output (output_file) 34 | 35 | sync all 36 | if (me==1) print *,"Test passed." 37 | end associate 38 | 39 | end program 40 | -------------------------------------------------------------------------------- /src/FD/tests/integration/test-discretize-2D-cylinder.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson and Karla Morris 9 | !! date: 2/7/2020 10 | !! Test the initialization of a problem_discretization from cylindrical-geometry json_file input 11 | 12 | use assertions_interface, only : assert 13 | use cylinder_2D_interface, only : cylinder_2D 14 | use problem_discretization_interface, only : problem_discretization 15 | implicit none 16 | 17 | !call create_grid_for_rod(input="2Dcylinder.json", output="2Dcylinder-geometry.vtu") 18 | call create_grid_for_rod(input="3Dplate-low-resolution-layers.json", output="2Dcylinder-geometry.vtu") 19 | 20 | print *,"Test passed." 21 | 22 | contains 23 | 24 | subroutine create_grid_for_rod( input, output) 25 | implicit none 26 | character(len=*), intent(in) :: input, output 27 | type(cylinder_2D) :: rod_geometry 28 | type(problem_discretization) :: global_grid 29 | 30 | call rod_geometry%build( input ) !! read geometrical information 31 | call global_grid%initialize_from_geometry( rod_geometry ) !! partition block-structured grid & define grid vertex locations 32 | call global_grid%write_output (output) 33 | 34 | end subroutine 35 | 36 | end program 37 | -------------------------------------------------------------------------------- /src/FD/tests/integration/test-discretize-3D-plate.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson and Karla Morris 9 | !! date: 9/9/2019 10 | !! Test the initialization of a problem_discretization from a plate json_file input 11 | 12 | use assertions_interface, only : assert 13 | use plate_3D_interface, only : plate_3D 14 | use problem_discretization_interface, only : problem_discretization 15 | implicit none 16 | 17 | call create_grid_for_plate(input="3Dplate-low-resolution-layers.json", output="3Dplate-low-resolution-layers.vtu") 18 | call create_grid_for_plate(input="3Dplate-high-resolution-layers.json", output="3Dplate-high-resolution-layers.vtu") 19 | 20 | print *,"Test passed." 21 | 22 | contains 23 | 24 | subroutine create_grid_for_plate( input, output) 25 | implicit none 26 | character(len=*), intent(in) :: input, output 27 | type(plate_3D) :: plate_geometry 28 | type(problem_discretization) :: global_grid 29 | 30 | call plate_geometry%build( input ) !! read geometrical information 31 | call global_grid%initialize_from_geometry( plate_geometry ) !! partition block-structured grid & define grid vertex locations 32 | call global_grid%write_output (output) 33 | 34 | end subroutine 35 | 36 | end program 37 | -------------------------------------------------------------------------------- /src/FD/tests/integration/test-write-slab-vtk.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | PROGRAM Slab_VTK_output 8 | USE kind_parameters, ONLY : i4k, r8k 9 | USE vtk, ONLY : vtk_serial_write 10 | USE vtk_attributes, ONLY : scalar, attributes 11 | USE vtk_datasets, ONLY : struct_grid 12 | IMPLICIT NONE 13 | !! author: Damian Rouson and Ian Porter 14 | !! date: 03/22/2019 15 | !! 11/25/2019 Modified by IP to remove DTIO due to vtkmofo doing the full file handling 16 | !! 17 | !! This tests output of a slab geometry as a VTK structured grid 18 | !! 19 | INTEGER(i4k), PARAMETER :: n_params_to_write = 1 20 | TYPE vtk_obj 21 | CHARACTER(LEN=LEN('test-write-slab')) :: filename = 'test-write-slab' 22 | TYPE(struct_grid) :: grid 23 | TYPE(attributes), DIMENSION(n_params_to_write) :: vals_to_write 24 | END TYPE vtk_obj 25 | TYPE (vtk_obj) :: slab 26 | INTEGER(i4k) :: i, j, k 27 | REAL(r8k), DIMENSION(*), PARAMETER :: x_vals = & 28 | & [ 0.00E+00_r8k, 8.03E-04_r8k, 1.51E-03_r8k, 2.12E-03_r8k, 2.64E-03_r8k, & 29 | & 3.08E-03_r8k, 3.45E-03_r8k, 3.75E-03_r8k, 3.99E-03_r8k, 4.18E-03_r8k, & 30 | & 4.32E-03_r8k, 4.42E-03_r8k, 4.49E-03_r8k, 4.53E-03_r8k, 4.56E-03_r8k, & 31 | & 4.56E-03_r8k, 4.56E-03_r8k, 4.65E-03_r8k, 5.38E-03_r8k ] 32 | REAL(r8k), DIMENSION(*), PARAMETER :: y_vals = & 33 | & [ 0.00E+00_r8k , 2.*maxval(x_vals) ] 34 | REAL(r8k), DIMENSION(*), PARAMETER :: z_vals = & 35 | & [ 2.50E-03_r8k, 5.00E-03_r8k, 7.50E-03_r8k, 1.00E-03_r8k ] 36 | INTEGER, PARAMETER :: n_x=SIZE(x_vals), n_y=size(y_vals), n_z=size(z_vals) 37 | REAL(r8k), DIMENSION(n_x*n_y*n_z) :: temperature 38 | REAL(r8k), DIMENSION(1:3,n_x*n_y*n_z) :: points 39 | 40 | DO CONCURRENT( i = 1:n_x, j = 1:n_y, k = 1:n_z ) 41 | ASSOCIATE( cnt => (k-1)*n_x*n_y + (j-1)*n_x + i ) 42 | points(:,cnt) = [x_vals(i), y_vals(j), z_vals(k)] 43 | temperature(cnt) = x_vals(i) 44 | END ASSOCIATE 45 | END DO 46 | 47 | CALL slab%grid%init (dims=[ n_x, n_y, n_z ], points=points) 48 | 49 | DO i = 1, n_params_to_write 50 | IF (.NOT. ALLOCATED(slab%vals_to_write(i)%attribute))THEN 51 | ALLOCATE(scalar::slab%vals_to_write(i)%attribute) 52 | END IF 53 | CALL slab%vals_to_write(i)%attribute%init ('Temperature_(K) ' , numcomp=1, real1d=temperature) 54 | END DO 55 | 56 | !! Invoke vtk_serial_write with the components of this object as arguments 57 | CALL vtk_serial_write (filename=slab%filename, geometry=slab%grid, pointdatasets=slab%vals_to_write) 58 | 59 | WRITE(*,*) 'Test passed.' 60 | 61 | END PROGRAM Slab_VTK_output 62 | -------------------------------------------------------------------------------- /src/FD/tests/unit/3Dplate-low-resolution-halo.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_validation": { 3 | "validator": "https://jsonlint.com/", 4 | "validated_by": "Damian Rouson", 5 | "validation_date": 20190920 6 | }, 7 | "MORFEUS_FD": { 8 | "units_system" : "SI", 9 | "initial_condition" : { 10 | "temperature" : 293, 11 | "constraint": { 12 | "language": "Fortran", 13 | "minimum_version": "2003", 14 | "expressions": [ "temperature > 0." ] 15 | } 16 | }, 17 | "boundary_condition" : { 18 | "temperature" : 500, 19 | "constraint": { 20 | "language": "Fortran", 21 | "minimum_version": "2003", 22 | "expressions": ["boundary_condition%temperature > 0."] 23 | } 24 | }, 25 | "time" : { 26 | "end" : 60.0 27 | }, 28 | "heat_source" : { 29 | "power_density" : 10000, 30 | "constraint": { 31 | "language": "Fortran", 32 | "minimum_version": "2003", 33 | "expressions": [ "power_density > 0." ] 34 | } 35 | }, 36 | "layers": { 37 | "type": "3D_plate", 38 | "max_spacing": 1.0E+06, 39 | "core": { 40 | "material_name": ["burrito"], 41 | "thickness": { 42 | "x": [1.0E-01], 43 | "y": [1.0E-01], 44 | "z": [1.0E-01], 45 | "dimensions": "length" 46 | }, 47 | "num_grid_blocks": { 48 | "x": [1], 49 | "y": [1], 50 | "z": [1] 51 | }, 52 | "constraint": { 53 | "language": "Fortran", 54 | "minimum_version": "2003", 55 | "expressions": [ 56 | "all( [num_grid_blocks%x,num_grid_blocks%y,num_grid_blocks%z] > 0 )", 57 | "all( [thickness%x,thickness%y,thickness%z] > 0. )", 58 | "size(material_name)==1", 59 | "all( [size(thickness%x), size(thickness%y), size(thickness%z)]==1 )", 60 | "all( [size(num_grid_blocks%x), size(num_grid_blocks%y), size(num_grid_blocks%z)]==1 )" 61 | ] 62 | } 63 | }, 64 | "wrappers": { 65 | "material_name": ["foil"], 66 | "thickness": { 67 | "x": [1.0E-01], 68 | "y": [1.0E-01], 69 | "z": [1.0E-01], 70 | "dimensions": "length" 71 | }, 72 | "num_grid_blocks": { 73 | "x": [1], 74 | "y": [1], 75 | "z": [1] 76 | }, 77 | "constraint": { 78 | "language": "Fortran", 79 | "minimum_version": "2003", 80 | "expressions": [ 81 | "max_spacing > 0.", 82 | "all([num_grid_blocks%x,num_grid_blocks%y,num_grid_blocks%z]>0)", 83 | "all([thickness%x,thickness%y,thickness%z]>0)", 84 | "all( [size(thickness%x), size(thickness%y), size(thickness%z)] == [size(num_grid_blocks%x), size(num_grid_blocks%y), size(num_grid_blocks%z)] )", 85 | "all( [size(thickness%x), size(thickness%y)] == size(material_name) )" 86 | ] 87 | } 88 | }, 89 | "constraint": { 90 | "language": "Fortran", 91 | "minimum_version": "2003", 92 | "expressions": [ 93 | "all( wrappers%thickness%z >= core%thickness%z )", 94 | "all( wrappers%num_grid_blocks%z >= core%num_grid_blocks%z )" 95 | ] 96 | } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/FD/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | set( base_names 8 | assertions 9 | units 10 | problem-discretization 11 | block-structure 12 | write-problem-discretization 13 | read-geometry 14 | array-functions 15 | spatial-derivatives 16 | adi-time-advancing 17 | spatial-derivatives-new 18 | 1d-sphere 19 | halo-exchange 20 | ) 21 | foreach(unit_test ${base_names}) 22 | add_executable( test-${unit_test} test-${unit_test}.f90 ) 23 | target_link_libraries( test-${unit_test} morfeus_fd ) # also links in morfeus_utils through transitive dependencies 24 | set_property( TARGET test-${unit_test} 25 | PROPERTY FOLDER "MORFEUS-FD-Tests" 26 | ) 27 | endforeach() 28 | 29 | set(requires_preprocessing 30 | structured-grid 31 | emulated-intrinsics 32 | ) 33 | foreach(unit_test ${requires_preprocessing}) 34 | add_executable( test-${unit_test} test-${unit_test}.F90 ) 35 | target_link_libraries( test-${unit_test} morfeus_fd ) # also links in morfeus_utils through transitive dependencies 36 | set_property( TARGET test-${unit_test} 37 | PROPERTY FOLDER "MORFEUS-FD-Tests" 38 | ) 39 | endforeach() 40 | -------------------------------------------------------------------------------- /src/FD/tests/unit/test-1d-sphere.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson and Xiaofeng Xu 9 | !! date: 2/24/2020 10 | !! 11 | !! Test implicit time advancement of the unsteady, 1D spherical heat equation 12 | use spherical_1D_solver_module, only : spherical_1D_solver 13 | use kind_parameters, only : r8k 14 | implicit none 15 | 16 | type(spherical_1D_solver) conducting_sphere 17 | 18 | call conducting_sphere%set_v( nr = 101, constants = [0._r8k, 1073.15_r8k] ) 19 | call conducting_sphere%set_expected_solution_size() 20 | call conducting_sphere%set_material_properties_size() 21 | call conducting_sphere%time_advance_heat_equation( duration = 100._r8k ) 22 | 23 | end program 24 | -------------------------------------------------------------------------------- /src/FD/tests/unit/test-assertions.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | use assertions_interface, only : assert 9 | implicit none 10 | call assert(assertion=(1==1),description="scalar tautology") 11 | call assert([(1==1),(2>0)] ,["vector tautology 1","vector tautology 2"]) 12 | call assert([.true.,.true.,.true.],"group tautology") 13 | sync all 14 | if (this_image()==1) print *,"Test passed." 15 | end program 16 | -------------------------------------------------------------------------------- /src/FD/tests/unit/test-block-structure.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! Test the invertibility of mapping between 3D indicial coordinates and 1D identifiers 9 | !! for the regular grid blocks encapsulated inside a problem_discretization object. 10 | use assertions_interface, only : assert 11 | use problem_discretization_interface, only : problem_discretization 12 | use cartesian_grid_interface, only : cartesian_grid 13 | implicit none 14 | 15 | type(problem_discretization) block_structured_grid 16 | !! encapsulate the global grid structure 17 | type(cartesian_grid) prototype 18 | !! pass the cartesian_grid type 19 | integer, parameter :: num_structured_grids(*) = [3,3,3] 20 | !! number of subdomains in each coordinate direction 21 | integer image 22 | !! implied do loop index 23 | 24 | associate( me => this_image() ) 25 | associate( ni => num_images() ) 26 | associate( num_blocks => product(num_structured_grids) ) 27 | 28 | call assert( ni<=num_blocks, "test-problem-discretization-block-structure: enough blocks to distribute to images") 29 | 30 | call block_structured_grid%partition( num_structured_grids, prototype ) 31 | !! partition the block-structured grid into subdomains with connectivity implied by the supplied shape array 32 | 33 | associate( remainder => mod(num_blocks,ni) ) 34 | associate( quotient => num_blocks/ni ) 35 | associate( my_first => 1 + sum([(quotient+overflow(image,remainder),image=1,me-1)]) ) 36 | associate( my_last => my_first + quotient + overflow(me,remainder) - 1 ) 37 | associate(nx=>num_structured_grids(1), ny=>num_structured_grids(2), nz=>num_structured_grids(3)) 38 | block 39 | integer ix,iy,iz 40 | 41 | do concurrent( iz=1:nz, iy=1:ny, ix=1:nx ) 42 | associate(i=>block_structured_grid%block_identifier([ix,iy,iz])) 43 | call assert( all( block_structured_grid%block_indicial_coordinates(i)==[ix,iy,iz]), "invertible 1D<->3D mapping" ) 44 | end associate 45 | end do 46 | 47 | end block 48 | end associate; end associate; end associate; end associate; end associate; end associate; end associate 49 | 50 | sync all 51 | if (me==1) print *,"Test passed." 52 | end associate 53 | 54 | contains 55 | 56 | pure function overflow(image,remainder) result(filler) 57 | integer, intent(in) :: image,remainder 58 | integer :: filler 59 | filler = merge(1,0,image<=remainder) 60 | end function 61 | 62 | end program 63 | -------------------------------------------------------------------------------- /src/FD/tests/unit/test-read-geometry.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson 9 | !! date: 2019-06-21 10 | !! summary: test the initialization of a problem_discretization from json_file input 11 | use plate_3D_interface, only : plate_3D 12 | implicit none 13 | 14 | type(plate_3D) plate_3D_geometry 15 | 16 | call plate_3D_geometry%build( "3Dplate-low-resolution-layers.json" ) 17 | 18 | print *,"Test passed." 19 | end program 20 | -------------------------------------------------------------------------------- /src/FD/tests/unit/test-structured-grid.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program test_structured_grid 8 | use kind_parameters, only : i4k, r8k 9 | use structured_grid_interface, only : structured_grid 10 | use cartesian_grid_interface, only : cartesian_grid 11 | use assertions_interface, only : assert, max_errmsg_len 12 | #ifndef HAVE_COLLECTIVE_SUBROUTINES 13 | use emulated_intrinsics_interface, only : co_sum 14 | #endif 15 | implicit none 16 | 17 | character(len=max_errmsg_len) :: alloc_error 18 | 19 | integer(i4k), parameter :: success=0 20 | integer(i4k) alloc_status 21 | integer(i4k), parameter :: nx=101,ny=11,nz=11 22 | !! Grid resolution in 3 coordinate directions 23 | real(r8k) :: x(nx,ny,nz)=1.,y(nx,ny,nz)=0.,z(nx,ny,nz)=-1. 24 | !! Vector components 25 | class(structured_grid), allocatable :: coordinate_plane 26 | !! 27 | type(cartesian_grid) prototype 28 | !! pass the cartesian_grid type 29 | 30 | allocate( coordinate_plane, stat=alloc_status, errmsg=alloc_error, mold=prototype ) 31 | call assert( alloc_status==success, "test_structured_grid: allocation ("//alloc_error//")" ) 32 | 33 | call coordinate_plane%set_vector_components(x,y,z) 34 | call assert(coordinate_plane%space_dimension()==3 ,"test_structured_grid: 3D") 35 | call assert(coordinate_plane%free_tensor_indices()==1,"test_structured_grid: 1 free tensor index (vector)") 36 | call assert(coordinate_plane%num_time_stamps()==1 ,"test_structured_grid: single time stamp") 37 | 38 | print *,"Test passed." 39 | 40 | end program 41 | -------------------------------------------------------------------------------- /src/FD/tests/unit/test-write-problem-discretization.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program main 8 | !! author: Damian Rouson 9 | !! date: 10/09/2018 10 | !! 11 | !! Test the problem_discretization creation and output of new problem_discretization to a json file 12 | 13 | use assertions_interface, only : assert 14 | use json_module, only : json_file, rk=>json_rk, ik=>json_ik 15 | use problem_discretization_interface, only : problem_discretization 16 | use cartesian_grid_interface, only : cartesian_grid 17 | implicit none 18 | 19 | type(problem_discretization) block_structured_grid 20 | !! encapsulate the global grid structure 21 | type(cartesian_grid) prototype 22 | !! pass the cartesian_grid type 23 | type(json_file) json_problem_description 24 | integer, parameter :: num_structured_grids(*) = [120,5,5] 25 | !! number of subdomains in each coordinate direction 26 | integer(ik), parameter :: space_dimensions=3, interval_extent=2 27 | !! number of spatial dimensions, array index extent for defining 1D spatial intervals 28 | real(rk), parameter:: global_domain(*,*)= reshape([real(rk):: 0.,120., 0.,2.5, 0.,2.5 ],[interval_extent,space_dimensions]) 29 | !! overall rectangular domain boundaries 30 | integer, parameter :: max_block_identifier = 999999999 31 | integer, parameter :: nx_local=11,ny_local=11,nz_local=11 32 | integer ix,iy,iz 33 | character(len=99) identifier_string 34 | 35 | call assert(num_images()==1,"single-image json file creation") 36 | call assert(product(num_structured_grids)<=max_block_identifier,"number of blocks is representable") 37 | 38 | call block_structured_grid%partition( num_structured_grids, prototype ) 39 | !! partition the block-structured grid into subdomains with connectivity implied by the supplied shape array 40 | 41 | call json_problem_description%initialize() ! specify whatever init options you want. 42 | call json_problem_description%add('geometry.time', 0.0_rk) 43 | call json_problem_description%add('geometry.domain.shape', shape(global_domain) ) 44 | call json_problem_description%add('geometry.domain.sides', reshape(global_domain,[size(global_domain)]) ) 45 | call json_problem_description%add('grid.resolution.block_array_shape', num_structured_grids) 46 | 47 | do ix=1,num_structured_grids(1) 48 | do iy=1,num_structured_grids(2) 49 | do iz=1,num_structured_grids(3) 50 | write (identifier_string,'(I0)') block_structured_grid%block_identifier([ix,iy,iz]) 51 | call json_problem_description%add(trim('grid.resolution.id'//identifier_string), [nx_local,ny_local,nz_local]) 52 | end do; end do; end do 53 | 54 | call assert( .not. json_problem_description%failed(), ".not. json_problem_description%failed()") 55 | 56 | call json_problem_description%print_file('fast_structured_grid.json') 57 | 58 | call assert( .not. json_problem_description%failed(), ".not. json_problem_description%failed()") 59 | 60 | print *,"Test passed." 61 | 62 | end program 63 | -------------------------------------------------------------------------------- /src/FD/utilities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | set( morfeus_utils_sources 8 | assertions_interface.F90 9 | assertions_implementation.F90 10 | object_interface.f90 11 | object_implementation.f90 12 | co_object_interface.f90 13 | co_object_implementation.f90 14 | array_functions_interface.f90 15 | array_functions_implementation.f90 16 | string_functions_interface.f90 17 | string_functions_implementation.f90 18 | kind_parameters.f90 19 | ) 20 | if(EMULATE_MISSING_INTRINSICS) 21 | set( morfeus_utils_sources 22 | ${morfeus_utils_sources} 23 | emulated_intrinsics_interface.F90 24 | emulated_intrinsics_implementation.F90 25 | ) 26 | endif() 27 | add_library( morfeus_utils ${morfeus_utils_sources}) 28 | if(USE_ASSERTIONS) 29 | target_compile_definitions(morfeus_utils 30 | PUBLIC -DUSE_ASSERTIONS=.true.) 31 | endif() 32 | install(TARGETS morfeus_utils DESTINATION lib) 33 | set_property(TARGET morfeus_utils 34 | PROPERTY 35 | FOLDER "MORFEUS-FD") 36 | if(TARGET OpenCoarrays::caf_mpi_static) 37 | target_link_libraries(morfeus_utils 38 | PUBLIC OpenCoarrays::caf_mpi_static) 39 | endif() 40 | target_link_libraries(morfeus_utils 41 | PUBLIC utilities) 42 | -------------------------------------------------------------------------------- /src/FD/utilities/array_functions_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | SUBMODULE(array_functions_interface) array_functions_implementation 8 | USE assertions_interface, ONLY : assert, assertions 9 | IMPLICIT NONE 10 | CONTAINS 11 | 12 | MODULE PROCEDURE column_vectors 13 | INTEGER i, j, k 14 | 15 | ASSOCIATE( n => shape(vector_field) ) 16 | IF (assertions) CALL assert(SIZE(n)==4, "3D vector field input") 17 | ALLOCATE( array_of_3D_column_vectors( n(4), PRODUCT(n(1:3)) ) ) 18 | DO CONCURRENT( i=1:n(1), j=1:n(2), k=1:n(3) ) 19 | ASSOCIATE( id => (k-1)*PRODUCT(n(1:2)) + (j-1)*n(1) + i ) 20 | array_of_3D_column_vectors(:,id) = vector_field(i,j,k,:) 21 | END ASSOCIATE 22 | END DO 23 | END ASSOCIATE 24 | 25 | END PROCEDURE 26 | 27 | MODULE PROCEDURE concatenate_columns 28 | !! Using RESHAPE rather than manipulating array elements directly frees the compiler to decide the particular order of array 29 | !! element references that best exploits the given platform. Alternatively, DO CONCURRENT could instead free the compiler 30 | !! to order element accesses however is best. Trade-off: RESHAPE requires the creation of temporary array results but RESHAPE 31 | !! is likely to have more mature compiler support than DO CONCURRENT. If this code turns out to be a critical performance 32 | !! bottleneck, try replacing this implementation with element-by-element copying using DO CONCURRENT. 33 | ASSOCIATE(rows=>SIZE(a,1)) 34 | ASSOCIATE(cols=>SIZE(a,2)+SIZE(b,2)) 35 | ASSOCIATE(a_unrolled=>RESHAPE(a,[SIZE(a)])) 36 | ASSOCIATE(b_unrolled=>RESHAPE(b,[SIZE(b)])) 37 | IF (assertions) CALL assert( rows==SIZE(b,1), "array_functions: compatible shapes") 38 | concatenated = RESHAPE( [a_unrolled, b_unrolled ],[rows, cols] ) 39 | END ASSOCIATE; END ASSOCIATE; END ASSOCIATE; END ASSOCIATE 40 | END PROCEDURE 41 | 42 | MODULE PROCEDURE concatenate_rows 43 | !! For simplicity, this implementation invokes concatenate_columns at the cost of TRANSPOSE creating additional temporaries. 44 | !! If this code turns out to be a critical performance bottleneck, try replacing this implementation with element-by-element 45 | !! copying using DO CONCURRENT. 46 | concatenated = transpose( concatenate_columns(transpose(a),transpose(b)) ) 47 | END PROCEDURE 48 | 49 | END SUBMODULE 50 | -------------------------------------------------------------------------------- /src/FD/utilities/array_functions_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | MODULE array_functions_interface 8 | !! author: Damian Rouson 9 | !! date: 04/25/2019 10 | !! 11 | !! Functionally pure array utilities 12 | USE kind_parameters, ONLY : r8k 13 | IMPLICIT NONE 14 | 15 | PRIVATE 16 | PUBLIC :: OPERATOR(.catColumns.) 17 | PUBLIC :: OPERATOR(.catRows.) 18 | PUBLIC :: OPERATOR(.columnVectors.) 19 | !! Because the Fortran standard requires that user-defined operator dummy arguments have the INTENT(IN) 20 | !! attribute, exposing only the operator and not the function names communicates more information in the 21 | !! public interface and in code using this interface. 22 | 23 | INTERFACE OPERATOR(.columnVectors.) 24 | MODULE PROCEDURE :: column_vectors 25 | END INTERFACE 26 | 27 | INTERFACE OPERATOR(.catColumns.) 28 | MODULE PROCEDURE :: concatenate_columns 29 | END INTERFACE 30 | 31 | INTERFACE OPERATOR(.catRows.) 32 | MODULE PROCEDURE :: concatenate_rows 33 | END INTERFACE 34 | 35 | INTERFACE 36 | 37 | PURE MODULE FUNCTION column_vectors(vector_field) RESULT(array_of_3D_column_vectors) 38 | !! Result is array of 3D column vectors of dimension (space_dim,nx*ny*nz) reshaped from vector-field argument 39 | !! of dimension (nx,ny,nz,space_dim) 40 | IMPLICIT NONE 41 | REAL(r8k), DIMENSION(:,:,:,:), INTENT(IN) :: vector_field 42 | REAL(r8k), DIMENSION(:,:), ALLOCATABLE :: array_of_3D_column_vectors 43 | END FUNCTION 44 | 45 | PURE MODULE FUNCTION concatenate_columns(a, b) RESULT(concatenated) 46 | !! Result contains the concatenation of the columns of argument a with the columns of argument b 47 | IMPLICIT NONE 48 | REAL(r8k), DIMENSION(:,:), INTENT(IN) :: a, b 49 | REAL(r8k), DIMENSION(:,:), ALLOCATABLE :: concatenated 50 | END FUNCTION 51 | 52 | PURE MODULE FUNCTION concatenate_rows(a, b) RESULT(concatenated) 53 | !! Result contains the concatenation of the rows of argument a with the rows of argument b 54 | IMPLICIT NONE 55 | REAL(r8k), DIMENSION(:,:), INTENT(IN) :: a, b 56 | REAL(r8k), DIMENSION(:,:), ALLOCATABLE :: concatenated 57 | END FUNCTION 58 | 59 | END INTERFACE 60 | 61 | END MODULE 62 | -------------------------------------------------------------------------------- /src/FD/utilities/assertions_implementation.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(assertions_interface) assertions_implementation 8 | implicit none 9 | contains 10 | module procedure assert 11 | use iso_fortran_env, only : error_unit 12 | character(len=:), allocatable :: message, preface 13 | integer, parameter :: max_appended_characters=1024 14 | if (present(success)) success=assertion 15 | if (.not.assertion) then 16 | message = repeat(" ",ncopies=len(description)+max_appended_characters) 17 | write(message,*) '(',description,') on image',this_image() 18 | if (present(diagnostic_data)) then 19 | select type(diagnostic_data) 20 | type is(character(len=*)) 21 | message = trim(adjustl(message)) // 'with diagnostic data' // diagnostic_data 22 | type is(integer) 23 | preface = trim(adjustl(message)) // 'with diagnostic data' 24 | write(message,*) preface, diagnostic_data 25 | class default 26 | message = trim(adjustl(message)) // 'with diagnostic data of unrecognized type' 27 | end select 28 | end if 29 | if (.not. present(success)) error stop "Assertion failed" // & 30 | #ifdef HAVE_NON_CONSTANT_ERROR_STOP 31 | & message ! Fortran 2018 32 | #else 33 | & "." ! Fortran 2008 34 | #endif 35 | end if 36 | end procedure 37 | end submodule 38 | -------------------------------------------------------------------------------- /src/FD/utilities/assertions_interface.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | #ifndef USE_ASSERTIONS 8 | # define USE_ASSERTIONS .false. 9 | #endif 10 | module assertions_interface 11 | !! summary: Utility for runtime checking of logical assertions. 12 | !! 13 | !! Compile with -DNO_ASSERTIONS to turn assertions off 14 | !! 15 | !! Use case 1 16 | !! ---------- 17 | !! Pass the optional success argument & check for false return value as an indication of assertion failure: 18 | !! 19 | !! use assertions_interface, only : assert,assertions 20 | !! if (assertions) call assert( 2 > 1, "always true inequality", success) 21 | !! if (error_code/=0) call my_error_handler() 22 | !! 23 | !! Use case 2 24 | !! ---------- 25 | !! Error-terminate if the assertion fails: 26 | !! 27 | !! use assertions_interface, only : assert,assertions 28 | !! if (assertions) call assert( 2 > 1, "always true inequality") 29 | !! 30 | implicit none 31 | private 32 | public :: assert 33 | public :: assertions 34 | public :: max_errmsg_len 35 | 36 | ! Set the USE_ASSERTIONS constant below using the C preprocessor: 37 | ! 38 | ! gfortran -cpp -DUSE_ASSERTIONS=.false. -c assertions_interface.f90 39 | ! 40 | ! or set the corresponding NO_ASSERTIONS variable defined in the CMakeLists.txt file in this directory: 41 | ! 42 | ! FC=caf cmake -DNO_ASSERTIONS=ON 43 | ! 44 | ! Conditioning assertion calls on this compile-time constant enables optimizing compilers 45 | ! to eliminate assertion calls during a dead-code removal phase of optimization. 46 | 47 | logical, parameter :: assertions=USE_ASSERTIONS 48 | integer, parameter :: max_errmsg_len = len( & 49 | "warning (183): FASTMEM allocation is requested but the libmemkind library is not linked in, so using the default allocator.") 50 | !! longest Intel compiler error messagea (see https://intel.ly/35x84yr). 51 | 52 | interface 53 | #ifndef HAVE_ERROR_STOP_IN_PURE 54 | impure & 55 | #endif 56 | elemental module subroutine assert(assertion,description,diagnostic_data,success) 57 | !! Report on the truth of an assertion or error-terminate on assertion failure 58 | implicit none 59 | logical, intent(in) :: assertion 60 | !! Most assertions will be expressions, e.g., call assert( i>0, "positive i") 61 | character(len=*), intent(in) :: description 62 | !! Brief statement of what is being asserted 63 | class(*), intent(in), optional :: diagnostic_data 64 | !! Optional assertion result 65 | logical, intent(out), optional :: success 66 | !! Optional assertion result 67 | end subroutine 68 | end interface 69 | end module 70 | -------------------------------------------------------------------------------- /src/FD/utilities/co_object_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(co_object_interface) co_object_implementation 8 | implicit none 9 | 10 | contains 11 | 12 | module procedure mark_as_defined 13 | this%defined=.true. 14 | end procedure 15 | 16 | module procedure user_defined 17 | is_defined = this%defined 18 | end procedure 19 | 20 | end submodule 21 | -------------------------------------------------------------------------------- /src/FD/utilities/co_object_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module co_object_interface 8 | implicit none 9 | 10 | private 11 | public :: co_object 12 | 13 | ! Define an abstract parent type to ensure basic functionality expected to be provided by all non-abstract types. 14 | ! Each non-abstract type provides the functionality by extending this type and implementing its deferred binding(s). This 15 | ! type resembles java's Object class in the sense that it is intended to be the ultimate ancester of every other type. 16 | type, abstract :: co_object 17 | private 18 | logical :: defined=.false. 19 | !! Default initialization indicates not yet user-defined 20 | logical, allocatable :: facilitate_type_extension[:] 21 | contains 22 | procedure :: mark_as_defined 23 | procedure :: user_defined 24 | end type 25 | 26 | interface 27 | 28 | pure module subroutine mark_as_defined(this) 29 | !! Mark the co_object as user-defined 30 | implicit none 31 | class(co_object), intent(inout) :: this 32 | end subroutine 33 | 34 | pure module function user_defined(this) result(is_defined) 35 | !! Return a boolean result indicating whether this co_object has been initialized since its declaration 36 | implicit none 37 | class(co_object), intent(in) :: this 38 | logical :: is_defined 39 | end function 40 | 41 | end interface 42 | 43 | end module co_object_interface 44 | -------------------------------------------------------------------------------- /src/FD/utilities/emulated_intrinsics_interface.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module emulated_intrinsics_interface 8 | !! author: Damian Rouson 9 | !! 10 | !! Fortran 2008 coarray emulations of Fortran 2018 intrinsic collective subroutines 11 | !! and Fortran 2003 emulation of Fortran 2008 intrinsic procedures (e.g, findloc) 12 | implicit none 13 | 14 | #ifndef HAVE_FINDLOC 15 | interface findloc 16 | !! result is the last occurrence of a value in an array or zero if not found 17 | module procedure findloc_integer_dim1, findloc_logical_dim1, findloc_character_dim1 18 | end interface 19 | #endif 20 | 21 | #ifndef HAVE_COLLECTIVE_SUBROUTINES 22 | interface co_sum 23 | !! parallel computation of the sum of the first argument 24 | module procedure co_sum_integer 25 | end interface 26 | 27 | interface co_broadcast 28 | !! parallel one-to-all communication of the value of first argument 29 | module procedure co_broadcast_integer 30 | end interface 31 | #endif 32 | 33 | interface 34 | 35 | #ifndef HAVE_COLLECTIVE_SUBROUTINES 36 | module subroutine co_sum_integer(a,result_image,stat,errmsg) 37 | implicit none 38 | integer, intent(inout) :: a 39 | integer, intent(in), optional :: result_image 40 | integer, intent(out), optional :: stat 41 | character(len=*), intent(inout), optional :: errmsg 42 | end subroutine 43 | 44 | module subroutine co_broadcast_integer(a,source_image,stat,errmsg) 45 | implicit none 46 | integer, intent(inout) :: a 47 | integer, intent(in) :: source_image 48 | integer, intent(out), optional :: stat 49 | character(len=*), intent(inout), optional :: errmsg 50 | end subroutine 51 | #endif 52 | 53 | #ifndef HAVE_FINDLOC 54 | pure module function findloc_integer_dim1(array, value, dim, back) result(location) 55 | implicit none 56 | integer, intent(in) :: array(:), value, dim 57 | logical, intent(in), optional :: back 58 | integer location 59 | end function 60 | 61 | pure module function findloc_logical_dim1(array, value, dim, back) result(location) 62 | implicit none 63 | logical, intent(in) :: array(:), value, back 64 | integer, intent(in) :: dim 65 | integer location 66 | end function 67 | 68 | pure module function findloc_character_dim1(array, value, dim, back) result(location) 69 | implicit none 70 | character(len=*), intent(in) :: array(:), value 71 | integer, intent(in) :: dim 72 | logical, intent(in) :: back 73 | integer location 74 | end function 75 | #endif 76 | 77 | end interface 78 | 79 | end module emulated_intrinsics_interface 80 | -------------------------------------------------------------------------------- /src/FD/utilities/kind_parameters.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | MODULE kind_parameters 8 | USE iso_fortran_env, ONLY : i4k => int32, i8k => int64, r4k => real32, r8k =>real64 9 | IMPLICIT NONE 10 | !! author: Damian Rouson 11 | !! date: 09/27/2019 12 | !! 13 | !! This module contains the kinds used for specifying the precision of variables 14 | !! 15 | PRIVATE 16 | PUBLIC :: i4k, i8k, r4k, r8k 17 | 18 | ! r4k - Single precision for reals 19 | ! r8k - Double precision for reals 20 | ! i4k - Single precision for integers 21 | ! i8k - Double precision for integers 22 | 23 | END MODULE kind_parameters 24 | -------------------------------------------------------------------------------- /src/FD/utilities/object_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(object_interface) object_implementation 8 | implicit none 9 | 10 | contains 11 | 12 | module procedure mark_as_defined 13 | this%defined=.true. 14 | end procedure 15 | 16 | module procedure user_defined 17 | is_defined = this%defined 18 | end procedure 19 | 20 | end submodule 21 | -------------------------------------------------------------------------------- /src/FD/utilities/object_interface.f90: -------------------------------------------------------------------------------- 1 | !! author: Damian Rouson, GSE LLC 2 | !! category: Morfeus-FD 3 | !! summary: Abstract base type, `object` 4 | !! 5 | !! ### Copyright notice 6 | !! 7 | !! ``` 8 | !! (c) 2019-2020 Guide Star Engineering, LLC 9 | !! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 10 | !! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 11 | !! contract # NRC-HQ-60-17-C-0007 12 | !! ``` 13 | 14 | module object_interface 15 | implicit none 16 | 17 | private 18 | public :: object 19 | 20 | type, abstract :: object 21 | !! author: Damian Rouson, GSE LLC 22 | !! category: Morfeus-FD 23 | !! summary: Abstract type to ensure all objects extending it implement the required methods 24 | !! 25 | !! Define an abstract parent type to ensure basic functionality expected to be provided by all non-abstract types. 26 | !! Each non-abstract type provides the functionality by extending this type and implementing its deferred binding(s). This 27 | !! type resembles java's Object class in the sense that it is intended to be the ultimate ancestor of every other type. 28 | private 29 | logical :: defined=.false. 30 | !! Default initialization indicates not yet user-defined 31 | contains 32 | procedure :: mark_as_defined 33 | procedure :: user_defined 34 | end type 35 | 36 | interface 37 | 38 | pure module subroutine mark_as_defined(this) 39 | !! Mark the object as user-defined 40 | implicit none 41 | class(object), intent(inout) :: this 42 | end subroutine 43 | 44 | pure module function user_defined(this) result(is_defined) 45 | !! Return a boolean result indicating whether this object has been initialized since its declaration 46 | implicit none 47 | class(object), intent(in) :: this 48 | logical :: is_defined 49 | end function 50 | 51 | end interface 52 | 53 | end module object_interface 54 | -------------------------------------------------------------------------------- /src/FD/utilities/string_functions_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | submodule(string_functions_interface) string_functions_implementation 8 | implicit none 9 | 10 | contains 11 | 12 | module procedure file_extension 13 | character(len=:), allocatable :: name_ 14 | 15 | name_ = trim(file_name) 16 | associate( dot_location => index(name_, '.', back=.true.) ) 17 | if (dot_location < len(name_)) then 18 | extension = name_(dot_location+1:) 19 | else 20 | extension = "" 21 | end if 22 | end associate 23 | end procedure 24 | 25 | module procedure base_name 26 | character(len=:), allocatable :: name_ 27 | 28 | name_ = trim(file_name) 29 | associate( dot_location => index(name_, '.', back=.true.) ) 30 | if (dot_location < len(name_)) then 31 | base = name_(1:dot_location-1) 32 | else 33 | base = "" 34 | end if 35 | end associate 36 | end procedure 37 | 38 | end submodule 39 | -------------------------------------------------------------------------------- /src/FD/utilities/string_functions_interface.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | module string_functions_interface 8 | !! author: Damian Rouson 9 | !! date: August 23, 2019 10 | !! summary: utilities for manipulating character variables 11 | implicit none 12 | 13 | private 14 | public :: file_extension, csv_format, base_name 15 | 16 | character(len=*), parameter :: csv_format = '(*(G0,:,","))' 17 | 18 | interface 19 | 20 | pure module function file_extension(file_name) result(extension) 21 | !! result contains all characters in file_name after the first dot (.) 22 | character(len=*), intent(in) :: file_name 23 | character(len=:), allocatable :: extension 24 | end function 25 | 26 | pure module function base_name(file_name) result(base) 27 | !! result contains all characters in file_name before the first dot (.) 28 | character(len=*), intent(in) :: file_name 29 | character(len=:), allocatable :: base 30 | end function 31 | 32 | end interface 33 | 34 | end module 35 | -------------------------------------------------------------------------------- /src/FV/README.outdated: -------------------------------------------------------------------------------- 1 | 2 | ##### NEMO <-> Numerical Engine (for) Multiphysics Operators ##### 3 | 4 | --- QUICK INSTALLATION GUIDE --- 5 | 6 | 7 | PREREQUISITES: 8 | 9 | - A Fortran 95 compiler. The code has been successfully tested with the 10 | following compiler/platform combinations: 11 | * Gfortran 4.2 on IA-32, AMD64, PowerPC-G4 12 | * Intel Fortran Compiler 9.x, 10.x on IA-32 and IA-64 13 | * XL Fortran on AIX 14 | 15 | - BLAS: Basic Linear Algebra Subprograms. 16 | A generic implementation is available at www.netlib.org/blas/ 17 | For a better performance choose one of the following options: 18 | * ATLAS library from www.netlib.org/atlas 19 | * a platform-dependent implementation like Intel-MKL, AMD-ACML, ESSL... 20 | 21 | - MPICH: an implementation of Message Passing Interface standard 22 | Available at http://www-unix.mcs.anl.gov/mpi/mpich/ 23 | 24 | - PSBLAS: Parallel Sparse Basic Linear Algebra Subprograms 25 | Available at http://www.ce.uniroma2.it/psblas/ 26 | 27 | - CGNSlib: CFD General Notation System library 28 | Available at http://www.cgns.org 29 | 30 | - ParMETIS: Parallel implementation of METIS library 31 | Available at http://www-users.cs.umn.edu/~karypis/metis/parmetis/ 32 | 33 | Detailed instructions for a typical configuration of the different 34 | libraries are reported in ./doc/installation-guide.pdf. 35 | We now have a configure script, will update the install instructions 36 | soon. 37 | 38 | 39 | COMPILING 40 | 41 | In order to compile the source code and build the different applications: 42 | 43 | 1. Generate an appropriate Make.inc with (at least) 44 | ./configure --with-psblas-dir=\ 45 | --with-parmetis= \ 46 | --with-cgns= 47 | Additional options are available; see also the configure script of 48 | PSBLAS. 49 | 50 | 51 | 2. edit ./Make.inc if needed to further customize the compilation process 52 | 53 | 3a. In the main directory: 54 | $ make --> build the library 55 | $ make install --> intall the library 56 | 57 | 3b. In the ./applications directory: 58 | $ make --> build all applications 59 | 60 | CLEANING 61 | 62 | In the main directory: 63 | $ make clean --> clean the whole tree 64 | 65 | In the ./applications directory: 66 | $ make clean --> clean main directory from execution products 67 | 68 | $ make veryclean --> clean the whole ./applications/ tree 69 | -------------------------------------------------------------------------------- /src/FV/cmake/FindModules/FindCGNS.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | set(CGNS_LIB_NAMES cgns) 8 | 9 | # Prefer static libraries 10 | if(NOT BUILD_SHARED_LIBS) 11 | set(CGNS_LIB_NAMES libcgns.a ${CGNS_LIB_NAMES}) 12 | endif() 13 | 14 | if( DEFINED ENV{CGNSDIR} ) 15 | if( NOT DEFINED CGNS_ROOT ) 16 | set(CGNS_ROOT "$ENV{CGNSDIR}") 17 | endif() 18 | endif() 19 | 20 | if( (DEFINED ENV{CGNS_ROOT}) OR (DEFINED CGNS_ROOT) ) 21 | if( NOT DEFINED CGNS_ROOT) 22 | set(CGNS_ROOT "$ENV{CGNS_ROOT}") 23 | endif() 24 | set(CGNS_HINTS "${CGNS_ROOT}") 25 | endif() 26 | 27 | find_path(CGNS_INCLUDES cgnslib.h 28 | HINTS 29 | ${CGNS_ROOT} 30 | PATHS 31 | /usr/local/opt 32 | /usr/local 33 | /usr 34 | PATH_SUFFIXES 35 | include 36 | DOC 37 | "Path to the CGNS include files." 38 | ) 39 | 40 | if(CGNS_INCLUDES) 41 | foreach(include IN_LISTS CGNS_INCLUDES) 42 | get_filename_component(cgns_include_dir "${include}" DIRECTORY) 43 | get_filename_component(cgns_abs_include_dir "${cgns_include_dir}" ABSOLUTE) 44 | get_filename_component(new_cgns_hint "${include_dir}/.." ABSOLUTE ) 45 | list(APPEND CGNS_HINTS "${new_cgns_hint}") 46 | break() 47 | endforeach() 48 | endif() 49 | 50 | if(CGNS_HINTS) 51 | list(REMOVE_DUPLICATES CGNS_HINTS) 52 | endif() 53 | 54 | find_path(CGNS_MODULE cgns.mod 55 | HINTS 56 | ${CGNS_HINTS} 57 | PATHS 58 | /usr/local/opt 59 | /usr/local 60 | /usr 61 | /usr/lib64 62 | PATH_SUFFIXES 63 | include 64 | gfortran/modules 65 | DOC 66 | "Location of the CGNS Fortran module file." 67 | ) 68 | 69 | list(APPEND CGNS_INCLUDES ${CGNS_MODULE}) 70 | list(REMOVE_DUPLICATES CGNS_INCLUDES) 71 | 72 | find_library(CGNS_LIBRARY NAMES ${CGNS_LIB_NAMES} 73 | HINTS 74 | ${CGNS_HINTS} 75 | PATHS 76 | /usr/local/opt 77 | /usr/local 78 | /usr 79 | /usr 80 | PATH_SUFFIXES 81 | lib 82 | lib64 83 | DOC "Path to the CGNS library" 84 | ) 85 | 86 | set(CGNS_FOUND "NO") 87 | if(CGNS_MODULE) 88 | if(CGNS_LIBRARY) 89 | set( CGNS_LIBRARIES ${CGNS_LIBRARY} ) 90 | set( CGNS_FOUND "YES" ) 91 | endif() 92 | endif() 93 | 94 | if(CGNS_FIND_REQUIRED AND NOT CGNS_FOUND) 95 | message(SEND_ERROR "Unable to find the requested CGNS libraries.") 96 | endif() 97 | 98 | # handle the QUIETLY and REQUIRED arguments and set CGNS_FOUND to TRUE if 99 | # all listed variables are TRUE 100 | include(FindPackageHandleStandardArgs) 101 | find_package_handle_standard_args(CGNS DEFAULT_MSG CGNS_LIBRARY CGNS_INCLUDES) 102 | 103 | 104 | mark_as_advanced( 105 | CGNS_INCLUDES 106 | CGNS_MODULE 107 | CGNS_LIBRARY 108 | ) 109 | -------------------------------------------------------------------------------- /src/FV/cmake/modules/AddParallelTest.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | 8 | # Function to add MPI tests (or MPI-based coarray tests) 9 | include_guard(DIRECTORY) 10 | function(add_parallel_test) 11 | # Function to add MPI test 12 | # 13 | # Arguments: 14 | # NAME: Name of the test and executable. Default value: basename without extension of the first source in SOURCES 15 | # PROCESSES: Positive integer denoting the number of processes/images to spawn. Default value: 1 16 | # TEST_DIR: The working directory for the test. Optional, default is whatever CMake defaults to 17 | # SOURCES: A list of source files to compile, including the main program. The first entry is used for the name if NAME not given 18 | # LIBS: One or more libraries to link the test executable against 19 | 20 | # set(options "") 21 | set(oneValueArgs NAME PROCESSES TEST_DIR) 22 | set(multiValueArgs SOURCES LIBS) 23 | cmake_parse_arguments(APT "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) 24 | 25 | if(NOT APT_SOURCES) 26 | message( FATAL_ERROR "`add_parallel_test()` must be called with the SOURCES argument pointing to test sources!") 27 | endif() 28 | list(GET APT_SOURCES 0 _first_source) 29 | if(NOT "${APT_PROCESSES}") 30 | set(APT_PROCESSES 1) 31 | elseif(APT_PROCESSES LESS 1) 32 | message( FATAL_ERROR 33 | "${APT_PROCESSES} processes requested in `add_parallel_test()`! An integer greater than or equal to 1 must be specified.") 34 | endif() 35 | if(APT_NAME) 36 | set(_test_name "${APT_NAME}") 37 | else() 38 | get_filename_component(_test_name "${_first_source}" NAME_WE) 39 | message( AUTHOR_WARNING "TEST name not explicitly passed to `add_parallel_test()`, using ${_test_name}") 40 | endif() 41 | 42 | add_executable("${_test_name}" ${APT_SOURCES}) 43 | set_property(TARGET ${_test_name} 44 | PROPERTY FOLDER Morfeus_FV-Tests) 45 | 46 | foreach(lib IN LISTS APT_LIBS) 47 | target_link_libraries(${_test_name} 48 | PUBLIC ${lib}) 49 | endforeach() 50 | 51 | if( MPI_FOUND ) 52 | set(_test_launch 53 | ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${APT_PROCESSES} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) 54 | target_link_libraries(${_test_name} 55 | PUBLIC MPI::MPI_Fortran) 56 | else() 57 | set(_test_launch $) 58 | endif() 59 | 60 | add_test(NAME ${_test_name} 61 | COMMAND ${_test_launch}) 62 | set_property(TEST ${_test_name} 63 | APPEND 64 | PROPERTY LABELS "MORFEUS" "MORFEUS_FV" "integration-test") 65 | set_property(TEST ${_test_name} 66 | APPEND 67 | PROPERTY PASS_REGULAR_EXPRESSION "[Tt]est [Pp]assed") 68 | set_property(TEST ${_test_name} 69 | APPEND 70 | PROPERTY PROCESSORS ${APT_PROCESSES}) 71 | if(APT_TEST_DIR) 72 | set_property(TEST ${_test_name} 73 | APPEND 74 | PROPERTY WORKING_DIRECTORY ${APT_TEST_DIR}) 75 | endif() 76 | endfunction() 77 | -------------------------------------------------------------------------------- /src/FV/cmake/uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | # Adapted from http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F May 1, 2014 8 | 9 | if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 10 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") 11 | endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 12 | 13 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 14 | string(REGEX REPLACE "\n" ";" files "${files}") 15 | foreach(file ${files}) 16 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 17 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 18 | exec_program( 19 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval 22 | ) 23 | if(NOT "${rm_retval}" STREQUAL 0) 24 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 25 | endif(NOT "${rm_retval}" STREQUAL 0) 26 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 27 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 28 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 29 | endforeach(file) 30 | -------------------------------------------------------------------------------- /src/FV/docs/install.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/install.pdf -------------------------------------------------------------------------------- /src/FV/docs/mesh_motion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/mesh_motion.pdf -------------------------------------------------------------------------------- /src/FV/docs/pdf/Fig/projection.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 3 0 7 50 -1 -1 0.000 0 1 0 0 6530.206 1871.372 2430 4635 6075 6795 10800 4365 11 | 5 1 0 3 1 7 50 -1 -1 0.000 0 0 1 0 6660.000 6930.000 9990 5445 10215 6120 10305 6840 12 | 0 0 3.00 180.00 360.00 13 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 14 | 1 1 3.00 180.00 360.00 15 | 2250 6840 11205 6840 16 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 17 | 1 1 3.00 180.00 360.00 18 | 6525 6795 6525 3690 19 | 2 1 0 3 4 7 50 -1 -1 0.000 0 0 -1 1 0 2 20 | 0 0 3.00 180.00 360.00 21 | 9990 5445 9990 6840 22 | 4 0 0 50 -1 0 32 0.0000 4 315 345 6840 4680 Y\001 23 | 4 0 0 50 -1 0 32 0.0000 4 315 345 10485 7425 X\001 24 | -------------------------------------------------------------------------------- /src/FV/docs/pdf/Fig/surfaces.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 5 0 1 0 -1 50 -1 20 0.000 0 0 -1 0 0 5 11 | 0 ../Images/surfaces.jpg 12 | 1800 1575 10059 1575 10059 7830 1800 7830 1800 1575 13 | 2 5 0 1 0 -1 50 -1 -1 0.000 0 0 -1 0 0 5 14 | 0 /home/schmidt/Codes/NEMO/trunk/docs/pdf/JPG/surfaces.jpg 15 | 1800 1575 10080 1575 10080 7830 1800 7830 1800 1575 16 | 4 0 31 50 -1 0 24 0.0000 4 240 255 7290 4500 U\001 17 | 4 0 31 50 -1 0 24 0.0000 4 240 240 8505 3735 C\001 18 | 4 0 31 50 -1 0 24 0.0000 4 240 255 7695 3690 U\001 19 | 4 0 31 50 -1 0 24 0.0000 4 240 195 9090 3510 P\001 20 | 4 0 31 50 -1 0 24 0.0000 4 240 240 3105 3150 C\001 21 | 4 0 31 50 -1 0 24 0.0000 4 240 195 5625 2295 P\001 22 | 4 0 31 50 -1 0 24 0.0000 4 240 195 4410 4500 P\001 23 | 4 0 31 50 -1 0 24 0.0000 4 240 255 4230 3735 U\001 24 | 4 0 31 50 -1 0 24 0.0000 4 240 240 3960 3420 C\001 25 | 4 0 31 50 -1 0 24 0.0000 4 240 255 3105 4275 U\001 26 | 4 0 31 50 -1 0 24 0.0000 4 240 240 9765 7425 C\001 27 | 4 0 31 50 -1 0 24 0.0000 4 240 195 9315 5445 P\001 28 | 4 0 31 50 -1 0 24 0.0000 4 240 195 2160 4590 P\001 29 | -------------------------------------------------------------------------------- /src/FV/docs/pdf/Gambit/curved_surface.dbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/pdf/Gambit/curved_surface.dbs -------------------------------------------------------------------------------- /src/FV/docs/pdf/Gambit/curved_surface.jou: -------------------------------------------------------------------------------- 1 | / Journal File for GAMBIT 2.2.30, Database 2.2.14, lnx86 BH04110220 2 | / Identifier "default_id" 3 | / File opened for write Tue Oct 3 08:12:58 2006. 4 | solver select "Generic" 5 | import gambit "/home/schmidt/run/all_tet/cyl.neu" angle 135 d3 scale 1 6 | volume summarize "f_volume.1" 7 | / File closed at Tue Oct 3 08:15:58 2006, 0.59 cpu second(s), 3143376 maximum memory. 8 | / Journal File for GAMBIT 2.3.16, Database 2.3.14, lnx86 SP2006033020 9 | / Identifier "default_id" 10 | / File opened for append Thu Apr 5 17:55:39 2007. 11 | volume create height 2 radius1 0.2 radius2 0.2 radius3 0.2 offset 0 0 1 zaxis frustum 12 | undo 13 | /Undone to: volume create height 2 radius1 0.2 radius2 0.2 radius3 0.2 offset 0 0 14 | window modify volume shade 15 | face create width 0.05 height 0.05 xyplane rectangle 16 | undo 17 | /Undone to: face create width 0.05 height 0.05 xyplane rectangle 18 | face create width 0.05 height 0.05 offset 0 0.025 0.025 yzplane rectangle 19 | face move "face.4" offset 0.1 0 0 20 | face delete "face.4" lowertopology 21 | face create width 0.1 height 0.1 yzplane rectangle 22 | face move "face.4" offset 0.1 0 0 23 | face move "face.4" offset 0 0 0.5 24 | face move "face.4" offset 0 0 0.05 25 | face move "face.4" offset 0 0 -0.02 26 | default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 1 27 | default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 0 28 | default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 1 29 | default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 0 30 | face move "face.4" offset 0 0 0.01 31 | hardcopy window 1 AND 2 AND 3 AND 4 tiff "Gambit_ImageFile.tif" 32 | save name "/home/schmidt/Codes/NEMO/trunk/docs/pdf/curved_surface.dbs" 33 | / File closed at Fri Apr 6 12:36:52 2007, 3.14 cpu second(s), 1001744 maximum memory. 34 | -------------------------------------------------------------------------------- /src/FV/docs/pdf/Gambit/curved_surface.trn: -------------------------------------------------------------------------------- 1 | / File opened for write Thu Apr 5 17:55:38 2007. 2 | 3 | *** LISTING "default_id" FILES IN DIRECTORY: 4 | . 5 | 6 | default_id.dbs 7 | default_id.jou 8 | default_id.lok 9 | default_id.trn 10 | WARN: Reading old format of database (version 2.2.14). The current version is 11 | 2.3.14, and in this format the current session will be saved. 12 | Copyright(c) 1988-2007, Fluent Inc. All rights reserved. 13 | http://www.fluent.com 14 | 15 | Gambit incorporates Simulation Modeling Suite(TM) software by Simmetrix Inc. 16 | 17 | Portions of this software are owned by Parametric Technology Corporation. 18 | Copyright(c) 2002. All Rights Reserved. 19 | 20 | Portions of this software are owned by Unigraphics Solutions Corporation or its subsidiaries. 21 | Copyright(c) 2004. All Rights Reserved. 22 | 23 | Spatial Indexing Library version 0.81b (beta) provided under GNU Lesser General Public License 24 | (http://www.gnu.org/copyleft/lesser.html) 25 | 26 | Command> volume create height 2 radius1 0.2 radius2 0.2 radius3 0.2 offset 0 0 1 zaxis frustum 27 | Created volume: volume.2 28 | Transformed volume: volume.2 29 | Command> undo 30 | Undone to: volume create height 2 radius1 0.2 radius2 0.2 radius3 0.2 offset 0 0. 31 | Command> window modify volume shade 32 | Command> face create width 0.05 height 0.05 xyplane rectangle 33 | Created face: face.4 34 | Command> undo 35 | Undone to: face create width 0.05 height 0.05 xyplane rectangle. 36 | Command> face create width 0.05 height 0.05 offset 0 0.025 0.025 yzplane rectangle 37 | Created face: face.4 38 | Command> face move "face.4" offset 0.1 0 0 39 | Transformed face: face.4 40 | Command> face delete "face.4" lowertopology 41 | Deleted face: face.4 42 | Command> face create width 0.1 height 0.1 yzplane rectangle 43 | Created face: face.4 44 | Command> face move "face.4" offset 0.1 0 0 45 | Transformed face: face.4 46 | Command> face move "face.4" offset 0 0 0.5 47 | Transformed face: face.4 48 | Command> face move "face.4" offset 0 0 0.05 49 | Transformed face: face.4 50 | Command> face move "face.4" offset 0 0 -0.02 51 | Transformed face: face.4 52 | Command> default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 1 53 | Command> default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 0 54 | Command> default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 1 55 | Command> default set "GRAPHICS.GENERAL.CONNECTIVITY_BASED_COLORING" numeric 0 56 | Command> face move "face.4" offset 0 0 0.01 57 | Transformed face: face.4 58 | Command> hardcopy window 1 AND 2 AND 3 AND 4 tiff "Gambit_ImageFile.tif" 59 | Command> save name "/home/schmidt/Codes/NEMO/trunk/docs/pdf/curved_surface.dbs" 60 | Command> end 61 | / File closed at Fri Apr 6 12:36:52 2007, 3.14 cpu second(s), 1001744 maximum memory. 62 | Total of 3.65 cpu second(s), 1001744 maximum memory. 63 | -------------------------------------------------------------------------------- /src/FV/docs/pdf/JPG/Fig/projection.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 3 0 7 50 -1 -1 0.000 0 1 0 0 6530.206 1871.372 2430 4635 6075 6795 10800 4365 11 | 5 1 0 3 1 7 50 -1 -1 0.000 0 0 1 0 6660.000 6930.000 9990 5445 10215 6120 10305 6840 12 | 0 0 3.00 180.00 360.00 13 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 14 | 1 1 3.00 180.00 360.00 15 | 2250 6840 11205 6840 16 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 17 | 1 1 3.00 180.00 360.00 18 | 6525 6795 6525 3690 19 | 2 1 0 3 4 7 50 -1 -1 0.000 0 0 -1 1 0 2 20 | 0 0 3.00 180.00 360.00 21 | 9990 5445 9990 6840 22 | 4 0 0 50 -1 0 32 0.0000 4 315 345 6840 4680 Y\001 23 | 4 0 0 50 -1 0 32 0.0000 4 315 345 10485 7425 X\001 24 | -------------------------------------------------------------------------------- /src/FV/docs/pdf/JPG/Fig/surfaces.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 5 0 1 0 -1 50 -1 20 0.000 0 0 -1 0 0 5 11 | 0 ../Images/surfaces.jpg 12 | 1800 1575 10059 1575 10059 7830 1800 7830 1800 1575 13 | 2 5 0 1 0 -1 50 -1 -1 0.000 0 0 -1 0 0 5 14 | 0 /home/schmidt/Codes/NEMO/trunk/docs/pdf/JPG/surfaces.jpg 15 | 1800 1575 10080 1575 10080 7830 1800 7830 1800 1575 16 | 4 0 31 50 -1 0 24 0.0000 4 240 255 7290 4500 U\001 17 | 4 0 31 50 -1 0 24 0.0000 4 240 240 8505 3735 C\001 18 | 4 0 31 50 -1 0 24 0.0000 4 240 255 7695 3690 U\001 19 | 4 0 31 50 -1 0 24 0.0000 4 240 195 9090 3510 P\001 20 | 4 0 31 50 -1 0 24 0.0000 4 240 240 3105 3150 C\001 21 | 4 0 31 50 -1 0 24 0.0000 4 240 195 5625 2295 P\001 22 | 4 0 31 50 -1 0 24 0.0000 4 240 195 4410 4500 P\001 23 | 4 0 31 50 -1 0 24 0.0000 4 240 255 4230 3735 U\001 24 | 4 0 31 50 -1 0 24 0.0000 4 240 240 3960 3420 C\001 25 | 4 0 31 50 -1 0 24 0.0000 4 240 255 3105 4275 U\001 26 | 4 0 31 50 -1 0 24 0.0000 4 240 240 9765 7425 C\001 27 | 4 0 31 50 -1 0 24 0.0000 4 240 195 9315 5445 P\001 28 | 4 0 31 50 -1 0 24 0.0000 4 240 195 2160 4590 P\001 29 | -------------------------------------------------------------------------------- /src/FV/docs/pdf/JPG/surfaces.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/pdf/JPG/surfaces.jpg -------------------------------------------------------------------------------- /src/FV/docs/pdf/Odg/curved_surface.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/pdf/Odg/curved_surface.odg -------------------------------------------------------------------------------- /src/FV/docs/pdf/Odg/min_max.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/pdf/Odg/min_max.odg -------------------------------------------------------------------------------- /src/FV/docs/pdf/Odg/submesh.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourceryinstitute/MORFEUS-Source/38659b1097e89e3dea8f5e7e83acf98bfe6623bd/src/FV/docs/pdf/Odg/submesh.odg -------------------------------------------------------------------------------- /src/FV/nemo-ab-notes.txt: -------------------------------------------------------------------------------- 1 | 1. Modify the USE statements to read like this: 2 | - USE PSB_BASE_MOD Everybody 3 | - USE PSB_PREC_MOD Solvers 4 | - USE PSB_KRYLOV_MOD -----ditto----- 5 | 6 | 2. Into basics. 7 | - igather is already in PSBLAS. 8 | - Interface for get_icomm is now in PSBLAS. 9 | - lbcastv has been added to PSBLAS. 10 | 11 | 3. class_connectivity 12 | - Use PSB_REALLOC to handle ALLOCATABLES. If the vector is already 13 | allocated, it reuses it. It works reliably because the allocation 14 | status of an ALLOCATABLE can be queried reliably (unless 15 | something real bad has occurred, tipically out-of-bounds writes) 16 | - It's probably a bad idea to add an interface to the ALLOCATED 17 | intrinsic! 18 | - Always use PSB_CD_ getters, don't go into DESC%whatever 19 | - Besides PSB_AMX (Maximum Absolute value) there now exists PSB_MAX 20 | - GET_ITH_CONN and its brethrens are the only ones to return 21 | POINTERS. But remember to add the TARGET attribute to the objects 22 | to be pointed to!! 23 | - in is_allocated we now have if(allocated(a2b%lookup) 24 | .or. allocated(a2b%conn) 25 | Shouldn't this be .AND. ??? Especially since in FREE_CONN we are 26 | freeing both in a single DEALLOCATE statement. 27 | The alternative would be to call free_conn anyway, and ignore in 28 | it possibly unallocated components. 29 | - SET_KT_ROW: why irow(:) is a pointer? Is there any chance to be 30 | called with an unassociated input? In which case GET_KT_ROW must 31 | be changed to explicitly return NULL.... 32 | 33 | 34 | 4. POINTERs inside subroutines. The are needed, because of the 35 | getters. However the following declaration is totally pointless 36 | integer, pointer :: ib2v(:) => null() 37 | because of the semantics of Fortran, the initialization only 38 | happens once (and it has the side effect of making the variable 39 | SAVEd), which is NOT (probably) what was intended. 40 | Contrast this to a pointer initialization in a type definition, 41 | which is executed any time a variable of that type comes into 42 | existence. 43 | 44 | 5. .F90 extension. 45 | I added this because in a few places I use the move_alloc intrinsics to 46 | have an efficient copy/reallocation of vectors. I am not sure if 47 | move_alloc is available in all compilers that also support 48 | ALLOCATABLEs arguments (strictly speaking it is not part of 49 | TR15581, it is in F2003), hence the use of 50 | #ifdef HAVE_MOVE_ALLOC 51 | Yes, actually XLF on the SP has TR 15581 but no MOVE_ALLOC. 52 | 53 | 6. On further reflection, the compilers we're interested for the time 54 | being all support MOVE_ALLOC, and F90 extension gives trouble on 55 | MAC. Take out conditionals. 56 | -------------------------------------------------------------------------------- /src/FV/prerequisites-versions: -------------------------------------------------------------------------------- 1 | export cmake_version="3.11.4" 2 | export gcc_version="8.1.0" 3 | export mpich_version="3.2.1" 4 | export metis_version="5.1.0" 5 | export hdf5_version="1.8.19" 6 | export netcdf_version="4.6.1" 7 | export cgns_version="3.3.1" 8 | export mld2p4_version="2.1.0" 9 | export psblas_version="3.5.0" 10 | export blas_version="3.8.0" 11 | -------------------------------------------------------------------------------- /src/FV/src/input/read_par_h.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: read_par_h.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | SUBMODULE (tools_input) read_par_h_implementation 46 | IMPLICIT NONE 47 | 48 | CONTAINS 49 | 50 | MODULE PROCEDURE read_par_h 51 | USE class_psblas 52 | USE tools_input, ONLY : get_par, open_file, find_section 53 | IMPLICIT NONE 54 | ! 55 | INTEGER :: icontxt, mypnum 56 | INTEGER :: inp 57 | 58 | icontxt = icontxt_() 59 | mypnum = mypnum_() 60 | 61 | 62 | IF(mypnum == 0) THEN 63 | 64 | CALL open_file(input_file,inp) 65 | CALL find_section(sec,inp) 66 | 67 | read_par_h = get_par(inp,sec,par,default) 68 | 69 | CALL psb_bcast(icontxt,read_par_h) 70 | 71 | CLOSE(inp) 72 | ELSE 73 | CALL psb_bcast(icontxt,read_par_h) 74 | END IF 75 | 76 | END PROCEDURE read_par_h 77 | 78 | END SUBMODULE read_par_h_implementation 79 | -------------------------------------------------------------------------------- /src/FV/src/input/read_par_i.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: read_par_i.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | SUBMODULE (tools_input) read_par_i_implementation 46 | IMPLICIT NONE 47 | 48 | CONTAINS 49 | 50 | MODULE PROCEDURE read_par_i 51 | USE class_psblas 52 | USE tools_input, ONLY : get_par, open_file, find_section 53 | IMPLICIT NONE 54 | ! 55 | INTEGER :: icontxt, mypnum 56 | INTEGER :: inp 57 | 58 | icontxt = icontxt_() 59 | mypnum = mypnum_() 60 | 61 | IF(mypnum == 0) THEN 62 | 63 | CALL open_file(input_file,inp) 64 | CALL find_section(sec,inp) 65 | 66 | read_par_i = get_par(inp,sec,par,default) 67 | 68 | CALL psb_bcast(icontxt,read_par_i) 69 | 70 | CLOSE(inp) 71 | ELSE 72 | CALL psb_bcast(icontxt,read_par_i) 73 | END IF 74 | 75 | END PROCEDURE read_par_i 76 | 77 | END SUBMODULE read_par_i_implementation 78 | -------------------------------------------------------------------------------- /src/FV/src/input/read_par_l.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: read_par_l.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | SUBMODULE (tools_input) read_par_l_implementation 46 | IMPLICIT NONE 47 | 48 | CONTAINS 49 | 50 | MODULE PROCEDURE read_par_l 51 | USE class_psblas 52 | USE tools_input, ONLY : get_par, open_file, find_section 53 | IMPLICIT NONE 54 | ! 55 | INTEGER :: icontxt, mypnum 56 | INTEGER :: inp 57 | 58 | icontxt = icontxt_() 59 | mypnum = mypnum_() 60 | 61 | 62 | IF(mypnum == 0) THEN 63 | 64 | CALL open_file(input_file,inp) 65 | CALL find_section(sec,inp) 66 | 67 | read_par_l = get_par(inp,sec,par,default) 68 | 69 | CALL psb_bcast(icontxt,read_par_l) 70 | 71 | CLOSE(inp) 72 | ELSE 73 | CALL psb_bcast(icontxt,read_par_l) 74 | END IF 75 | 76 | END PROCEDURE read_par_l 77 | 78 | END SUBMODULE read_par_l_implementation 79 | -------------------------------------------------------------------------------- /src/FV/src/material/load_material.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: load_material.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | SUBMODULE(tools_material) load_material_implementation 46 | IMPLICIT NONE 47 | 48 | CONTAINS 49 | 50 | MODULE PROCEDURE load_material 51 | USE mat_copper, ONLY : load_copper 52 | USE mat_water, ONLY : load_water 53 | 54 | IMPLICIT NONE 55 | 56 | ! REMARK: remove after inserting the first liquid/gaseous material 57 | 58 | SELECT CASE(name) 59 | CASE('copper') 60 | CALL load_copper(state,dtemp,tmin,tmax,rho,lambda,sh) 61 | CASE('water') 62 | CALL load_water(state,dtemp,tmin,tmax,rho,mu,lambda,sh) 63 | CASE DEFAULT 64 | WRITE(*,100) 65 | END SELECT 66 | 67 | 100 FORMAT(' ERROR! Unsupported material name in LOAD_MATERIAL') 68 | 69 | END PROCEDURE load_material 70 | 71 | END SUBMODULE load_material_implementation 72 | -------------------------------------------------------------------------------- /src/FV/src/material/mat_copper.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: mat_copper.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! Physical properties of copper and its alloys 44 | ! 45 | MODULE mat_copper 46 | 47 | USE class_psblas 48 | 49 | IMPLICIT NONE 50 | 51 | INTERFACE 52 | MODULE SUBROUTINE load_copper(state,dtemp,tmin,tmax,rho,lambda,sh) 53 | IMPLICIT NONE 54 | CHARACTER(len=1), INTENT(OUT) :: state 55 | REAL(psb_dpk_), INTENT(OUT) :: dtemp, tmin, tmax 56 | REAL(psb_dpk_), ALLOCATABLE, INTENT(OUT) :: rho(:), lambda(:), sh(:) 57 | END SUBROUTINE load_copper 58 | END INTERFACE 59 | 60 | END MODULE mat_copper 61 | -------------------------------------------------------------------------------- /src/FV/src/material/mat_water.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: mat_water.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! Physical properties of water at environment pressure 44 | ! 45 | MODULE mat_water 46 | 47 | USE class_psblas 48 | 49 | IMPLICIT NONE 50 | 51 | INTERFACE 52 | MODULE SUBROUTINE load_water(state,dtemp,tmin,tmax,rho,mu,lambda,sh) 53 | CHARACTER(len=1), INTENT(OUT) :: state 54 | REAL(psb_dpk_), INTENT(OUT) :: dtemp, tmin, tmax 55 | REAL(psb_dpk_), ALLOCATABLE, INTENT(OUT) :: rho(:), mu(:), lambda(:), sh(:) 56 | END SUBROUTINE load_water 57 | END INTERFACE 58 | 59 | END MODULE mat_water 60 | -------------------------------------------------------------------------------- /src/FV/src/math/lin_interp_implementation.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | SUBMODULE (tools_math) lin_interp_implementation 41 | IMPLICIT NONE 42 | 43 | CONTAINS 44 | 45 | MODULE PROCEDURE lin_interp_s 46 | USE class_psblas, ONLY : psb_dpk_ 47 | IMPLICIT NONE 48 | !! $Id: lin_interp.f90 2469 2007-10-08 10:34:43Z sfilippo $ 49 | !! 50 | !! Description: 51 | !! Evaluates linear interpolation. REAL(psb_dpk_) type. 52 | !! LIN_INTERP = FAC * F1 + (1 - FAC) * F2 53 | !! 54 | 55 | lin_interp_s = fac * f1 + (1.d0 - fac) * f2 56 | 57 | END PROCEDURE lin_interp_s 58 | 59 | 60 | MODULE PROCEDURE lin_interp_v 61 | USE class_psblas, ONLY : psb_dpk_ 62 | USE class_vector, ONLY : OPERATOR(*), OPERATOR(+) 63 | IMPLICIT NONE 64 | !! Description: 65 | !! Evaluates linear interpolation. VECTOR type. 66 | !! LIN_INTERP = FAC * F1 + (1 - FAC) * F2 67 | !! 68 | 69 | lin_interp_v = fac * f1 + (1.d0 - fac) * f2 70 | 71 | END PROCEDURE lin_interp_v 72 | 73 | END SUBMODULE lin_interp_implementation 74 | -------------------------------------------------------------------------------- /src/FV/src/mesh/part_block.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: part_block.f90 8157 2014-10-09 13:02:44Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! Block partitioning 44 | ! 45 | MODULE part_block 46 | 47 | USE class_psblas 48 | 49 | IMPLICIT NONE 50 | 51 | INTERFACE 52 | 53 | MODULE SUBROUTINE bld_part_block(ncells,nprocs,part) 54 | IMPLICIT NONE 55 | INTEGER, INTENT(IN) :: ncells, nprocs 56 | INTEGER, ALLOCATABLE, INTENT(OUT) :: part(:) 57 | END SUBROUTINE bld_part_block 58 | 59 | END INTERFACE 60 | 61 | END MODULE part_block 62 | -------------------------------------------------------------------------------- /src/FV/src/mesh/part_random.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: part_random.f90 8157 2014-10-09 13:02:44Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! Random partitioning 44 | ! 45 | MODULE part_random 46 | 47 | USE class_psblas 48 | 49 | IMPLICIT NONE 50 | 51 | PRIVATE 52 | PUBLIC :: bld_part_random 53 | 54 | INTERFACE 55 | 56 | MODULE SUBROUTINE bld_part_random(ncells,nprocs,part) 57 | IMPLICIT NONE 58 | INTEGER, INTENT(IN) :: ncells, nprocs 59 | INTEGER, ALLOCATABLE, INTENT(OUT) :: part(:) 60 | END SUBROUTINE bld_part_random 61 | 62 | END INTERFACE 63 | 64 | END MODULE part_random 65 | -------------------------------------------------------------------------------- /src/FV/src/mesh_basics/geom_tet_center.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: geom_tet_center.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! Evaluates the center coordinates for a tetraedron defined by its four vertices 44 | ! coordinates, by means of exact formulas. 45 | ! 46 | SUBMODULE(tools_mesh_basics) geom_tet_center_implementation 47 | IMPLICIT NONE 48 | 49 | CONTAINS 50 | 51 | MODULE PROCEDURE geom_tet_center 52 | USE class_vertex, ONLY : OPERATOR(+), OPERATOR(*) 53 | IMPLICIT NONE 54 | !! Computes center of mass 55 | 56 | geom_tet_center = 0.25d0 * (v1 + v2 + v3 + v4) 57 | 58 | END PROCEDURE geom_tet_center 59 | 60 | END SUBMODULE geom_tet_center_implementation 61 | -------------------------------------------------------------------------------- /src/FV/src/mesh_basics/geom_tet_volume.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id$ 41 | ! 42 | ! Description: 43 | ! Evaluates the volume of a tetraedron defined by its four vertices coordinates, 44 | ! by means of exact formulas. 45 | ! 46 | SUBMODULE(tools_mesh_basics) geom_tet_volume_implementation 47 | IMPLICIT NONE 48 | 49 | CONTAINS 50 | 51 | MODULE PROCEDURE geom_tet_volume 52 | USE class_psblas, ONLY : psb_dpk_ 53 | USE class_vector, ONLY : vector 54 | USE class_vertex 55 | 56 | IMPLICIT NONE 57 | ! 58 | REAL(psb_dpk_), PARAMETER :: one_sixth = 1.d0 / 6.d0 59 | TYPE(vector) :: v12, v13, v14 60 | 61 | v12 = v2 - v1 62 | v13 = v3 - v1 63 | v14 = v4 - v1 64 | 65 | geom_tet_volume = ((v12 .cross. v13) .dot. v14) * one_sixth 66 | 67 | END PROCEDURE geom_tet_volume 68 | 69 | END SUBMODULE geom_tet_volume_implementation 70 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/OptMS.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifndef SM_EXTERNAL_FUNC_H 10 | #define SM_EXTERNAL_FUNC_H 1 11 | 12 | #include "SMuserDefs.h" 13 | #include "SMerror.h" 14 | 15 | /* EXTERNAL FUNCTIONS */ 16 | /* functions needed in the user code */ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | /* Initialization Routines */ 22 | int SMinitSmoothing(int argc, char** argv, int dimension, 23 | int technique, int FunctionID, double AcceptFunction, 24 | void **smooth_data); 25 | int SMsetProblemDimension(void *smooth_data, int dimension); 26 | int SMsetSmoothTechnique(void *smooth_data, int technique); 27 | int SMinitGlobalMinValue(void *smooth_data); 28 | int SMsetSmoothThreshold(void *smooth_data, double accept); 29 | int SMsetSmoothFunction(void *smooth_data, int FunctionID); 30 | int SMsetUntangleTechnique(void *smooth_data, int technique); 31 | 32 | /* Mesh Improvement Routines */ 33 | int SMsmooth(int num_pts, int num_tet, double *free_vtx, 34 | double **vtx_list, int **vtx_connectivity, 35 | void *smooth_data); 36 | 37 | int SMuntangle(int num_pts, int num_tet, double *free_vtx, 38 | double **vtx_list, int **vtx_connectivity, 39 | void *smooth_data); 40 | 41 | /* void SMsetUserQualityFunction2D(void *ext_smooth_data, 42 | int values_per_tri, 43 | SMfunction_ptr2D userQualityFunc, 44 | SMgradfunc_ptr2D userQualityGrad); 45 | */ 46 | 47 | /* Statistics Routines */ 48 | int SMinitSmoothStats(void *smooth_data); 49 | int SMprintSmoothStats(void *smooth_data); 50 | 51 | /* Quality Routines */ 52 | int SMinitQualityTable(void *smooth_data); 53 | int SMaccumulateQualityInformation(void *smooth_data, double **vtx); 54 | int SMprintQualityInformation(void *smooth_data); 55 | int SMisValidMesh(void *smooth_data, int *valid); 56 | int SMsetMeshValidity(int mesh_validity, void *ext_smooth_data); 57 | 58 | /* Clean-up routines */ 59 | int SMfinalizeSmoothing(void *smooth_data); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMerror.c: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #include 10 | #ifdef WIN32 11 | #define _USE_MATH_DEFINES 12 | #endif 13 | #include 14 | #include "SMsmooth.h" 15 | 16 | #undef __FUNC__ 17 | #define __FUNC__ "SMerror" 18 | int SMerror(int line,char *func,char* file,char *dir,int n,int p,char *mess) 19 | { 20 | if (mess) { 21 | fprintf(stderr,"OPT-MS ERROR: %s\n",mess); 22 | } 23 | 24 | switch(n){ 25 | case OPTMS_MEM_ERR: 26 | fprintf(stderr,"OPT-MS ERROR: Out of memory. \n"); break; 27 | case OPTMS_NULL_ERR: 28 | fprintf(stderr,"OPT-MS ERROR: Null pointer. \n"); break; 29 | case OPTMS_INIT_ERR: 30 | fprintf(stderr,"OPT-MS ERROR: Data Structure Not Initialized. \n"); break; 31 | case OPTMS_INPUT_ERR: 32 | fprintf(stderr,"OPT-MS ERROR: Incorrect Input \n"); break; 33 | case OPTMS_FILE_OPEN_ERR: 34 | fprintf(stderr,"OPT-MS ERROR: File open error \n"); break; 35 | case OPTMS_FREE_ERR: 36 | fprintf(stderr,"OPT-MS ERROR: Error freeing memory \n"); break; 37 | case OPTMS_INVALID_MESH_ERR: 38 | fprintf(stderr,"OPT-MS ERROR: Invalid Mesh; use SMuntangle to create a valid mesh prior to smoothing \n"); break; 39 | case OPTMS_DIVIDE_BY_ZERO_ERR: 40 | fprintf(stderr,"OPT-MS ERROR: Division by zero \n"); break; 41 | case OPTMS_DATA_ERR: 42 | fprintf(stderr,"OPT-MS ERROR: Incorrect data \n"); break; 43 | } 44 | 45 | n = OPTMS_PRINT_STACK; /* set it to print the stack */ 46 | 47 | fprintf(stderr,"OPT-MS ERROR: %s() line %d in %s/%s\n",func,line,dir,file); 48 | 49 | return(n); 50 | } 51 | 52 | #undef __FUNC__ 53 | #define __FUNC__ "SMwrite_ordered_points" 54 | int SMwrite_ordered_points(SMlocal_mesh *local_mesh) 55 | { 56 | FILE *fp; 57 | int i99,j99; 58 | 59 | if ((fp = fopen("debug.ascii","w")) == NULL) { 60 | OPTMS_SETERR(OPTMS_FILE_OPEN_ERR,0,"Can't open debug.ascii for writing"); 61 | } 62 | 63 | fprintf(fp,"%d %d\n",local_mesh->num_incident_vtx, local_mesh->num_tri); 64 | for (i99=0;i99dimension;i99++) 65 | fprintf(fp,"%f ",local_mesh->original_pt[i99]); 66 | fprintf(fp,"\n"); 67 | for (i99=0;i99num_incident_vtx;i99++) { 68 | for (j99=0;j99dimension;j99++) 69 | fprintf(fp,"%f ",local_mesh->incident_vtx[i99][j99]); 70 | fprintf(fp,"\n"); 71 | } 72 | for (i99=0;i99num_tri;i99++) { 73 | for (j99=0;j99dimension;j99++) 74 | fprintf(fp,"%d ",local_mesh->vtx_connectivity[i99][j99]); 75 | fprintf(fp,"\n"); 76 | } 77 | return(0); 78 | } 79 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #if !defined(__SM_ERROR_H) 10 | #define __SM_ERROR_H 11 | 12 | /* 13 | Defines the directory where the compiled source is located; used 14 | in printing error messages. Each makefile has an entry 15 | LOCDIR = thedirectory 16 | and bmake/common includes in CFLAGS -D__SDIR__='"${LOCDIR}"' 17 | which is a flag passed to the compilers. 18 | */ 19 | #if !defined(__SDIR__) 20 | #define __SDIR__ "unknowndirectory/" 21 | #endif 22 | 23 | /* 24 | Defines the function where the compiled source is located; used 25 | in printing error messages. 26 | */ 27 | #if !defined(__FUNC__) 28 | #define __FUNC__ "unknownfunction" 29 | #endif 30 | 31 | /* Error Routines - Accessed through OPTMS_CHKERR(ierr) */ 32 | int SMerror(int line,char *func,char* file,char *dir,int n,int p,char *mess); 33 | 34 | /* 35 | These are the generic error codes. These error codes are used 36 | many different places in the PETSc source code. 37 | 38 | */ 39 | #define OPTMS_PRINT_STACK -1 40 | 41 | #define OPTMS_MEM_ERR 55 /* unable to allocate the requested memory */ 42 | #define OPTMS_NULL_ERR 56 /* null data pointer */ 43 | #define OPTMS_INPUT_ERR 57 /* something is wrong with input to function */ 44 | #define OPTMS_INIT_ERR 58 /* data structure not initialized */ 45 | #define OPTMS_FILE_OPEN_ERR 59 /* unable to open file */ 46 | #define OPTMS_FREE_ERR 60 /* unable to free memory */ 47 | #define OPTMS_INVALID_MESH_ERR 61 /* unable to free memory */ 48 | #define OPTMS_DIVIDE_BY_ZERO_ERR 62 /* division by zero */ 49 | #define OPTMS_DATA_ERR 63 /* incorrect data */ 50 | 51 | #define OPTMS_SETERR(n,p,s) {return SMerror(__LINE__,__FUNC__,__FILE__,__SDIR__,n,p,s);} 52 | #define OPTMS_CHKERR(n) {if (n) OPTMS_SETERR(n,0,(char *)0);} 53 | 54 | #ifndef OPTMS_CHECK_NULL 55 | #define OPTMS_CHECK_NULL(a) \ 56 | { \ 57 | if (a==NULL) OPTMS_CHKERR(OPTMS_NULL_ERR); \ 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMintrinsic.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifndef SM_INTRINSIC_H 10 | #define SM_INTRINSIC_H 1 11 | 12 | #ifndef ad_intrinsic_h 13 | #define ad_intrinsic_h 1 14 | 15 | #ifdef IN_AD_INTRINSIC_C 16 | #define EXTERN 17 | #else 18 | #define EXTERN extern 19 | #endif 20 | 21 | 22 | #ifdef __STDC__ 23 | #define USE_PROTOTYPES 24 | #define USE_FN_ARGS 25 | #endif 26 | 27 | /* Maybe some C++ does not define __STDC__ ? */ 28 | 29 | #ifdef __cplusplus 30 | #define USE_PROTOTYPES 31 | #define USE_FN_ARGS 32 | #endif 33 | 34 | #ifdef USE_PROTOTYPES 35 | #define Proto(x) x 36 | #else 37 | #define Proto(x) () 38 | #endif 39 | 40 | #define ONE_ARG_FN(x) EXTERN void x Proto((DERIV_TYPE *,DERIV_TYPE)) 41 | #define TWO_ARG_FN(x) EXTERN void x Proto((DERIV_TYPE *,DERIV_TYPE, DERIV_TYPE)) 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | ONE_ARG_FN (g_ad_log); 48 | ONE_ARG_FN (g_ad_sqrt); 49 | ONE_ARG_FN (g_ad_cos); 50 | ONE_ARG_FN (g_ad_sin); 51 | ONE_ARG_FN (g_ad_exp); 52 | TWO_ARG_FN (g_ad_pow); 53 | TWO_ARG_FN (g_ad_fmin); 54 | TWO_ARG_FN (g_ad_fmax); 55 | ONE_ARG_FN (g_ad_fabs); 56 | ONE_ARG_FN (g_ad_acos); 57 | ONE_ARG_FN (g_ad_atan); 58 | TWO_ARG_FN (g_ad_atan2); 59 | 60 | #ifdef __cplusplus 61 | } /* end extern "C" */ 62 | #endif 63 | 64 | #undef EXTERN 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMlog_reg.c: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #include 10 | #include "SMsmooth.h" 11 | 12 | #undef __FUNC__ 13 | #define __FUNC__ "SMregisterEvents" 14 | int SMregisterEvents() 15 | { 16 | int ierr; 17 | #ifdef SUMAA_LOG 18 | /* register the smoothing events */ 19 | SUMAA_LOG_EVENT_REGISTER(__SM_TOTAL__,"Total Time"); 20 | SUMAA_LOG_EVENT_REGISTER(__SM_SMOOTH__,"Smooth"); 21 | SUMAA_LOG_EVENT_REGISTER(__SM_SMOOTH_INIT__,"Init Smooth"); 22 | SUMAA_LOG_EVENT_REGISTER(__SM_INIT__,"Initialize"); 23 | SUMAA_LOG_EVENT_REGISTER(__SM_SMOOTH_OPT__,"Optimize"); 24 | SUMAA_LOG_EVENT_REGISTER(__SM_FUNCTION__,"Function"); 25 | SUMAA_LOG_EVENT_REGISTER(__SM_GRADIENT__,"Gradient"); 26 | SUMAA_LOG_EVENT_REGISTER(__SM_FIND_ACTIVE__,"Find Active Set"); 27 | SUMAA_LOG_EVENT_REGISTER(__SM_COMP_ALPHA__,"Comp Alpha"); 28 | SUMAA_LOG_EVENT_REGISTER(__SM_SEARCH__,"Search Dir"); 29 | SUMAA_LOG_EVENT_REGISTER(__SM_STEP_ACCEPT__,"Step Accept"); 30 | SUMAA_LOG_EVENT_REGISTER(__SM_MIN_EST__,"Est Min Imp"); 31 | SUMAA_LOG_EVENT_REGISTER(__SM_EDGE_FACE__,"Edge/Face Srch"); 32 | SUMAA_LOG_EVENT_REGISTER(__SM_CHK_EQUIL__,"Chk Equil"); 33 | SUMAA_LOG_EVENT_REGISTER(__SM_CUSP__,"Step Cusp"); 34 | SUMAA_LOG_EVENT_REGISTER(__SM_SMOOTH_FINAL__,"End Smooth"); 35 | SUMAA_LOG_EVENT_REGISTER(__SM_VALID__,"Valid"); 36 | SUMAA_LOG_EVENT_REGISTER(__SM_INIT_STATS__,"Init Stats"); 37 | SUMAA_LOG_EVENT_REGISTER(__SM_GRAD_PROJ__,"Grad Proj"); 38 | SUMAA_LOG_EVENT_REGISTER(__SM_GET_ACTIVE__,"Get Active Dir"); 39 | SUMAA_LOG_EVENT_REGISTER(__SM_VERT_STEP__,"Vert Step"); 40 | SUMAA_LOG_EVENT_REGISTER(__SM_FORM_GRAM__,"Form Grammian"); 41 | SUMAA_LOG_EVENT_REGISTER(__SM_FORM_PDG__,"Form PDG"); 42 | SUMAA_LOG_EVENT_REGISTER(__SM_FORM_REDUCED__,"Form Reduced"); 43 | SUMAA_LOG_EVENT_REGISTER(__SM_SOLVE_2__,"Solve 2x2"); 44 | SUMAA_LOG_EVENT_REGISTER(__SM_SOLVE_3__,"Solve 3x3"); 45 | SUMAA_LOG_EVENT_REGISTER(__SM_NONSING_TEST__,"NonSing Test"); 46 | SUMAA_LOG_EVENT_REGISTER(__SM_COPY_FCN__,"Copy Fcn"); 47 | SUMAA_LOG_EVENT_REGISTER(__SM_COPY_ACT__,"Copy Act"); 48 | SUMAA_LOG_EVENT_REGISTER(__SM_LAP_SMOOTH__,"Lap Smooth"); 49 | SUMAA_LOG_EVENT_REGISTER(__SM_UNTANGLE__,"Untangle"); 50 | SUMAA_LOG_EVENT_REGISTER(__SM_PHASE1__,"Phase 1 Soln"); 51 | SUMAA_LOG_EVENT_REGISTER(__SM_LINEAR_PROG__,"LP Solve"); 52 | SUMAA_LOG_EVENT_REGISTER(__SM_LP_ITER__,"LP Iter"); 53 | #endif 54 | return(ierr=0); 55 | } 56 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMorient.c: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifdef WIN32 10 | #define _USE_MATH_DEFINES 11 | #endif 12 | #include 13 | 14 | /* 3D orientation predicate, without exact arithmetic */ 15 | #undef __FUNC__ 16 | #define __FUNC__ "Orient3D" 17 | int iOrient3D(const double adLocA[3], const double adLocB[3], 18 | const double adLocC[3], const double adLocD[3]) 19 | /* Returns 1 if tet ABCD is right-handed, -1 if it's left-handed, 20 | and 0 if it's essentially a tie. */ 21 | { 22 | double dXa = adLocA[0]; 23 | double dYa = adLocA[1]; 24 | double dZa = adLocA[2]; 25 | 26 | double dXb = adLocB[0]; 27 | double dYb = adLocB[1]; 28 | double dZb = adLocB[2]; 29 | 30 | double dXc = adLocC[0]; 31 | double dYc = adLocC[1]; 32 | double dZc = adLocC[2]; 33 | 34 | double dXd = adLocD[0]; 35 | double dYd = adLocD[1]; 36 | double dZd = adLocD[2]; 37 | 38 | double dDX2 = dXb - dXa; 39 | double dDX3 = dXc - dXa; 40 | double dDX4 = dXd - dXa; 41 | 42 | double dDY2 = dYb - dYa; 43 | double dDY3 = dYc - dYa; 44 | double dDY4 = dYd - dYa; 45 | 46 | double dDZ2 = dZb - dZa; 47 | double dDZ3 = dZc - dZa; 48 | double dDZ4 = dZd - dZa; 49 | 50 | /* dDet is proportional to the cell volume */ 51 | double dDet = dDX2*dDY3*dDZ4 + dDX3*dDY4*dDZ2 + dDX4*dDY2*dDZ3 52 | - dDZ2*dDY3*dDX4 - dDZ3*dDY4*dDX2 - dDZ4*dDY2*dDX3 ; 53 | 54 | /* Compute a length scale based on edge lengths. */ 55 | double dScale = ( sqrt((dXa-dXb)*(dXa-dXb) + (dYa-dYb)*(dYa-dYb) + 56 | (dZa-dZb)*(dZa-dZb)) + 57 | sqrt((dXa-dXc)*(dXa-dXc) + (dYa-dYc)*(dYa-dYc) + 58 | (dZa-dZc)*(dZa-dZc)) + 59 | sqrt((dXa-dXd)*(dXa-dXd) + (dYa-dYd)*(dYa-dYd) + 60 | (dZa-dZd)*(dZa-dZd)) + 61 | sqrt((dXb-dXc)*(dXb-dXc) + (dYb-dYc)*(dYb-dYc) + 62 | (dZb-dZc)*(dZb-dZc)) + 63 | sqrt((dXb-dXd)*(dXb-dXd) + (dYb-dYd)*(dYb-dYd) + 64 | (dZb-dZd)*(dZb-dZd)) + 65 | sqrt((dXc-dXd)*(dXc-dXd) + (dYc-dYd)*(dYc-dYd) + 66 | (dZc-dZd)*(dZc-dZd)) ) / 6.; 67 | 68 | double dEps = 1.e-13; 69 | 70 | /* Use the length scale to get a better idea if the tet is flat or 71 | just really small. */ 72 | dDet /= (dScale*dScale*dScale); 73 | 74 | if (dDet > dEps) 75 | return (1); 76 | else if (dDet < -dEps) 77 | return (-1); 78 | else 79 | return (0); 80 | } 81 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMqual_func.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifndef SM_QUAL_FUNC_H 10 | #define SM_QUAL_FUNC_H 1 11 | 12 | typedef int (*SMfunction_ptr2D)(double *, double *, double *, double *, int *); 13 | typedef int (*SMgradfunc_ptr2D)(double *, double *, double *, double **, int *); 14 | 15 | typedef int (*SMfunction_ptr3D)(const double adCoord0[3], 16 | const double adCoord1[3], const double adCoord2[3], 17 | const double adCoord3[3], double *adResult, 18 | int* const piNGradient); 19 | 20 | typedef int (*SMgradfunc_ptr3D)(const double adCoord0[3], 21 | const double adCoord1[3],const double adCoord2[3], 22 | const double adCoord3[3],double **adGradient, 23 | int* const piNGradient); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMsmooth.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifndef SMOOTH_H 10 | #define SMOOTH_H 1 11 | 12 | /* define the structures associated with both geometric and octree 13 | representations of geometric entities... the void data type allows 14 | us to switch contexts 15 | */ 16 | 17 | #ifdef SUMAA_LOG 18 | #include "SUMAA_log.h" 19 | #endif 20 | #if defined (IRIX)||(IRIX32)||(IRIX64) 21 | #include 22 | #include 23 | #endif 24 | #include "SMqual_func.h" 25 | #include "SMerror.h" 26 | #include "SMdefs.h" 27 | #include "SMinternalFunction.h" 28 | #include "SMlog.h" 29 | #include "OptMS.h" 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/SMuserDefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifndef SM_USER_DEFS_H 10 | #define SM_USER_DEFS_H 11 | 12 | #define OPTMS_DEFAULT -1 13 | 14 | /* 2D function/gradient options included with Opt-MS 15 | The default is MAX_MIN_SINE */ 16 | #define OPTMS_MAX_MIN_ANGLE 1 17 | #define OPTMS_MIN_MAX_COSINE 2 18 | #define OPTMS_MAX_MIN_COSINE 3 19 | #define OPTMS_MAX_MIN_SINE 4 20 | #define OPTMS_MIN_MAX_ANGLE 5 21 | #define OPTMS_MIN_MAX_JACOBIAN_DIFF 6 22 | #define OPTMS_MAX_MIN_SCALED_JACOBIAN 7 23 | #define OPTMS_MAX_MIN_AREA_LENGTH_RATIO 8 24 | #define OPTMS_MIN_MAX_LENGTH_AREA_RATIO 9 25 | #define OPTMS_MAX_MIN_INTERIOR_ANGLE 10 26 | #define OPTMS_MAX_MIN_INTERIOR_SINE 11 27 | #define OPTMS_MIN_MAX_INTERIOR_COSINE 12 28 | #define OPTMS_MAX_MIN_INTERIOR_SCALED_JACOBIAN 13 29 | #define OPTMS_MIN_MAX_NORM_JAC_SQUARED_2D 14 30 | #define OPTMS_MIN_MAX_CONDITION_2D 15 31 | #define OPTMS_FUNCTION2D_DEFAULT 4 32 | 33 | /* 3D function/gradient options included with Opt-MS 34 | The default is MAX_SINE_DIHEDRAL */ 35 | #define OPTMS_MAX_MIN_DIHEDRAL 21 36 | #define OPTMS_MIN_MAX_DIHEDRAL 22 37 | #define OPTMS_MAX_MIN_COSINE_DIHEDRAL 23 38 | #define OPTMS_MIN_MAX_COSINE_DIHEDRAL 24 39 | #define OPTMS_MAX_SINE_DIHEDRAL 25 40 | #define OPTMS_MAX_MIN_SCALED_JACOBIAN_3D 26 41 | #define OPTMS_MIN_MAX_SRMS_VOLUME_RATIO 27 42 | #define OPTMS_MIN_MAX_CONDITION_3D 28 43 | #define OPTMS_MIN_MAX_NORM_JAC_SQUARED_3D 29 44 | #define OPTMS_FUNCTION3D_DEFAULT 25 45 | 46 | /* user interface to the smoothing techniques */ 47 | #define OPTMS_LAPLACIAN_ONLY 1 48 | #define OPTMS_SMART_LAPLACIAN_ONLY 2 49 | #define OPTMS_OPTIMIZATION_ONLY 3 50 | #define OPTMS_COMBINED 4 51 | #define OPTMS_COMBINED1 5 52 | #define OPTMS_COMBINED2 6 53 | #define OPTMS_COMBINED3 7 54 | #define OPTMS_FLOATING_THRESHOLD 8 55 | #define OPTMS_TECHNIQUE_DEFAULT 4 56 | 57 | /* untangling techniques */ 58 | #define OPTMS_LAPLACIAN_ONLY 1 59 | #define OPTMS_LINEAR_PROGRAM_ONLY 2 60 | #define OPTMS_COMBINED_UNTANGLING 3 61 | #define OPTMS_UNTANGLING_DEFAULT 2 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/OptMS/wininclude/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | #ifndef _UNISTD_H 10 | #define _UNISTD_H 1 11 | 12 | /* This is intended as a drop-in replacement for unistd.h on Windows. 13 | * https://stackoverflow.com/a/826027/1202830 14 | */ 15 | 16 | #include 17 | #include 18 | // Skip getopt.h since it's not native and we don't need it 19 | #include /* for getpid() and the exec..() family */ 20 | #include /* for _getcwd() and _chdir() */ 21 | 22 | #define srandom srand 23 | #define random rand 24 | 25 | /* Values for the second argument to access. 26 | These may be OR'd together. */ 27 | #define R_OK 4 /* Test for read permission. */ 28 | #define W_OK 2 /* Test for write permission. */ 29 | //#define X_OK 1 /* execute permission - unsupported in windows*/ 30 | #define F_OK 0 /* Test for existence. */ 31 | 32 | #define access _access 33 | #define dup2 _dup2 34 | #define execve _execve 35 | #define ftruncate _chsize 36 | #define unlink _unlink 37 | #define fileno _fileno 38 | #define getcwd _getcwd 39 | #define chdir _chdir 40 | #define isatty _isatty 41 | #define lseek _lseek 42 | /* read, write, and close are NOT being #defined here, because while there are file handle specific versions for Windows, they probably don't work for sockets. You need to look at your app and consider whether to call e.g. closesocket(). */ 43 | 44 | #ifdef _WIN64 45 | #define ssize_t __int64 46 | #else 47 | #define ssize_t long 48 | #endif 49 | 50 | #define STDIN_FILENO 0 51 | #define STDOUT_FILENO 1 52 | #define STDERR_FILENO 2 53 | /* should be in some equivalent to */ 54 | typedef __int8 int8_t; 55 | typedef __int16 int16_t; 56 | typedef __int32 int32_t; 57 | typedef __int64 int64_t; 58 | typedef unsigned __int8 uint8_t; 59 | typedef unsigned __int16 uint16_t; 60 | typedef unsigned __int32 uint32_t; 61 | typedef unsigned __int64 uint64_t; 62 | 63 | #endif /* unistd.h */ 64 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/call_smooth2d.h: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | 10 | int call_smooth2d(int *num_incident_vtx, int *num_incident_tri, 11 | double *free_pos,double incident_vtx[][2], 12 | int vtx_connectivity[][2],int *tangled); 13 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/freeoptms.c: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | /* 10 | ! 11 | ! NEMO - Numerical Engine (for) Multiphysics Operators 12 | ! Copyright (c) 2007, Stefano Toninel 13 | ! Gian Marco Bianchi University of Bologna 14 | ! David P. Schmidt University of Massachusetts - Amherst 15 | ! Salvatore Filippone University of Rome Tor Vergata 16 | ! All rights reserved. 17 | ! 18 | ! Redistribution and use in source and binary forms, with or without modification, 19 | ! are permitted provided that the following conditions are met: 20 | ! 21 | ! 1. Redistributions of source code must retain the above copyright notice, 22 | ! this list of conditions and the following disclaimer. 23 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 24 | ! this list of conditions and the following disclaimer in the documentation 25 | ! and/or other materials provided with the distribution. 26 | ! 3. Neither the name of the NEMO project nor the names of its contributors 27 | ! may be used to endorse or promote products derived from this software 28 | ! without specific prior written permission. 29 | ! 30 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 31 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 32 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 33 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 34 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 35 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 37 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 39 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | ! 41 | !--------------------------------------------------------------------------------- 42 | ! 43 | ! $Id: freeoptms.c 3064 2008-04-11 16:29:54Z sfilippo $ 44 | ! 45 | ! Description: 46 | ! calls the function that frees data allocated by OptMS 47 | */ 48 | 49 | #include 50 | #include 51 | #include "OptMS.h" 52 | 53 | #ifdef LowerCase 54 | #define freeoptms freeoptms 55 | #endif 56 | #ifdef LowerUnderscore 57 | #define freeoptms freeoptms_ 58 | #endif 59 | #ifdef LowerDoubleUnderscore 60 | #define freeoptms freeoptms_ 61 | #endif 62 | #ifdef UpperCase 63 | #define freeoptms FREEOPTMS 64 | #endif 65 | #ifdef UpperUndescore 66 | #define freeoptms FREEOPTMS_ 67 | #endif 68 | #ifdef UpperDoubleUnderscore 69 | #define freeoptms FREEOPTMS_ 70 | #endif 71 | 72 | int freeoptms() 73 | { 74 | extern void *smooth_data; 75 | SMfinalizeSmoothing((void *)smooth_data); 76 | 77 | return (0); 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/FV/src/mesh_optimize/freeoptms2d.c: -------------------------------------------------------------------------------- 1 | /* 2 | ! 3 | ! (c) 2019 Guide Star Engineering, LLC 4 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 5 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 6 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 7 | ! 8 | */ 9 | /* 10 | ! 11 | ! NEMO - Numerical Engine (for) Multiphysics Operators 12 | ! Copyright (c) 2007, Stefano Toninel 13 | ! Gian Marco Bianchi University of Bologna 14 | ! David P. Schmidt University of Massachusetts - Amherst 15 | ! Salvatore Filippone University of Rome Tor Vergata 16 | ! All rights reserved. 17 | ! 18 | ! Redistribution and use in source and binary forms, with or without modification, 19 | ! are permitted provided that the following conditions are met: 20 | ! 21 | ! 1. Redistributions of source code must retain the above copyright notice, 22 | ! this list of conditions and the following disclaimer. 23 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 24 | ! this list of conditions and the following disclaimer in the documentation 25 | ! and/or other materials provided with the distribution. 26 | ! 3. Neither the name of the NEMO project nor the names of its contributors 27 | ! may be used to endorse or promote products derived from this software 28 | ! without specific prior written permission. 29 | ! 30 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 31 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 32 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 33 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 34 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 35 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 37 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 39 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | ! 41 | !--------------------------------------------------------------------------------- 42 | ! 43 | ! $Id: freeoptms2d.c 3064 2008-04-11 16:29:54Z sfilippo $ 44 | ! 45 | ! Description: 46 | ! calls the function that frees data allocated by OptMS 47 | */ 48 | 49 | #include 50 | #include 51 | #include "OptMS.h" 52 | 53 | #ifdef LowerCase 54 | #define freeoptms2d freeoptms2d 55 | #endif 56 | #ifdef LowerUnderscore 57 | #define freeoptms2d freeoptms2d_ 58 | #endif 59 | #ifdef LowerDoubleUnderscore 60 | #define freeoptms2d freeoptms2d_ 61 | #endif 62 | #ifdef UpperCase 63 | #define freeoptms2d FREEOPTMS2D 64 | #endif 65 | #ifdef UpperUndescore 66 | #define freeoptms2d FREEOPTMS2D_ 67 | #endif 68 | #ifdef UpperDoubleUnderscore 69 | #define freeoptms2d FREEOPTMS2D_ 70 | #endif 71 | 72 | int freeoptms2d() 73 | { 74 | extern void *smooth_data2d; 75 | SMfinalizeSmoothing((void *)smooth_data2d); 76 | 77 | return (0); 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/FV/src/modules/tools_nemo.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: tools_nemo.f90 3322 2008-08-28 13:23:56Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! Provides TOOLS_* and CLASS_* modules for NEMO-based high-end applications 44 | ! 45 | MODULE tools_nemo 46 | 47 | USE class_psblas 48 | ! 49 | USE class_connectivity 50 | USE class_dimensions 51 | USE class_discretization 52 | USE class_scalar_field 53 | USE class_vector_field 54 | USE class_iterating 55 | USE class_material 56 | USE class_mesh 57 | USE class_output 58 | USE class_scalar_pde 59 | USE class_vector_pde 60 | USE class_scalar_source 61 | USE class_surface 62 | USE class_vector 63 | USE class_bc 64 | ! 65 | USE op_ddt 66 | USE op_d2dt2 67 | USE op_div 68 | USE op_field 69 | USE op_grad 70 | USE op_laplacian 71 | USE op_source 72 | ! 73 | USE tools_input 74 | USE tools_math 75 | USE tools_mesh_check 76 | USE tools_mesh_move 77 | USE tools_mesh_optimize 78 | USE tools_operators 79 | USE tools_output_basics 80 | USE tools_output 81 | 82 | END MODULE tools_nemo 83 | -------------------------------------------------------------------------------- /src/FV/src/operators/op_ddt_procedures.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: op_ddt.f90 2469 2007-10-08 10:34:43Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | SUBMODULE(op_ddt) op_ddt_procedures 46 | 47 | IMPLICIT NONE 48 | 49 | CONTAINS 50 | 51 | ! ----- Time Derivative Operator Wrappers ----- 52 | 53 | MODULE PROCEDURE scalar_pde_ddt_phi 54 | 55 | CALL scalar_pde_ddt(sign,pde,phi,dt,side=side) 56 | 57 | END PROCEDURE scalar_pde_ddt_phi 58 | 59 | 60 | MODULE PROCEDURE scalar_pde_ddt_fld_phi 61 | 62 | CALL scalar_pde_ddt(sign,pde,phi,dt,fld=fld,side=side) 63 | 64 | END procedure scalar_pde_ddt_fld_phi 65 | 66 | 67 | MODULE PROCEDURE vector_pde_ddt_phi 68 | 69 | CALL vector_pde_ddt(sign,pde,phi,dt,side=side) 70 | 71 | END PROCEDURE vector_pde_ddt_phi 72 | 73 | 74 | MODULE PROCEDURE vector_pde_ddt_fld_phi 75 | 76 | CALL vector_pde_ddt(sign,pde,phi,dt,fld=fld,side=side) 77 | 78 | END PROCEDURE vector_pde_ddt_fld_phi 79 | 80 | END SUBMODULE op_ddt_procedures 81 | -------------------------------------------------------------------------------- /src/FV/src/operators/op_laplacian_procedures.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: op_laplacian.f90 2469 2007-10-08 10:34:43Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | SUBMODULE(op_laplacian) op_laplacian_procedures 46 | IMPLICIT NONE 47 | 48 | CONTAINS 49 | 50 | ! ----- Laplacian Operator Wrappers ----- 51 | 52 | MODULE PROCEDURE scalar_pde_laplacian_phi 53 | 54 | CALL scalar_pde_laplacian(sign,pde,phi=phi,side=side) 55 | 56 | END PROCEDURE scalar_pde_laplacian_phi 57 | 58 | 59 | MODULE PROCEDURE scalar_pde_laplacian_gamma_phi 60 | 61 | CALL scalar_pde_laplacian(sign,pde,phi=phi,gamma=gamma,side=side) 62 | 63 | END PROCEDURE scalar_pde_laplacian_gamma_phi 64 | 65 | 66 | MODULE PROCEDURE vector_pde_laplacian_phi 67 | 68 | CALL vector_pde_laplacian(sign,pde,phi=phi,side=side) 69 | 70 | END PROCEDURE vector_pde_laplacian_phi 71 | 72 | 73 | MODULE PROCEDURE vector_pde_laplacian_gamma_phi 74 | 75 | CALL vector_pde_laplacian(sign,pde,phi=phi,gamma=gamma,side=side) 76 | 77 | END PROCEDURE vector_pde_laplacian_gamma_phi 78 | 79 | END SUBMODULE op_laplacian_procedures 80 | -------------------------------------------------------------------------------- /src/FV/src/operators/tools_operators.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id: tools_operators.f90 3093 2008-04-22 14:51:09Z sfilippo $ 41 | ! 42 | ! Description: 43 | ! To be added... 44 | ! 45 | MODULE tools_operators 46 | 47 | USE class_psblas, ONLY : psb_dpk_ 48 | IMPLICIT NONE 49 | 50 | PRIVATE 51 | PUBLIC :: pde_sign, size_blk 52 | PUBLIC :: lhs_, rhs_ 53 | 54 | REAL(psb_dpk_), PARAMETER :: lhs_ = 1.d0 55 | REAL(psb_dpk_), PARAMETER :: rhs_ = -1.d0 56 | 57 | INTERFACE 58 | 59 | MODULE FUNCTION pde_sign(sign,side) 60 | USE class_psblas 61 | IMPLICIT NONE 62 | REAL(psb_dpk_) :: pde_sign 63 | CHARACTER(len=1), INTENT(IN) :: sign 64 | REAL(psb_dpk_), INTENT(IN) :: side 65 | END FUNCTION pde_sign 66 | 67 | 68 | MODULE FUNCTION size_blk(ifirst,imax) 69 | IMPLICIT NONE 70 | INTEGER :: size_blk 71 | INTEGER, INTENT(IN) :: ifirst, imax 72 | !! WARNING!!! NBMAX must be a multiple of 4 73 | END FUNCTION size_blk 74 | 75 | END INTERFACE 76 | 77 | END MODULE tools_operators 78 | -------------------------------------------------------------------------------- /src/FV/src/output/class_exodus.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | MODULE class_exodus 8 | USE class_output, ONLY : output 9 | USE class_mesh, ONLY : mesh 10 | !! An Intel 18.0.5 bug precludes putting this in the interface bodies 11 | USE class_scalar_field, ONLY : scalar_field 12 | !! An Intel 18.0.5 bug precludes putting this in the interface bodies 13 | USE class_vector_field, ONLY : vector_field 14 | !! An Intel 18.0.5 bug precludes putting this in the interface bodies 15 | IMPLICIT NONE 16 | !! author: Ian Porter, NRC 17 | !! date: 01/23/2019 18 | !! 19 | !! This module contains the routines necessary to interface morfeus w/ vtkmofo 20 | !! 21 | PRIVATE 22 | PUBLIC :: exodus_output_ 23 | 24 | !! author: Hari Radhakrishnan, GSE 25 | !! date 12/12/2019 26 | !! 27 | !! This module implements the routines for writing an exodus file with mesh and results 28 | 29 | TYPE, EXTENDS(output) :: exodus_output_ 30 | !! DT for writing Exodus files 31 | CONTAINS 32 | PROCEDURE :: write_output => write_exo_morfeus 33 | END TYPE 34 | 35 | INTERFACE 36 | 37 | MODULE SUBROUTINE write_exo_morfeus(out, msh, sfield, vfield, iter) 38 | USE class_iterating, ONLY : iterating 39 | IMPLICIT NONE 40 | !! author: Hari Radhakrishnan, GSE; Updated by Ian Porter, GSE to move to Exodus class & TBP 41 | !! date: 12/12/2019; 02/18/2020 42 | !! 43 | !! This subroutine translates morfeus data structure 44 | !! into an exodus data structure and writes the exodus file 45 | !! 46 | CLASS(vtk_output_), INTENT(INOUT) :: out !! DT of output file info 47 | TYPE(mesh), INTENT(IN) :: msh !! DT of mesh info 48 | TYPE(scalar_field), DIMENSION(:), INTENT(IN), OPTIONAL :: sfield !! DT of scalar info 49 | TYPE(vector_field), DIMENSION(:), INTENT(IN), OPTIONAL :: vfield !! DT of vector info 50 | TYPE(iterating), INTENT(IN), OPTIONAL :: iter !! DT of iteration info 51 | 52 | END SUBROUTINE write_exo_morfeus 53 | 54 | END INTERFACE 55 | 56 | END MODULE class_exodus 57 | -------------------------------------------------------------------------------- /src/FV/src/output/class_vtk_output.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | MODULE class_vtk_output 8 | USE class_output, ONLY : output 9 | USE class_psblas, ONLY : psb_dpk_ 10 | USE class_mesh, ONLY : mesh 11 | !! An Intel 18.0.5 bug precludes putting this in the interface bodies 12 | USE class_scalar_field, ONLY : scalar_field 13 | !! An Intel 18.0.5 bug precludes putting this in the interface bodies 14 | USE class_vector_field, ONLY : vector_field 15 | !! An Intel 18.0.5 bug precludes putting this in the interface bodies 16 | IMPLICIT NONE 17 | !! author: Ian Porter, NRC 18 | !! date: 01/23/2019 19 | !! 20 | !! This module contains the routines necessary to interface morfeus w/ vtkmofo 21 | !! 22 | PRIVATE 23 | PUBLIC :: vtk_output_ 24 | 25 | TYPE, EXTENDS(output) :: vtk_output_ 26 | !! DT for writing vtk files 27 | CONTAINS 28 | PROCEDURE :: write_output => write_vtk_morfeus 29 | END TYPE vtk_output_ 30 | 31 | INTERFACE 32 | 33 | MODULE SUBROUTINE write_vtk_morfeus (out, msh, sfield, vfield, iter) 34 | USE class_iterating, ONLY : iterating 35 | IMPLICIT NONE 36 | !! author: Ian Porter, GSE 37 | !! date: 01/04/2020 38 | !! 39 | !! This subroutine translates morfeus data structure 40 | !! into a vtkmofo data structure and writes the vtk file 41 | !! 42 | CLASS(vtk_output_), INTENT(INOUT) :: out !! DT of output file info 43 | TYPE(mesh), INTENT(IN) :: msh !! DT of mesh info 44 | TYPE(scalar_field), DIMENSION(:), INTENT(IN), OPTIONAL :: sfield !! DT of scalar info 45 | TYPE(vector_field), DIMENSION(:), INTENT(IN), OPTIONAL :: vfield !! DT of vector info 46 | TYPE(iterating), INTENT(IN), OPTIONAL :: iter !! DT of iteration info 47 | 48 | END SUBROUTINE write_vtk_morfeus 49 | 50 | END INTERFACE 51 | 52 | END MODULE class_vtk_output 53 | -------------------------------------------------------------------------------- /src/FV/src/output/htoi.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | 40 | !! Converts a string into an integer. 41 | SUBMODULE(tools_output_basics) htoi_implementation 42 | IMPLICIT NONE 43 | 44 | CONTAINS 45 | 46 | MODULE PROCEDURE htoi 47 | USE class_psblas, ONLY : abort_psblas 48 | IMPLICIT NONE 49 | ! 50 | INTEGER :: idigit, i, n 51 | 52 | n = LEN(h) 53 | 54 | htoi = 0 55 | DO i = 1, n 56 | idigit = IACHAR(h(i:i)) - 48 57 | IF(idigit < 0 .OR. idigit > 9) THEN 58 | WRITE(*,100) 59 | CALL abort_psblas 60 | END IF 61 | htoi = htoi + idigit * (10 ** (n - i)) 62 | END DO 63 | 64 | 100 FORMAT(' ERROR! Non-digit character in HTOI function') 65 | 66 | END PROCEDURE htoi 67 | 68 | END SUBMODULE htoi_implementation 69 | -------------------------------------------------------------------------------- /src/FV/src/output/itoh.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | 40 | !! Converts a positive integer into a string. 41 | SUBMODULE(tools_output_basics) itoh_implementation 42 | IMPLICIT NONE 43 | 44 | CONTAINS 45 | 46 | MODULE PROCEDURE itoh 47 | USE class_psblas, ONLY : abort_psblas 48 | IMPLICIT NONE 49 | ! 50 | INTEGER :: a, r 51 | INTEGER :: k 52 | 53 | IF(i < 0) THEN 54 | WRITE(*,100) 55 | CALL abort_psblas 56 | END IF 57 | 58 | itoh(:) = '0' 59 | 60 | k = max 61 | a = i 62 | DO 63 | r = MOD(a,10) 64 | a = a / 10 65 | itoh(k:k) = ACHAR(48+r) 66 | k = k - 1 67 | IF(k == 0) EXIT 68 | END DO 69 | 70 | 100 FORMAT(' ERROR! Negative integer argument in ITOH function') 71 | 72 | END PROCEDURE itoh 73 | 74 | END SUBMODULE itoh_implementation 75 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # (c) 2019 Guide Star Engineering, LLC 3 | # This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | # under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | # Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | # 7 | foreach( prog test-rd_gambit_mesh.f90) 8 | add_morfeus_fv_exe( "${CMAKE_CURRENT_SOURCE_DIR}/${prog}" ) 9 | endforeach() 10 | 11 | # Example of how to use ../../cmake/modules/AddParallelTest.cmake 12 | # NOTE: The CMAKE_MODULE_PATH was modified in the project's top level CMakeLists.txt 13 | include(AddParallelTest) 14 | 15 | foreach( test_name 16 | fv-test-class_dimensions fv-test-class_vector fv-test-class_keytable fv-test-class_stopwatch fv-test-field-extends-grid ) 17 | 18 | add_parallel_test(NAME "${test_name}" # Name is optional 19 | PROCESSES 1 # Processes is optional, will default to 1 20 | SOURCES "${test_name}.f90" # Specify one or more source files. If NAME is missing 21 | LIBS morfeus_fv 22 | ) 23 | endforeach() 24 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/fv-test-class_dimensions.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program test_dimensions 8 | !! label: Morfeus-FV 9 | !! 10 | !! Test dimensions class behavior 11 | 12 | use assertions_interface, only : assert 13 | use class_dimensions, only : dimensions, operator(==), operator(/=), length_, time_, velocity_, density_, & 14 | volume_, null_dim_, mass_, energy_ 15 | 16 | implicit none 17 | 18 | type(dimensions) :: height_dimensions, displacement_dimensions 19 | type(dimensions) :: time_step_dimensions, time_dimensions 20 | type(dimensions) :: velocity_dimensions 21 | 22 | height_dimensions = length_ 23 | displacement_dimensions = length_ 24 | time_step_dimensions = time_ 25 | time_dimensions = time_ 26 | velocity_dimensions = velocity_ 27 | 28 | call assert( height_dimensions == displacement_dimensions, "test_dimensions: operator(==)" ) 29 | call assert( .not. (height_dimensions == time_step_dimensions), "test_dimensions: operator(==)" ) 30 | call assert( height_dimensions /= time_step_dimensions, "test_dimensions: inequality operator(/=)" ) 31 | call assert( displacement_dimensions / time_dimensions == velocity_, "test_dimensions: operator(/)" ) 32 | call assert( height_dimensions == (height_dimensions + displacement_dimensions), "test_dimensions: operator(+)" ) 33 | call assert( height_dimensions == (height_dimensions - length_), "test_dimensions: operator(-)" ) 34 | call assert( mass_ / density_ == ( volume_), "test_dimensions: operator(/)" ) 35 | call assert( (mass_ * velocity_) * velocity_ == ( energy_), "test_dimensions: operator(*)" ) 36 | 37 | print *, "Test passed." 38 | 39 | end program test_dimensions 40 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/fv-test-class_keytable.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program test_keytable 8 | !! label: Morfeus-FV 9 | !! 10 | !! Test keytable class behavior 11 | 12 | use assertions_interface, only : assert 13 | use class_keytable, only : keytable 14 | 15 | implicit none 16 | integer, allocatable :: row1(:), row2(:), row3(:) 17 | integer, pointer :: row1T(:), row2T(:), row3T(:) 18 | type(keytable) :: testTable 19 | 20 | row1 = [1,2,3] 21 | row2 = [4,5,6,7] 22 | row3 = [8,9,10,11,12,13] 23 | 24 | call testTable%alloc_keytable(1,3) 25 | call testTable%set_kt_row(1,row1) 26 | call testTable%set_kt_row(2,row2) 27 | call testTable%set_kt_row(3,row3) 28 | 29 | call testTable%get_kt_row(1,row1T) 30 | call testTable%get_kt_row(2,row2T) 31 | call testTable%get_kt_row(3,row3T) 32 | 33 | call assert( row1T == row1, "test_keytable: testTable%row(1) == row1" ) 34 | call assert( row2T == row2, "test_keytable: testTable%row(2) == row2" ) 35 | call assert( row3T == row3, "test_keytable: testTable%row(3) == row3" ) 36 | call assert( testTable%get_row_size(1) == size(row1), "test_keytable: testTable%get_row_size(1) == size(row1)" ) 37 | call assert( testTable%get_row_size(2) == size(row2), "test_keytable: testTable%get_row_size(2) == size(row2)" ) 38 | call assert( testTable%get_row_size(3) == size(row3), "test_keytable: testTable%get_row_size(3) == size(row3)" ) 39 | 40 | print *, "Test passed." 41 | 42 | end program test_keytable 43 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/fv-test-class_stopwatch.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program test_stopwatch 8 | !! label: Morfeus-FV 9 | !! 10 | !! Test stopwatch class behavior 11 | 12 | use assertions_interface, only : assert 13 | use class_stopwatch, only : stopwatch 14 | USE class_psblas 15 | 16 | implicit none 17 | 18 | type(stopwatch) :: watch 19 | 20 | watch = stopwatch_(icontxt_()) 21 | call watch%tic() 22 | call watch%toc() 23 | 24 | call assert( watch%partial_() == watch%total_(), "test_stopwatch: watch%partial_() == watch%total_()" ) 25 | 26 | print *, "Test passed." 27 | 28 | end program test_stopwatch 29 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/fv-test-class_vector.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program test_class_vector 8 | !! label: Morfeus-FV 9 | !! 10 | !! Test vector class behavior 11 | 12 | use assertions_interface, only : assert 13 | use class_vector, only : vector, operator(.dot.), vector_ 14 | use class_psblas, only : psb_dpk_ 15 | 16 | implicit none 17 | 18 | type(vector) :: a(3), b, c 19 | real(psb_dpk_), parameter :: tolerance=1.0E-06, one=1.0_psb_dpk_, zero=0.0_psb_dpk_ 20 | 21 | a = [vector_(zero, zero, zero), vector_(one, zero, zero), vector_(zero, one, zero)] 22 | b = vector_(zero, zero, one) ! perpendicular to all vectors in a 23 | c = a .dot. b ! = [a(1) .dot. b, a(2) .dot. b, a(3) .dot. b] = [zero, zero, zero] 24 | 25 | test_operators: & 26 | block 27 | call assert( c%mag() <= tolerance, "fv-test-class_vector: mag()" ) 28 | end block test_operators 29 | 30 | print *, "Test passed." 31 | 32 | end program test_class_vector 33 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/fv-test-field-extends-grid.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019-2020 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) under contract 4 | ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", 5 | ! contract # NRC-HQ-60-17-C-0007 6 | ! 7 | program test_field_extends_grid 8 | !! author: Damian Rouson 9 | !! 10 | !! Verify that the field child extends parent grid 11 | 12 | use grid_interface, only : grid 13 | use class_field, only : field 14 | use assertions_interface, only : assert 15 | implicit none 16 | 17 | type(grid) parent 18 | type(field) child 19 | 20 | call assert( extends_type_of(child, parent), "test_field_extends_grid: extends_type_of(child, parent)") 21 | 22 | print *,"Test passed." 23 | 24 | end program test_field_extends_grid 25 | -------------------------------------------------------------------------------- /src/FV/src/unit-tests/test-rd_gambit_mesh.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! (c) 2019 Guide Star Engineering, LLC 3 | ! This Software was developed for the US Nuclear Regulatory Commission (US NRC) 4 | ! under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under 5 | ! Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007 6 | ! 7 | ! 8 | ! NEMO - Numerical Engine (for) Multiphysics Operators 9 | ! Copyright (c) 2007, Stefano Toninel 10 | ! Gian Marco Bianchi University of Bologna 11 | ! David P. Schmidt University of Massachusetts - Amherst 12 | ! Salvatore Filippone University of Rome Tor Vergata 13 | ! All rights reserved. 14 | ! 15 | ! Redistribution and use in source and binary forms, with or without modification, 16 | ! are permitted provided that the following conditions are met: 17 | ! 18 | ! 1. Redistributions of source code must retain the above copyright notice, 19 | ! this list of conditions and the following disclaimer. 20 | ! 2. Redistributions in binary form must reproduce the above copyright notice, 21 | ! this list of conditions and the following disclaimer in the documentation 22 | ! and/or other materials provided with the distribution. 23 | ! 3. Neither the name of the NEMO project nor the names of its contributors 24 | ! may be used to endorse or promote products derived from this software 25 | ! without specific prior written permission. 26 | ! 27 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 31 | ! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | ! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ! 38 | !--------------------------------------------------------------------------------- 39 | ! 40 | ! $Id$ 41 | ! 42 | ! Description: 43 | ! Imports and checks a mesh 44 | ! 45 | PROGRAM check_mesh 46 | 47 | USE tools_nemo 48 | 49 | IMPLICIT NONE 50 | ! 51 | CHARACTER(len=30), PARAMETER :: input_file = 'nemo.inp' 52 | ! 53 | TYPE(mesh) :: msh 54 | CLASS(output), ALLOCATABLE :: out 55 | TYPE(scalar_field) :: quality 56 | ! 57 | INTEGER, ALLOCATABLE :: bad_cells(:) 58 | REAL(psb_dpk_) :: tol 59 | 60 | CALL start_psblas 61 | 62 | CALL msh%create_mesh(input_file,'MESH') 63 | CALL quality%create_field(msh,name='qual') 64 | out = create_output(input_file,'OUTPUT') 65 | 66 | tol = read_par(input_file,'MESH','quality_tol',default = 0.0d0) 67 | CALL check_mesh_quality(msh,quality,tol,bad_cells) 68 | 69 | CALL out%write(msh, [ quality ]) 70 | 71 | IF(ALLOCATED(bad_cells)) DEALLOCATE(bad_cells) 72 | CALL quality%free_field() 73 | CALL msh%free_mesh() 74 | 75 | CALL stop_psblas 76 | 77 | END PROGRAM check_mesh 78 | --------------------------------------------------------------------------------