├── .gitignore ├── Makefile ├── README.md ├── _config.yml ├── build └── dummy.txt ├── doc ├── SweepSchedule.pdf ├── SweepSchedule.tex ├── dg_transport.pdf ├── dg_transport.tex ├── references │ ├── 3D-SN-tets-notes.pdf │ └── Quality Local Refinement of Tetrahedral Meshes.pdf ├── sixcube.gif ├── tet1.pdf ├── tet1.svg ├── triangle1.pdf ├── triangle1.svg └── user_guide │ ├── chebyshev-legendre.jpg │ ├── comm_pattern.pdf │ ├── comm_pattern.svg │ ├── dag.pdf │ ├── dag.svg │ ├── dag_partitioned.pdf │ ├── dag_partitioned.svg │ ├── grid2d.pdf │ ├── grid2d.svg │ ├── tet-eps-converted-to.pdf │ ├── user_guide.out │ ├── user_guide.pdf │ └── user_guide.tex ├── examples ├── input.deck.example ├── make.inc.cray ├── make.inc.toss3 ├── run.sh.local ├── run.sh.tt └── setup-ccs.sh ├── src ├── Assert.cc ├── Assert.hh ├── Comm.cc ├── Comm.hh ├── CommSides.cc ├── CommSides.hh ├── Global.cc ├── Global.hh ├── GraphTraverser.cc ├── GraphTraverser.hh ├── KeyValueReader.cc ├── KeyValueReader.hh ├── KrylovSolver.cc ├── KrylovSolver.hh ├── Main.cc ├── Mat.hh ├── ParallelMesh.cc ├── ParallelMesh.hh ├── Priorities.cc ├── Priorities.hh ├── Problem.cc ├── Problem.hh ├── PsiData.cc ├── PsiData.hh ├── Quadrature.cc ├── Quadrature.hh ├── SerialMesh.cc ├── SerialMesh.hh ├── SourceIteration.cc ├── SourceIteration.hh ├── SweepData.hh ├── SweepSchedule.cc ├── SweepSchedule.hh ├── Sweeper.cc ├── Sweeper.hh ├── SweeperAbstract.hh ├── SweeperPBJ.cc ├── SweeperPBJ.hh ├── SweeperSchur.cc ├── SweeperSchur.hh ├── SweeperTraverse.cc ├── SweeperTraverse.hh ├── Timer.hh ├── Transport.cc ├── Transport.hh ├── TychoMesh.cc ├── TychoMesh.hh ├── TychoMeshIO.cc ├── Util.cc └── Util.hh ├── test ├── diff.py ├── regression.py └── regression │ ├── gold.psi │ ├── input-gaussCramer1.deck │ ├── input-gaussCramer2.deck │ ├── input-gaussPivot.deck │ ├── input-gold-krylov.deck │ ├── input-gold.deck │ ├── input-inter0.deck │ ├── input-inter1.deck │ ├── input-inter2.deck │ ├── input-intra0.deck │ ├── input-intra1.deck │ ├── input-intra2.deck │ ├── input-intra3.deck │ ├── input-intra4.deck │ ├── input-maxcells20.deck │ ├── input-sweepOrig1-krylov.deck │ ├── input-sweepOrig1.deck │ ├── input-sweepOrig2-krylov.deck │ ├── input-sweepOrig2.deck │ ├── input-sweepPBJ-krylov.deck │ ├── input-sweepPBJ.deck │ ├── input-sweepPBJOuter-krylov.deck │ ├── input-sweepPBJOuter.deck │ ├── input-sweepPBJSI.deck │ ├── input-sweepSchur-krylov.deck │ ├── input-sweepSchur.deck │ ├── input-sweepSchurKrylov.deck │ ├── input-sweepSchurOuter-krylov.deck │ ├── input-sweepSchurOuter.deck │ ├── run-gaussCramer1-mpi4.sh │ ├── run-gaussCramer2-mpi4.sh │ ├── run-gaussPivot-mpi4.sh │ ├── run-gold-krylov-mpi4-omp3.sh │ ├── run-gold-mpi2.sh │ ├── run-gold-mpi3.sh │ ├── run-gold-mpi4-omp3.sh │ ├── run-gold-mpi4.sh │ ├── run-gold.sh │ ├── run-inter0-mpi4.sh │ ├── run-inter1-mpi4.sh │ ├── run-inter2-mpi4.sh │ ├── run-intra0-mpi4.sh │ ├── run-intra1-mpi4.sh │ ├── run-intra2-mpi4.sh │ ├── run-intra3-mpi4.sh │ ├── run-intra4-mpi4.sh │ ├── run-maxcells20-mpi4.sh │ ├── run-sweepOrig1-krylov-mpi4-omp3.sh │ ├── run-sweepOrig1-mpi4-omp3.sh │ ├── run-sweepOrig1-mpi4.sh │ ├── run-sweepOrig2-krylov-mpi4-omp3.sh │ ├── run-sweepOrig2-mpi4-omp3.sh │ ├── run-sweepOrig2-mpi4.sh │ ├── run-sweepPBJ-krylov-mpi4-omp3.sh │ ├── run-sweepPBJ-mpi4-omp3.sh │ ├── run-sweepPBJ-mpi4.sh │ ├── run-sweepPBJOuter-krylov-mpi4-omp3.sh │ ├── run-sweepPBJOuter-mpi4-omp3.sh │ ├── run-sweepPBJOuter-mpi4.sh │ ├── run-sweepPBJSI-mpi4-omp3.sh │ ├── run-sweepSchur-krylov-mpi4-omp3.sh │ ├── run-sweepSchur-mpi4-omp3.sh │ ├── run-sweepSchur-mpi4.sh │ ├── run-sweepSchurKrylov-mpi4-omp3.sh │ ├── run-sweepSchurOuter-krylov-mpi4-omp3.sh │ ├── run-sweepSchurOuter-mpi4-omp3.sh │ └── run-sweepSchurOuter-mpi4.sh └── util ├── CreateGaussLegendre.py ├── CreateRegularMesh.cc ├── Makefile ├── MoabToSerialMesh.cc ├── ParallelMeshInfo.cc ├── ParallelMeshToMoab.cc ├── PartitionColumns.cc ├── PartitionMetis.cc ├── RefineSerialMesh.cc ├── SerialMeshInfo.cc ├── SerialMeshToMoab.cc ├── cube-10717.cgns ├── cube-10717.smesh ├── cube-12.cgns ├── cube-12.smesh ├── cube-1374.cgns ├── cube-1374.smesh ├── cube-208.cgns ├── cube-208.smesh ├── cube-4128.cgns ├── cube-4128.smesh ├── cube-571760.cgns ├── cube-571760.smesh ├── cube-67249.cgns ├── cube-67249.smesh ├── cube_no_mesh.hdf ├── make.inc.example ├── notes.txt ├── pcube-1649.cgns ├── pcube-1649.smesh ├── pcube-17700.cgns ├── pcube-17700.smesh ├── pcube-4684.cgns ├── pcube-4684.smesh ├── pcube-9482.cgns ├── pcube-9482.smesh └── pcube.hdf /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.DS_Store 3 | *.aux 4 | *.log 5 | *.gz 6 | *.o 7 | input.deck 8 | make.inc 9 | *.x 10 | *.pmesh 11 | *.dSYM 12 | *.vtk 13 | *.visit 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Settings for local environment 2 | include make.inc 3 | 4 | 5 | # Add assert level and PETSc flag to compile command 6 | MPICC += -DASSERT_ON=$(ASSERT_ON) -DUSE_PETSC=$(USE_PETSC) 7 | 8 | 9 | # Include source directory 10 | INC += -Isrc 11 | 12 | 13 | # Add PETSC include directory and library command 14 | ifeq ($(strip $(USE_PETSC)), 1) 15 | INC += $(PETSC_INC) 16 | LIBS += $(PETSC_LIB) 17 | endif 18 | 19 | 20 | 21 | # List of sources, header files, and object files 22 | SOURCE = $(wildcard src/*.cc) 23 | HEADERS = $(wildcard src/*.hh) 24 | OBJECTS = $(patsubst src%.cc, build%.o, $(SOURCE)) 25 | 26 | 27 | # Link object files 28 | sweep.x: $(OBJECTS) 29 | @echo Linking $@ 30 | $(MPICC) $(OBJECTS) -o sweep.x ${LIBS} 31 | 32 | 33 | # Make object files 34 | build/%.o: src/%.cc $(HEADERS) make.inc 35 | @echo Making $@ 36 | $(MPICC) $(INC) -c $< -o $@ 37 | 38 | 39 | # Delete object files 40 | .PHONY: clean 41 | clean: 42 | @echo Delete object files 43 | rm build/*.o *.x 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tycho2 Version 0.2 2 | 3 | A mini-app for neutral-particle, discrete-ordinates (SN), transport on parallel-decomposed meshes of tetrahedra. 4 | 5 | ## Background and History 6 | 7 | Tycho2 was originally written by Kris Garrett while a postdoc at Los Alamos National Laboratory (see the license) in the 8 | CCS-2 group, working together with Jim Warsa and Jae Chang, members of the Capsaicin deterministic SN transport code project 9 | at LANL. The goal of the mini-app is to provide a simple platform to explore the strange new world of GPUs and heterogeneous 10 | computer architectures. The idea being that, like the SNAP, UMT, and Kripke mini-apps for structured meshes*, potential approaches 11 | and implementations for unstructured mesh transport could be investigated and perhaps transferred to the more complicated Capsaicin 12 | project if they showed promise. Makes sense, right? Anyway, Kris has left LANL and now it's up to Jim Warsa and any other contributors 13 | to take up where he left off. Recent work by Dan Ibanez of Sandia National Laboratory, with Kris, on using Kokkos in Tycho2 is 14 | gratefully acknowledged. 15 | 16 | Tycho2 is based on a code called Tycho, written by Shawn Pautz (Sandia National Laboratory) sometime around the year 2000, 17 | when he was at Los Alamos National Laboratory. Alhough Tycho wasn't a mini-app (that term hadn't been invented yet), 18 | Shawn was using Tycho to explore ideas for parallel, unstructrued mesh, SN sweeps. Remember, those were early days. 19 | Although we didn't borrow any code base from the original implementation, we named our mini-app Tycho2 in an homage to 20 | Shawn's original code (and because Tycho2 works only on tets, like Tycho). 21 | 22 | *Note that, to the best of our knowledge, while UMT is targeted to unstructred meshes, the meshes are actually logially 23 | orthgonal, without the additional complications and computational overhead associated with SN sweeps on meshes with 24 | arbitrary orientations and connectivtiies. 25 | 26 | ## Warning 27 | This is still being heavily developed, so ... 28 | USE AT YOUR OWN RISK!!! 29 | 30 | 31 | ## License 32 | Copyright (c) 2016, Los Alamos National Security, LLC 33 | All rights reserved. 34 | 35 | Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the U.S. Department of Energy. The U.S. Government has rights to use, reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to produce derivative works, such modified software should be clearly marked, so as not to confuse it with the version available from LANL. 36 | 37 | Additionally, redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 38 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 39 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 40 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 41 | 42 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | 45 | ## Build Notes 46 | Build notes can be found at the following wiki page: 47 | https://github.com/losalamos/tycho2/wiki/Build-Notes 48 | 49 | 50 | ## Los Alamos LACC Number 51 | LA-CC-16-049 52 | 53 | 54 | ## Contributors 55 | - Kris Garrett (LANL [formerly], original author) 56 | - Neelam Patel (Affiliation unknown) 57 | - Kevin Procopio (ORNL, contributor) 58 | - Jim Warsa (LANL, ideas, criticisms, advisement) 59 | - David Dixon (LANL, contributor) 60 | - Dan Ibanez (SNL, contributor, Kokkos expert) 61 | - Jae Chang (LANL, honorable team leader) 62 | - Jeff Haack (LANL, contributor) 63 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /build/dummy.txt: -------------------------------------------------------------------------------- 1 | This file exists to have an empty folder for git. 2 | Git will not hold the directory in its repository with no files in it. 3 | -------------------------------------------------------------------------------- /doc/SweepSchedule.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/SweepSchedule.pdf -------------------------------------------------------------------------------- /doc/SweepSchedule.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt,letterpaper]{article} 2 | \usepackage[utf8]{inputenc} 3 | \usepackage{amsmath} 4 | \usepackage{amsfonts} 5 | \usepackage{amssymb} 6 | \usepackage{graphicx} 7 | %\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} 8 | \author{Kris Garrett} 9 | \title{Sweep Schedule} 10 | \begin{document} 11 | \maketitle 12 | 13 | \section{Priorities} 14 | Two sets of priorities are created: (i) intra-angle and (ii) inter-angle. 15 | The prioritization heuristics come from the original Tycho code described in ``An Algorithm for Parallel S$_n$ Sweeps on Unstructured Meshes'' by Shawn Pautz. 16 | 17 | First, intra-angle priorities are found. 18 | This means we split all the cell-angle pairs into sets of cells where each set corresponds to a distinct angle. 19 | Then each set has priorities applied to every cell. 20 | Second, a global priority is set for each cell-angle pair as a function of the intra-angle priority for each cell and the angle index. 21 | 22 | 23 | 24 | \subsection{Intra-angle Priorities} 25 | There are 5 priority types here. 26 | All use the B-level in the graph for the given angle. 27 | The B-level is defined as the longest path to get to a graph leaf. 28 | A leaf has B-level 1. 29 | 30 | \paragraph{Random} 31 | Assign a random priority to each cell. 32 | 33 | \paragraph{B-Levels} 34 | Cell priority equals the b-level. 35 | 36 | \paragraph{BFDS - Breadth First Descendant Seeking} 37 | Priority equals the highest b-level of any descendant on another process. 38 | If the cell has no descendants on another process, the priority is zero. 39 | 40 | \paragraph{DFDS - Depth First Descendant Seeking} 41 | If a cell has no descendants on another process, the priority is zero. 42 | If the cell has a child on another process, the priority is the highest b-level of the children on the other process \textit{plus} a constant greater than or equal to the number of levels of the graph. 43 | Otherwise, the cell has priority one less than the max of the priority of its children. 44 | 45 | \paragraph{DFHDS - Depth First Highest Descendant Seeking} 46 | If a cell has no descendants on another process, the priority is zero. 47 | If the cell has a child on another process, the priority is the highest b-level of the children on the other process \textit{times} a constant greater than or equal to the number of levels of the graph. 48 | Otherwise, the cell has priority one less than the max of the priority of its children. 49 | 50 | 51 | \subsection{Inter-angle Priorities} 52 | Given the intra-angle priorites, there are 3 types of inter-angle priorities. 53 | 54 | 55 | \paragraph{Interleaved} 56 | This makes the global priority equal to the intra-angle priority. 57 | This will interleave the ordering of cell-angle pairs in angle. 58 | 59 | \paragraph{Global} 60 | This makes the global priority equal to the intra-angle priority plus a constant large enough to ensure each angle of lower index are prioritized before angles of higher index. 61 | 62 | \paragraph{Local} 63 | Highest b-level is prioritized first. 64 | 65 | 66 | 67 | \section{SweepSchedule} 68 | A sweep schedule is made which given priorities, orders the calculations for the sweep. 69 | The idea is that a \textit{step} is something that can be solved in each process without communication between processes. 70 | These steps are to be done on each process together. 71 | A maximum of \textit{MaxCellsPerStep} cell-angle pairs may be computed for each step and each process. 72 | Then communication of boundary data between processes is done and the process repeats. 73 | 74 | 75 | \end{document} -------------------------------------------------------------------------------- /doc/dg_transport.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/dg_transport.pdf -------------------------------------------------------------------------------- /doc/references/3D-SN-tets-notes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/references/3D-SN-tets-notes.pdf -------------------------------------------------------------------------------- /doc/references/Quality Local Refinement of Tetrahedral Meshes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/references/Quality Local Refinement of Tetrahedral Meshes.pdf -------------------------------------------------------------------------------- /doc/sixcube.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/sixcube.gif -------------------------------------------------------------------------------- /doc/tet1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/tet1.pdf -------------------------------------------------------------------------------- /doc/triangle1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/triangle1.pdf -------------------------------------------------------------------------------- /doc/user_guide/chebyshev-legendre.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/chebyshev-legendre.jpg -------------------------------------------------------------------------------- /doc/user_guide/comm_pattern.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/comm_pattern.pdf -------------------------------------------------------------------------------- /doc/user_guide/dag.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/dag.pdf -------------------------------------------------------------------------------- /doc/user_guide/dag_partitioned.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/dag_partitioned.pdf -------------------------------------------------------------------------------- /doc/user_guide/grid2d.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/grid2d.pdf -------------------------------------------------------------------------------- /doc/user_guide/tet-eps-converted-to.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/tet-eps-converted-to.pdf -------------------------------------------------------------------------------- /doc/user_guide/user_guide.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section.1}{Introduction}{}% 1 2 | \BOOKMARK [1][-]{section.2}{Compiling and running the code}{}% 2 3 | \BOOKMARK [2][-]{subsection.2.1}{The util directory}{section.2}% 3 4 | \BOOKMARK [2][-]{subsection.2.2}{Running sweep.x}{section.2}% 4 5 | \BOOKMARK [1][-]{section.3}{The underlying mathematics}{}% 5 6 | \BOOKMARK [2][-]{subsection.3.1}{The equation}{section.3}% 6 7 | \BOOKMARK [2][-]{subsection.3.2}{Method of discretization}{section.3}% 7 8 | \BOOKMARK [2][-]{subsection.3.3}{Source iteration}{section.3}% 8 9 | \BOOKMARK [2][-]{subsection.3.4}{Sweeps}{section.3}% 9 10 | \BOOKMARK [3][-]{subsubsection.3.4.1}{Sweeps Algorithms}{subsection.3.4}% 10 11 | \BOOKMARK [3][-]{subsubsection.3.4.2}{Intra-Angle Priorities}{subsection.3.4}% 11 12 | \BOOKMARK [3][-]{subsubsection.3.4.3}{Inter-Angle Priorities}{subsection.3.4}% 12 13 | \BOOKMARK [3][-]{subsubsection.3.4.4}{The Sweep Algorithms}{subsection.3.4}% 13 14 | -------------------------------------------------------------------------------- /doc/user_guide/user_guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/doc/user_guide/user_guide.pdf -------------------------------------------------------------------------------- /examples/input.deck.example: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-6 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10.0 12 | sigmaS1 5.0 13 | sigmaT2 10.0 14 | sigmaS2 5.0 15 | OutputFile false 16 | OutputFilename out.psi 17 | SourceIteration true 18 | OneSidedMPI false 19 | 20 | DD_IterMax 100 21 | DD_ErrMax 1e-5 22 | 23 | 24 | # Sweep Types: TraverseGraph is the flagship sweep type 25 | #SweepType OriginalTycho1 26 | #SweepType OriginalTycho2 27 | SweepType TraverseGraph 28 | #SweepType PBJ 29 | #SweepType PBJOuter 30 | #SweepType Schur 31 | #SweepType SchurOuter 32 | #SweepType PBJSI 33 | #SweepType SchurKrylov 34 | 35 | 36 | # Gaussian Elimination Types: NoPivot seems to be best 37 | # Original: Uses pivoting 38 | # NoPivot: No pivoting 39 | # CramerGlu: Use Cramer's rule to invert (algorithm from OpenGL library) 40 | # CramerIntel: User Cramer's rule to invert (algorithm found from Intel blog) 41 | #GaussElim Original 42 | GaussElim NoPivot 43 | #GaussElim CramerGlu 44 | #GaussElim CramerIntel 45 | -------------------------------------------------------------------------------- /examples/make.inc.cray: -------------------------------------------------------------------------------- 1 | # Makefile setting for Cray 2 | # To use Petsc: 'module load cray-petsc' 3 | # To use one-sided MPI: 'export MPICH_RMA_OVER_DMAPP=1' 4 | 5 | 6 | # Assert level: 0 = no asserts, 1 = all asserts ################################ 7 | ASSERT_ON = 0 8 | 9 | 10 | # PETSC library ################################################################ 11 | USE_PETSC = 1 # 0 = no, 1 = yes 12 | PETSC_INC = -I$(PETSC_DIR)/include 13 | PETSC_LIB = $(PETSC_DIR)/lib/libcraypetsc_intel_real.a 14 | 15 | 16 | # Extra libraries ############################################################## 17 | INC = 18 | LIBS = -Wl,--whole-archive,-ldmapp,--no-whole-archive 19 | 20 | 21 | # Compile command ############################################################## 22 | # Needs (1) MPI C++ compiler wrapper 23 | # (2) openmp enabled 24 | # (3) c++11 standard enabled (-std=c++11 for gcc, intel) 25 | MPICC = CC -Wall -Wextra -g -std=c++11 -O3 -qopenmp 26 | -------------------------------------------------------------------------------- /examples/make.inc.toss3: -------------------------------------------------------------------------------- 1 | # Makefile setting for Toss 3 machines at LANL 2 | 3 | 4 | # Assert level: 0 = no asserts, 1 = all asserts ################################ 5 | ASSERT_ON = 0 6 | 7 | 8 | # PETSC library ################################################################ 9 | USE_PETSC = 1 # 0 = no, 1 = yes 10 | PETSC_INC = -I/usr/projects/capsaicin/devs/ckgarrett/lib/petsc-3.7.5/build-toss3/include 11 | PETSC_LIB = /usr/projects/capsaicin/devs/ckgarrett/lib/petsc-3.7.5/build-toss3/lib/libpetsc.so 12 | 13 | 14 | 15 | # Extra libraries ############################################################## 16 | INC = 17 | LIBS = 18 | 19 | 20 | # Compile command ############################################################## 21 | # Needs (1) MPI C++ compiler wrapper 22 | # (2) openmp enabled 23 | # (3) c++11 standard enabled (-std=c++11 for gcc, intel) 24 | MPICC = mpicxx -Wall -Wextra -g -std=c++11 -O3 -fopenmp 25 | -------------------------------------------------------------------------------- /examples/run.sh.local: -------------------------------------------------------------------------------- 1 | # This is an example run script to automate creating a parallel mesh and 2 | # running the sweeper on it. 3 | 4 | 5 | NUM_PARTS=4 6 | IN_FILE="./util/cube-1374.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="input.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./util/PartitionMetis.x $NUM_PARTS $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | -------------------------------------------------------------------------------- /examples/run.sh.tt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run script for Trinitite 4 | # -j oe means combine standard error and out 5 | # -V means keep all environment variables and modules 6 | 7 | #MSUB -l walltime=10:00 8 | #MSUB -l nodes=1 9 | #MSUB -o /users/ckgarrett/git/tt-fey/tycho2/tt.out 10 | #MSUB -j oe 11 | #MSUB -V 12 | 13 | LUSTRE_DIR="/lustre/ttscratch1/ckgarrett/tychomesh" 14 | NUM_PARTS=32 15 | NUM_THREADS=1 16 | NUM_HYPERTHREADS=1 17 | IN_FILE="$LUSTRE_DIR/cube-4128.smesh" 18 | OUT_FILE="$LUSTRE_DIR/temp.pmesh" 19 | INPUT_DECK="input.deck" 20 | 21 | export OMP_NUM_THREADS=$NUM_THREADS 22 | export OMP_PLACES=threads 23 | export OMP_PROC_BIND=true 24 | 25 | 26 | # Partition mesh 27 | aprun -n 1 ./util/PartitionMetis.x $NUM_PARTS $IN_FILE $OUT_FILE 28 | 29 | # Show how threads map to cores 30 | # Comment this out for large runs 31 | aprun -n $NUM_PARTS -d $NUM_THREADS -j $NUM_HYPERTHREADS -cc depth \ 32 | /usr/project/packages/xthi/xthi | sort 33 | 34 | # Run program 35 | aprun -n $NUM_PARTS -d $NUM_THREADS -j $NUM_HYPERTHREADS -cc depth \ 36 | ./sweep.x $OUT_FILE $INPUT_DECK 37 | -------------------------------------------------------------------------------- /examples/setup-ccs.sh: -------------------------------------------------------------------------------- 1 | module load user_contrib 2 | module load gcc/6.1.0 3 | module load openmpi/1.10.3 4 | module load metis/5.1.0 5 | 6 | module list 7 | -------------------------------------------------------------------------------- /src/Assert.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include "Assert.hh" 41 | #include 42 | #include 43 | 44 | 45 | namespace Assert 46 | { 47 | 48 | /* 49 | my_assert 50 | */ 51 | void my_assert(const char *cond, const char *file, const int line) 52 | { 53 | printf("Assertion: %s, failed in %s, line %d.\n\n\n", cond, file, line); 54 | abort(); 55 | } 56 | 57 | 58 | /* 59 | my_insist 60 | */ 61 | void my_insist(const char *cond, const char *msg, const char *file, const int line) 62 | { 63 | printf("Insist: %s, failed in %s, line %d.\n", cond, file, line); 64 | printf("The following message was provided: %s\n\n\n", msg); 65 | abort(); 66 | } 67 | 68 | } // end of Assert namespace 69 | 70 | -------------------------------------------------------------------------------- /src/Assert.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __ASSERT_HH__ 41 | #define __ASSERT_HH__ 42 | 43 | 44 | namespace Assert 45 | { 46 | void my_assert(const char *cond, const char *file, const int line); 47 | void my_insist(const char *cond, const char *msg, const char *file, const int line); 48 | } 49 | 50 | 51 | 52 | #ifndef ASSERT_ON 53 | #define ASSERT_ON 1 54 | #endif 55 | 56 | #if ASSERT_ON 57 | #define Assert(c) if (!(c)) Assert::my_assert( #c, __FILE__, __LINE__ ); 58 | #else 59 | #define Assert(c) 60 | #endif 61 | 62 | #define Insist(c,m) if (!(c)) Assert::my_insist( #c, m, __FILE__, __LINE__ ); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/Comm.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __COMM_HH__ 41 | #define __COMM_HH__ 42 | 43 | #include "Global.hh" 44 | #include 45 | #include 46 | #include 47 | 48 | namespace Comm 49 | { 50 | 51 | int rank(); 52 | int rank(MPI_Comm comm); 53 | int numRanks(); 54 | 55 | void gsum(double &x); 56 | void gsum(UINT &x); 57 | void gmax(double &x); 58 | void gmax(double &x, MPI_Comm comm); 59 | void gmax(UINT &x); 60 | 61 | void sendUInt(UINT i, int destination); 62 | void sendUIntVector(const std::vector &buffer, int destination); 63 | void iSendUIntVector(const std::vector &buffer, int destination, 64 | int tag, MPI_Request &request); 65 | void iSendDoubleVector(const std::vector &buffer, int destination, 66 | int tag, MPI_Request &request); 67 | 68 | void recvUInt(UINT &i, int destination); 69 | void recvUIntVector(std::vector &buffer, int destination); 70 | void recvUIntVector(std::vector &buffer, int destination, int tag); 71 | void recvDoubleVector(std::vector &buffer, int destination, int tag); 72 | 73 | void barrier(); 74 | 75 | void openFileForRead(const std::string &filename, MPI_File &file); 76 | void openFileForWrite(const std::string &filename, MPI_File &file); 77 | void closeFile(MPI_File &file); 78 | void seek(const MPI_File &file, uint64_t position); 79 | void readUint64(const MPI_File &file, uint64_t &data); 80 | void readUint64(const MPI_File &file, uint64_t *data, int numData); 81 | void readChars(const MPI_File &file, char *data, int numData); 82 | void writeDoublesAt(const MPI_File &file, UINT offset, double *data, 83 | UINT numData); 84 | 85 | } // End namespace 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /src/CommSides.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 5 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 6 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 7 | the U.S. Department of Energy. The U.S. Government has rights to use, 8 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 9 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 10 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 11 | to produce derivative works, such modified software should be clearly marked, 12 | so as not to confuse it with the version available from LANL. 13 | Additionally, redistribution and use in source and binary forms, with or 14 | without modification, are permitted provided that the following conditions 15 | are met: 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 22 | National Laboratory, LANL, the U.S. Government, nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 26 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 27 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 29 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 35 | OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #include "PsiData.hh" 39 | #include 40 | 41 | 42 | #ifndef __COMMSIDES_HH__ 43 | #define __COMMSIDES_HH__ 44 | 45 | 46 | class CommSides 47 | { 48 | public: 49 | CommSides(); 50 | void commSides(PsiData &psi, PsiBoundData &psiBound); 51 | 52 | private: 53 | struct MetaData 54 | { 55 | UINT gSide; 56 | UINT angle; 57 | UINT cell; 58 | UINT face; 59 | }; 60 | 61 | std::vector c_adjRanks; 62 | std::vector> c_sendMetaData; 63 | std::vector c_numSendPackets; 64 | std::vector c_numRecvPackets; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/Global.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | 41 | // This is a hack to define the global variables in Global.hh. 42 | #define NO_EXTERN 43 | #include "Global.hh" 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/Global.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __GLOBAL_HH__ 41 | #define __GLOBAL_HH__ 42 | 43 | #include 44 | #include 45 | #include 46 | 47 | 48 | // Hack so I don't have to redefine extern variables in Global.cc 49 | #ifdef NO_EXTERN 50 | #define EXTERN 51 | #else 52 | #define EXTERN extern 53 | #endif 54 | 55 | 56 | // Forward declaration of classes needed for global pointers below 57 | class Quadrature; 58 | class TychoMesh; 59 | class SweepSchedule; 60 | class GraphTraverser; 61 | 62 | 63 | // Macro to get around some warnings 64 | #define UNUSED_VARIABLE(x) (void)(x) 65 | 66 | 67 | // Shorter version of uint64_t 68 | // Also allows changing the UINT type 69 | typedef uint64_t UINT; 70 | 71 | 72 | // Global constants 73 | static const UINT g_ndim = 3; 74 | static const UINT g_nVrtxPerCell = 4; 75 | static const UINT g_nVrtxPerFace = 3; 76 | static const UINT g_nFacePerCell = 4; 77 | 78 | 79 | // Enum types 80 | enum MPIType 81 | { 82 | MPIType_TychoTwoSided, 83 | MPIType_CapsaicinTwoSided, 84 | }; 85 | 86 | enum SweepType 87 | { 88 | SweepType_OriginalTycho1, 89 | SweepType_OriginalTycho2, 90 | SweepType_TraverseGraph, 91 | SweepType_PBJ, 92 | SweepType_PBJOuter, 93 | SweepType_Schur, 94 | SweepType_SchurOuter, 95 | SweepType_PBJSI, 96 | SweepType_SchurKrylov 97 | }; 98 | 99 | enum GaussElim 100 | { 101 | GaussElim_Original, 102 | GaussElim_NoPivot, 103 | GaussElim_CramerGlu, 104 | GaussElim_CramerIntel 105 | }; 106 | 107 | 108 | // Global variables 109 | EXTERN UINT g_nAngleGroups; 110 | EXTERN UINT g_nThreads; 111 | EXTERN UINT g_nGroups; 112 | EXTERN UINT g_snOrder; 113 | EXTERN UINT g_iterMax; 114 | EXTERN double g_errMax; 115 | EXTERN std::vector g_sigmaT; 116 | EXTERN std::vector g_sigmaS; 117 | EXTERN UINT g_maxCellsPerStep; 118 | EXTERN UINT g_intraAngleP; 119 | EXTERN UINT g_interAngleP; 120 | EXTERN SweepType g_sweepType; 121 | EXTERN TychoMesh *g_tychoMesh; 122 | EXTERN SweepSchedule **g_sweepSchedule; 123 | EXTERN Quadrature *g_quadrature; 124 | EXTERN GraphTraverser *g_graphTraverserForward; 125 | EXTERN GaussElim g_gaussElim; 126 | EXTERN bool g_outputFile; 127 | EXTERN std::string g_outputFilename; 128 | EXTERN UINT g_nAngles; 129 | EXTERN UINT g_nCells; 130 | EXTERN double g_ddErrMax; 131 | EXTERN UINT g_ddIterMax; 132 | EXTERN bool g_useSourceIteration; 133 | EXTERN MPIType g_mpiType; 134 | 135 | #endif 136 | 137 | -------------------------------------------------------------------------------- /src/GraphTraverser.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __GRAPH_TRAVERSER_HH__ 41 | #define __GRAPH_TRAVERSER_HH__ 42 | 43 | #include "Global.hh" 44 | #include "Mat.hh" 45 | #include 46 | #include 47 | #include 48 | 49 | /* 50 | Boundary Type for faces of a cell. 51 | They are split into incoming and outgoing wrt sweep direction. 52 | Interior means adjacent cell is on same proc. 53 | Interior boundary means adj cell is on different proc. 54 | Exterior boundary means it is a boundary for the whole mesh. 55 | */ 56 | enum BoundaryType 57 | { 58 | // Outgoing 59 | BoundaryType_OutIntBdry, // Interior boundary 60 | BoundaryType_OutExtBdry, // Exterior boundary 61 | BoundaryType_OutInt, // Interior 62 | 63 | // Incoming 64 | BoundaryType_InIntBdry, // Interior boundary 65 | BoundaryType_InExtBdry, // Exterior boundary 66 | BoundaryType_InInt // Interior 67 | }; 68 | 69 | 70 | enum Direction 71 | { 72 | Direction_Forward, 73 | Direction_Backward 74 | }; 75 | 76 | 77 | /* 78 | TraverseData class 79 | 80 | Abstract class defining the methods needed to traverse a graph. 81 | */ 82 | class TraverseData 83 | { 84 | public: 85 | virtual const char* getData(UINT cell, UINT face, UINT angle) = 0; 86 | virtual void setSideData(UINT side, UINT angle, const char *data) = 0; 87 | virtual UINT getPriority(UINT cell, UINT angle) = 0; 88 | virtual void update(UINT cell, UINT angle, 89 | UINT adjCellsSides[g_nFacePerCell], 90 | BoundaryType bdryType[g_nFacePerCell]) = 0; 91 | 92 | protected: 93 | // Don't allow construction of this base class. 94 | TraverseData() { } 95 | }; 96 | 97 | 98 | 99 | class GraphTraverser 100 | { 101 | public: 102 | GraphTraverser(Direction direction, bool doComm, UINT dataSizeInBytes); 103 | 104 | void traverse(const UINT maxComputePerStep, TraverseData &traverseData); 105 | 106 | private: 107 | 108 | void sendData2Sided(const std::vector> &sendBuffers) const; 109 | void recvData2Sided(std::vector &dataPackets) const; 110 | void sendAndRecvData(const std::vector> &sendBuffers, 111 | std::vector &dataPackets, 112 | std::vector &commDark, 113 | const bool killComm) const; 114 | 115 | std::vector c_adjRankIndexToRank; 116 | std::map c_adjRankToRankIndex; 117 | Mat2 c_initNumDependencies; 118 | Direction c_direction; 119 | bool c_doComm; 120 | UINT c_dataSizeInBytes; 121 | }; 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /src/KeyValueReader.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Obtained from 3 | https://github.com/ckrisgarrett/KeyValueReader 4 | */ 5 | 6 | /* 7 | The MIT License (MIT) 8 | 9 | Copyright (c) 2016 C. Kristopher Garrett 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | */ 29 | 30 | #ifndef __KEY_VALUE_READER_H 31 | #define __KEY_VALUE_READER_H 32 | 33 | #include 34 | 35 | namespace CKG_Utils { 36 | 37 | class KeyValueReader final 38 | { 39 | public: 40 | 41 | // Status error values 42 | enum Exception { 43 | ExceptionAlreadyReadAFile, 44 | ExceptionFileNotRead, 45 | ExceptionOpenFileError, 46 | ExceptionParseFileError, 47 | ExceptionKeyNotFound, 48 | ExceptionStringConversionError 49 | }; 50 | 51 | // Constructor/Destructor 52 | explicit KeyValueReader(); 53 | ~KeyValueReader(); 54 | 55 | // Don't allow copy or assignment operators 56 | KeyValueReader(const KeyValueReader &kvr) = delete; 57 | KeyValueReader &operator=(const KeyValueReader &kvr) = delete; 58 | 59 | // Interface 60 | void readFile(const std::string &filename); 61 | void getString(const std::string &key, std::string &value) const; 62 | void getInt(const std::string &key, int &value) const; 63 | void getDouble(const std::string &key, double &value) const; 64 | void getFloat(const std::string &key, float &value) const; 65 | void getBool(const std::string &key, bool &value) const; 66 | void print() const; 67 | void reset(); 68 | 69 | private: 70 | struct Private; 71 | Private *c_data; 72 | }; 73 | 74 | } // End namespace 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/KrylovSolver.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 5 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 6 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 7 | the U.S. Department of Energy. The U.S. Government has rights to use, 8 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 9 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 10 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 11 | to produce derivative works, such modified software should be clearly marked, 12 | so as not to confuse it with the version available from LANL. 13 | Additionally, redistribution and use in source and binary forms, with or 14 | without modification, are permitted provided that the following conditions 15 | are met: 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 22 | National Laboratory, LANL, the U.S. Government, nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 26 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 27 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 29 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 35 | OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #if USE_PETSC 39 | 40 | #include "KrylovSolver.hh" 41 | #include "Comm.hh" 42 | 43 | 44 | static 45 | PetscErrorCode lhsPetsc(Mat mat, Vec x, Vec b) 46 | { 47 | void *voidData; 48 | void *userData; 49 | KrylovSolver::Data *krylovData; 50 | KrylovSolver::Function lhsOperator; 51 | const double *xArray; 52 | double *bArray; 53 | 54 | 55 | // Get data for the solve 56 | MatShellGetContext(mat, &voidData); 57 | krylovData = (KrylovSolver::Data*) voidData; 58 | userData = krylovData->data; 59 | lhsOperator = krylovData->lhsOperator; 60 | 61 | 62 | // Get vector arrays 63 | VecGetArrayRead(x, &xArray); 64 | VecGetArray(b, &bArray); 65 | 66 | 67 | // Call user function 68 | lhsOperator(xArray, bArray, userData); 69 | 70 | 71 | // Restore vectors 72 | VecRestoreArrayRead(x, NULL); 73 | VecRestoreArray(b, NULL); 74 | 75 | return 0; 76 | } 77 | 78 | 79 | KrylovSolver::KrylovSolver(UINT localVecSize, double rtol, UINT iterMax, 80 | Function lhsOperator) 81 | { 82 | // Create the vectors 83 | UINT globalVecSize = localVecSize; 84 | Comm::gsum(globalVecSize); 85 | VecCreate(MPI_COMM_WORLD, &c_x); 86 | VecSetSizes(c_x, localVecSize, globalVecSize); 87 | VecSetType(c_x, VECMPI); 88 | VecDuplicate(c_x, &c_b); 89 | 90 | 91 | // Create matrix shell and define it as the operator 92 | MatCreateShell(MPI_COMM_WORLD, localVecSize, localVecSize, 93 | globalVecSize, globalVecSize, (void*)(NULL), &c_mat); 94 | MatShellSetOperation(c_mat, MATOP_MULT, (void(*)(void))lhsPetsc); 95 | 96 | 97 | // Create ksp and set tolerances 98 | KSPCreate(MPI_COMM_WORLD, &c_ksp); 99 | KSPSetOperators(c_ksp, c_mat, c_mat); 100 | KSPSetTolerances(c_ksp, rtol, PETSC_DEFAULT, PETSC_DEFAULT, iterMax); 101 | KSPSetType(c_ksp, KSPGMRES); 102 | 103 | 104 | // Set data 105 | c_krylovData.lhsOperator = lhsOperator; 106 | } 107 | 108 | 109 | void KrylovSolver::setData(void *data) 110 | { 111 | c_krylovData.data = data; 112 | MatShellSetContext(c_mat, &c_krylovData); 113 | } 114 | 115 | 116 | void KrylovSolver::setInitialGuessNonzero() 117 | { 118 | KSPSetInitialGuessNonzero(c_ksp, PETSC_TRUE); 119 | } 120 | 121 | 122 | double* KrylovSolver::getB() 123 | { 124 | double *bArray; 125 | VecGetArray(c_b, &bArray); 126 | return bArray; 127 | } 128 | 129 | 130 | void KrylovSolver::releaseB() 131 | { 132 | VecRestoreArray(c_b, NULL); 133 | } 134 | 135 | 136 | double* KrylovSolver::getX() 137 | { 138 | double *xArray; 139 | VecGetArray(c_x, &xArray); 140 | return xArray; 141 | } 142 | 143 | 144 | void KrylovSolver::releaseX() 145 | { 146 | VecRestoreArray(c_x, NULL); 147 | } 148 | 149 | 150 | UINT KrylovSolver::getNumIterations() 151 | { 152 | int iters; 153 | KSPGetIterationNumber(c_ksp, &iters); 154 | return iters; 155 | } 156 | 157 | 158 | double KrylovSolver::getResidualNorm() 159 | { 160 | double norm; 161 | KSPGetResidualNorm(c_ksp, &norm); 162 | return norm; 163 | } 164 | 165 | 166 | void KrylovSolver::solve() 167 | { 168 | KSPSolve(c_ksp, c_b, c_x); 169 | } 170 | 171 | 172 | KrylovSolver::~KrylovSolver() 173 | { 174 | // Destroy vectors, ksp, and matrices to free work space 175 | VecDestroy(&c_x); 176 | VecDestroy(&c_b); 177 | MatDestroy(&c_mat); 178 | KSPDestroy(&c_ksp); 179 | } 180 | 181 | #endif 182 | -------------------------------------------------------------------------------- /src/KrylovSolver.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 5 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 6 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 7 | the U.S. Department of Energy. The U.S. Government has rights to use, 8 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 9 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 10 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 11 | to produce derivative works, such modified software should be clearly marked, 12 | so as not to confuse it with the version available from LANL. 13 | Additionally, redistribution and use in source and binary forms, with or 14 | without modification, are permitted provided that the following conditions 15 | are met: 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 22 | National Laboratory, LANL, the U.S. Government, nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 26 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 27 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 29 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 35 | OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #ifndef __KRYLOV_SOLVER_HH__ 39 | #define __KRYLOV_SOLVER_HH__ 40 | 41 | 42 | /* 43 | If using PETSc. 44 | */ 45 | #if USE_PETSC 46 | #include "Global.hh" 47 | #include 48 | #include 49 | #include 50 | 51 | class KrylovSolver 52 | { 53 | public: 54 | typedef void (*Function)(const double*, double*, void*); 55 | 56 | 57 | KrylovSolver(UINT localVecSize, double rtol, UINT iterMax, 58 | Function lhsOperator); 59 | ~KrylovSolver(); 60 | 61 | 62 | void solve(); 63 | double* getB(); 64 | void releaseB(); 65 | double* getX(); 66 | void releaseX(); 67 | UINT getNumIterations(); 68 | double getResidualNorm(); 69 | void setData(void *data); 70 | void setInitialGuessNonzero(); 71 | 72 | 73 | struct Data 74 | { 75 | void *data; 76 | Function lhsOperator; 77 | }; 78 | 79 | private: 80 | 81 | KSP c_ksp; 82 | Mat c_mat; 83 | Vec c_x, c_b; 84 | Data c_krylovData; 85 | }; 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | /* 94 | If not using PETSc. 95 | */ 96 | #else 97 | #include "Global.hh" 98 | 99 | class KrylovSolver 100 | { 101 | public: 102 | typedef void (*Function)(const double*, double*, void*); 103 | 104 | 105 | KrylovSolver(UINT localVecSize, double rtol, UINT iterMax, 106 | Function lhsOperator) 107 | { 108 | UNUSED_VARIABLE(localVecSize); 109 | UNUSED_VARIABLE(rtol); 110 | UNUSED_VARIABLE(iterMax); 111 | UNUSED_VARIABLE(lhsOperator); 112 | Insist(false, "KrylovSolver: PETSc not in use."); 113 | } 114 | ~KrylovSolver() {} 115 | 116 | 117 | void solve() { } 118 | double* getB() { return NULL; } 119 | void releaseB() {} 120 | double* getX() { return NULL; } 121 | void releaseX() {} 122 | UINT getNumIterations() { return 0; } 123 | double getResidualNorm() { return 0.0; } 124 | void setData(void *data) { UNUSED_VARIABLE(data); } 125 | void setInitialGuessNonzero() {} 126 | 127 | 128 | struct Data 129 | { 130 | void *data; 131 | Function lhsOperator; 132 | }; 133 | 134 | private: 135 | 136 | }; 137 | 138 | 139 | 140 | #endif 141 | 142 | 143 | 144 | 145 | #endif 146 | 147 | -------------------------------------------------------------------------------- /src/ParallelMesh.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __PARALLEL_MESH_HH__ 41 | #define __PARALLEL_MESH_HH__ 42 | 43 | /* 44 | File format on disk. 45 | 46 | (Array(32)) "Tycho 2 Parallel Mesh" (Rest of characters set to 0) 47 | (uint64_t) version of parallel mesh format (version 2 currently) 48 | (uint64_t) number of partitions 49 | (Array(num partitions + 1)) offsets in bytes for the partition data 50 | (Array(num partitions)) partition data 51 | 52 | Partition Data Format 53 | (uint64_t) number of cells 54 | (uint64_t) number of faces 55 | (uint64_t) number of nodes 56 | (Array(num cells)) cell data 57 | (Array(num faces)) face data 58 | (Array(num nodes)) node data 59 | 60 | Cell Data Format: 61 | (uint64_t[4]) bounding faces 62 | (uint64_t[4]) bounding nodes 63 | (uint64_t) global ID 64 | (uint64_t) material index 65 | 66 | Face Data Format: 67 | (uint64_t[2]) bounding cells 68 | (uint64_t[3]) bounding nodes 69 | (uint64_t) global ID 70 | (uint64_t[2]) partition 71 | (uint64_t) boundary type 72 | (Note: if only one bounding cell because of a mesh boundary, 73 | bounding cell 2 has index INVALID_INDEX) 74 | (Note: if bounding cell is in another partition, the local cell id for that 75 | partition is inserted) 76 | (Note: if on boundary of mesh, partition 2 = INVALID_INDEX) 77 | 78 | Node Data Format: 79 | (double[3]) coordinates 80 | (uint64_t) global ID 81 | */ 82 | 83 | #include "SerialMesh.hh" 84 | #include 85 | #include 86 | #include 87 | 88 | 89 | class ParallelMesh 90 | { 91 | public: 92 | 93 | static const uint64_t INVALID_INDEX = UINT64_MAX; // Indicates boundary 94 | static const uint64_t VERSION = 2; 95 | static const uint64_t MESH_FORMAT_NAME_LEN = 32; 96 | 97 | 98 | // Sub-structures 99 | enum BoundaryType 100 | { 101 | MeshBoundary, PartitionBoundary, NotBoundary, NumBoundaryTypes 102 | }; 103 | struct CellData 104 | { 105 | uint64_t boundingFaces[4]; 106 | uint64_t boundingNodes[4]; 107 | uint64_t globalID; 108 | uint64_t materialIndex; 109 | }; 110 | struct FaceData 111 | { 112 | uint64_t boundingCells[2]; 113 | uint64_t boundingNodes[3]; 114 | uint64_t globalID; 115 | uint64_t partition[2]; 116 | uint64_t boundaryType; 117 | }; 118 | struct NodeData 119 | { 120 | double coords[3]; 121 | uint64_t globalID; 122 | }; 123 | struct PartitionData 124 | { 125 | uint64_t numCells; 126 | uint64_t numFaces; 127 | uint64_t numNodes; 128 | std::vector cellData; 129 | std::vector faceData; 130 | std::vector nodeData; 131 | }; 132 | 133 | 134 | // Data 135 | char c_meshFormatName[MESH_FORMAT_NAME_LEN]; 136 | uint64_t c_version; 137 | uint64_t c_numPartitions; 138 | std::vector c_bytesOffset; 139 | std::vector c_partitionData; 140 | 141 | 142 | // Read and write functions 143 | void write(const std::string &filename); 144 | void read(const std::string &filename); 145 | void print(bool printVerbose); 146 | void createFromSerialMesh(const SerialMesh &serialMesh, 147 | const std::vector &partitionVector, 148 | const int numPartitions); 149 | 150 | static 151 | void printPartitionData(const PartitionData &partData, bool printVerbose); 152 | 153 | #ifndef PARALLEL_MESH_READ_SERIAL_ONLY 154 | static 155 | void readInParallel(const std::string &filename, PartitionData &partData); 156 | #endif 157 | }; 158 | 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /src/Priorities.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __PRIORITIES_HH__ 41 | #define __PRIORITIES_HH__ 42 | 43 | #include "Mat.hh" 44 | #include "Global.hh" 45 | 46 | namespace Priorities 47 | { 48 | 49 | void calcPriorities(Mat2 &priorities); 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Problem.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | 41 | #include "Problem.hh" 42 | #include "Comm.hh" 43 | #include 44 | 45 | 46 | // cubeSize assumes using cube meshes in util folder 47 | static const double cubeSize = 100.0; 48 | 49 | 50 | /* 51 | hatSource 52 | */ 53 | static 54 | void hatSource(PsiData &source) 55 | { 56 | for(UINT cell = 0; cell < g_nCells; cell++) { 57 | for(UINT angle = 0; angle < g_nAngles; angle++) { 58 | for(UINT vrtx = 0; vrtx < g_nVrtxPerCell; vrtx++) { 59 | 60 | UINT node = g_tychoMesh->getCellNode(cell, vrtx); 61 | double x = g_tychoMesh->getNodeCoord(node, 0) - cubeSize / 2.0; 62 | double y = g_tychoMesh->getNodeCoord(node, 1) - cubeSize / 2.0; 63 | double z = g_tychoMesh->getNodeCoord(node, 2) - cubeSize / 2.0; 64 | 65 | double xi = g_quadrature->getXi(angle); 66 | double eta = g_quadrature->getEta(angle); 67 | double mu = g_quadrature->getMu(angle); 68 | 69 | double c = sqrt(x*x + y*y + z*z); 70 | 71 | for(UINT group = 0; group < g_nGroups; group++) { 72 | if(c <= 30.0) { 73 | source(group, vrtx, angle, cell) = 74 | - x / (30.0*c) * xi - y / (30.0*c) * eta - z / (30.0*c) * mu 75 | + (g_sigmaT[cell] - g_sigmaS[cell]) * (1.0 - c / 30.0); 76 | } 77 | else { 78 | source(group, vrtx, angle, cell) = 0.0; 79 | } 80 | } 81 | }}} 82 | } 83 | 84 | 85 | namespace Problem 86 | { 87 | 88 | /* 89 | hatL2Error 90 | */ 91 | double hatL2Error(const PsiData &psi) 92 | { 93 | double diff = 0.0; 94 | double norm = 0.0; 95 | 96 | 97 | for(UINT cell = 0; cell < g_nCells; cell++) { 98 | for(UINT angle = 0; angle < g_nAngles; angle++) { 99 | for(UINT group = 0; group < g_nGroups; group++) { 100 | double x = 0.0; 101 | double y = 0.0; 102 | double z = 0.0; 103 | double psiVal = 0.0; 104 | 105 | for(UINT vrtx = 0; vrtx < g_nVrtxPerCell; vrtx++) { 106 | UINT node = g_tychoMesh->getCellNode(cell, vrtx); 107 | x += g_tychoMesh->getNodeCoord(node, 0) - cubeSize / 2.0; 108 | y += g_tychoMesh->getNodeCoord(node, 1) - cubeSize / 2.0; 109 | z += g_tychoMesh->getNodeCoord(node, 2) - cubeSize / 2.0; 110 | psiVal += psi(group, vrtx, angle, cell); 111 | } 112 | 113 | x = x / g_nVrtxPerCell; 114 | y = y / g_nVrtxPerCell; 115 | z = z / g_nVrtxPerCell; 116 | psiVal = psiVal / g_nVrtxPerCell; 117 | 118 | double c = sqrt(x*x + y*y + z*z); 119 | double psiAct = 0.0; 120 | if(c <= 30.0) { 121 | psiAct = 1.0 - c / 30.0; 122 | } 123 | 124 | double localDiff = psiVal - psiAct; 125 | norm += psiVal * psiVal; 126 | diff += localDiff * localDiff; 127 | }}} 128 | 129 | 130 | Comm::gsum(norm); 131 | Comm::gsum(diff); 132 | 133 | return sqrt(diff / norm); 134 | } 135 | 136 | 137 | /* 138 | getProblemSource 139 | */ 140 | void getSource(PsiData &source) 141 | { 142 | hatSource(source); 143 | } 144 | 145 | 146 | /* 147 | createCrossSections 148 | */ 149 | void createCrossSections(std::vector &sigmaT, 150 | std::vector &sigmaS, 151 | double sigmaT1, double sigmaS1, 152 | double sigmaT2, double sigmaS2) 153 | { 154 | sigmaT.resize(g_nCells); 155 | sigmaS.resize(g_nCells); 156 | 157 | for (UINT cell = 0; cell < g_nCells; cell++) { 158 | 159 | UINT material = g_tychoMesh->getCellMaterial(cell); 160 | if (material == 1) { 161 | sigmaT[cell] = sigmaT1; 162 | sigmaS[cell] = sigmaS1; 163 | } 164 | else if (material == 2) { 165 | sigmaT[cell] = sigmaT2; 166 | sigmaS[cell] = sigmaS2; 167 | } 168 | else { 169 | Insist(false, "Material index out of bounds."); 170 | } 171 | } 172 | } 173 | 174 | 175 | } // End namespace Problem 176 | -------------------------------------------------------------------------------- /src/Problem.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __PROBLEM_HH__ 41 | #define __PROBLEM_HH__ 42 | 43 | #include "PsiData.hh" 44 | #include 45 | 46 | namespace Problem 47 | { 48 | 49 | double hatL2Error(const PsiData &psi); 50 | void getSource(PsiData &source); 51 | void createCrossSections(std::vector &sigmaT, 52 | std::vector &sigmaS, 53 | double sigmaT1, double sigmaS1, 54 | double sigmaT2, double sigmaS2); 55 | 56 | } // End namespace 57 | #endif 58 | -------------------------------------------------------------------------------- /src/PsiData.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | 41 | #include "PsiData.hh" 42 | #include "Comm.hh" 43 | #include 44 | 45 | 46 | /* 47 | writeToFile 48 | 49 | Writes psi to a file in parallel. 50 | 51 | Data Format: 52 | char[32]: "Tycho 2 Psi Output" (zeros for any trailing characters 53 | uint64_t: version of file format 54 | uint64_t: number of cells 55 | uint64_t: number of angles 56 | uint64_t: number of energy groups 57 | CellData[]: array of cell data 58 | 59 | CellData Format: 60 | double[]: psi(:, :, :, global cell index) 61 | */ 62 | void PsiData::writeToFile(const std::string &filename) 63 | { 64 | MPI_File file; 65 | char outputName[32] = { 66 | 'T', 'y', 'c', 'h', 'o', ' ', '2', ' ', 'P', 's', 'i', ' ', 67 | 'O', 'u', 't', 'p', 'u', 't', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 68 | }; 69 | uint64_t restOfHeader[4]; 70 | 71 | 72 | // Fill in rest of header 73 | // version, number of cells, number of angles, and number of group 74 | restOfHeader[0] = 1; 75 | restOfHeader[1] = c_nc; 76 | Comm::gsum(restOfHeader[1]); 77 | restOfHeader[2] = c_na; 78 | restOfHeader[3] = c_ng; 79 | 80 | 81 | // Open file 82 | Comm::openFileForWrite(filename, file); 83 | 84 | 85 | // If rank 0, write header data 86 | if (Comm::rank() == 0) { 87 | double header[8]; 88 | memcpy(header, outputName, 4 * sizeof(double)); 89 | memcpy(&header[4], restOfHeader, 4 * sizeof(double)); 90 | Comm::writeDoublesAt(file, 0, header, 8); 91 | } 92 | 93 | 94 | // Write data one cell at a time 95 | for (size_t cell = 0; cell < c_nc; cell++) { 96 | int dataSize = c_na * c_ng * c_nv; 97 | uint64_t globalCell = g_tychoMesh->getLGCell(cell); 98 | uint64_t offset = 8 + globalCell * dataSize; 99 | double *data = &c_data[index(0, 0, 0, cell)]; 100 | Comm::writeDoublesAt(file, offset, data, dataSize); 101 | } 102 | 103 | 104 | // Close file 105 | Comm::closeFile(file); 106 | } 107 | 108 | 109 | -------------------------------------------------------------------------------- /src/Quadrature.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __QUADRATURE_HH__ 41 | #define __QUADRATURE_HH__ 42 | 43 | #include "Global.hh" 44 | #include 45 | 46 | 47 | class Quadrature 48 | { 49 | public: 50 | Quadrature(const UINT snOrder); 51 | 52 | double getMu(const UINT angle) const; 53 | double getEta(const UINT angle) const; 54 | double getXi(const UINT angle) const; 55 | double getWt(const UINT angle) const; 56 | std::vector getOmega(const UINT angle) const; 57 | 58 | private: 59 | std::vector c_xi; 60 | std::vector c_eta; 61 | std::vector c_mu; 62 | std::vector c_w; 63 | }; 64 | 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /src/SerialMesh.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SERIAL_MESH_HH__ 41 | #define __SERIAL_MESH_HH__ 42 | 43 | /* 44 | File format on disk. 45 | 46 | (Array(32)) "Tycho 2 Serial Mesh" (Rest of characters set to 0) 47 | (uint64_t) version of serial mesh format (version 2 currently) 48 | (uint64_t) number of cells 49 | (uint64_t) number of faces 50 | (uint64_t) number of nodes 51 | (Array(num cells)) cell data 52 | (Array(num cells)) face data 53 | (Array(num cells)) node data 54 | 55 | Cell Data Format: 56 | (uint64_t[4]) bounding faces 57 | (uint64_t[4]) bounding nodes 58 | (uint64_t) material index 59 | 60 | Face Data Format: 61 | (uint64_t[2]) bounding cells 62 | (uint64_t[3]) bounding nodes 63 | (Note: if only one bounding cell because of a boundary, the second bounding 64 | cell has value INVALID_INDEX) 65 | 66 | Node Data Format: 67 | (double[3]) coordinates 68 | */ 69 | 70 | #include 71 | #include 72 | #include 73 | 74 | 75 | class SerialMesh 76 | { 77 | public: 78 | 79 | static const uint64_t INVALID_INDEX = UINT64_MAX; // Indicates boundary 80 | static const uint64_t VERSION = 2; 81 | static const uint64_t MESH_FORMAT_NAME_LEN = 32; 82 | 83 | 84 | // Sub-structures 85 | struct CellData 86 | { 87 | uint64_t boundingFaces[4]; 88 | uint64_t boundingNodes[4]; 89 | uint64_t materialIndex; 90 | }; 91 | struct FaceData 92 | { 93 | uint64_t boundingCells[2]; 94 | uint64_t boundingNodes[3]; 95 | }; 96 | struct NodeData 97 | { 98 | double coords[3]; 99 | }; 100 | 101 | 102 | // Data 103 | char c_meshFormatName[MESH_FORMAT_NAME_LEN]; 104 | uint64_t c_version; 105 | uint64_t c_numCells; 106 | uint64_t c_numFaces; 107 | uint64_t c_numNodes; 108 | std::vector c_cellData; 109 | std::vector c_faceData; 110 | std::vector c_nodeData; 111 | 112 | 113 | // Read and write functions 114 | void write(const std::string &filename); 115 | void read(const std::string &filename); 116 | void print(bool printVerbose); 117 | }; 118 | 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /src/SourceIteration.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SOURCE_ITERATION_HH__ 41 | #define __SOURCE_ITERATION_HH__ 42 | 43 | 44 | #include "SweeperAbstract.hh" 45 | #include "Global.hh" 46 | 47 | namespace SourceIteration 48 | { 49 | 50 | UINT fixedPoint(SweeperAbstract &sweeper, PsiData &psi, const PsiData &source); 51 | UINT krylov(SweeperAbstract &sweeper, PsiData &psi, const PsiData &source); 52 | 53 | } // End namespace 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/SweepData.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SWEEP_DATA_HH__ 41 | #define __SWEEP_DATA_HH__ 42 | 43 | 44 | #include "Assert.hh" 45 | #include "GraphTraverser.hh" 46 | #include "Transport.hh" 47 | #include "Global.hh" 48 | #include 49 | #include 50 | 51 | /* 52 | SweepData 53 | 54 | Holds psi and other data for the sweep. 55 | */ 56 | class SweepData : public TraverseData 57 | { 58 | public: 59 | 60 | SweepData(PsiData &psi, const PsiData &source, PsiBoundData &psiBound, 61 | const Mat2 &priorities) 62 | : c_psi(psi), c_psiBound(psiBound), c_source(source), 63 | c_priorities(priorities), c_localFaceData(g_nThreads), 64 | c_localSource(g_nThreads), c_localPsi(g_nThreads), 65 | c_localPsiBound(g_nThreads) 66 | { 67 | for (UINT angleGroup = 0; angleGroup < g_nThreads; angleGroup++) { 68 | c_localFaceData[angleGroup].resize(g_nVrtxPerFace, g_nGroups); 69 | c_localSource[angleGroup].resize(g_nVrtxPerCell, g_nGroups); 70 | c_localPsi[angleGroup].resize(g_nVrtxPerCell, g_nGroups); 71 | c_localPsiBound[angleGroup].resize(g_nVrtxPerFace, g_nFacePerCell, 72 | g_nGroups); 73 | } 74 | } 75 | 76 | 77 | /* 78 | getDataSizeInBytes 79 | */ 80 | static 81 | size_t getDataSizeInBytes() 82 | { 83 | return g_nGroups * g_nVrtxPerFace * sizeof(double); 84 | } 85 | 86 | 87 | /* 88 | data 89 | 90 | Return psi for vertices and groups at the given (cell,face,angle) tuple 91 | */ 92 | virtual const char* getData(UINT cell, UINT face, UINT angle) 93 | { 94 | Mat2 &localFaceData = c_localFaceData[omp_get_thread_num()]; 95 | 96 | for (UINT group = 0; group < g_nGroups; group++) { 97 | for (UINT fvrtx = 0; fvrtx < g_nVrtxPerFace; fvrtx++) { 98 | UINT vrtx = g_tychoMesh->getFaceToCellVrtx(cell, face, fvrtx); 99 | localFaceData(fvrtx, group) = c_psi(group, vrtx, angle, cell); 100 | }} 101 | 102 | return (char*) (&localFaceData[0]); 103 | } 104 | 105 | 106 | /* 107 | sideData 108 | 109 | Set psiBound for the (side, angle) pair. 110 | */ 111 | virtual void setSideData(UINT side, UINT angle, const char *data) 112 | { 113 | Mat2 localFaceData(g_nVrtxPerFace, g_nGroups); 114 | localFaceData.setData((double*)data); 115 | 116 | for (UINT fvrtx = 0; fvrtx < g_nVrtxPerFace; fvrtx++) { 117 | for (UINT group = 0; group < g_nGroups; group++) { 118 | c_psiBound(group, fvrtx, angle, side) = localFaceData(fvrtx, group); 119 | }} 120 | } 121 | 122 | 123 | /* 124 | getPriority 125 | 126 | Return a priority for the cell/angle pair. 127 | */ 128 | virtual UINT getPriority(UINT cell, UINT angle) 129 | { 130 | return c_priorities(cell, angle); 131 | } 132 | 133 | 134 | /* 135 | update 136 | 137 | Does a transport update for the given cell/angle pair. 138 | */ 139 | virtual void update(UINT cell, UINT angle, 140 | UINT adjCellsSides[g_nFacePerCell], 141 | BoundaryType bdryType[g_nFacePerCell]) 142 | { 143 | UNUSED_VARIABLE(adjCellsSides); 144 | UNUSED_VARIABLE(bdryType); 145 | 146 | Mat2 &localSource = c_localSource[omp_get_thread_num()]; 147 | Mat2 &localPsi = c_localPsi[omp_get_thread_num()]; 148 | Mat3 &localPsiBound = c_localPsiBound[omp_get_thread_num()]; 149 | 150 | 151 | // Populate localSource 152 | #pragma omp simd 153 | for (UINT group = 0; group < g_nGroups; group++) { 154 | for (UINT vrtx = 0; vrtx < g_nVrtxPerCell; vrtx++) { 155 | localSource(vrtx, group) = c_source(group, vrtx, angle, cell); 156 | }} 157 | 158 | 159 | // Populate localPsiBound 160 | Transport::populateLocalPsiBound(angle, cell, c_psi, c_psiBound, 161 | localPsiBound); 162 | 163 | 164 | // Transport solve 165 | Transport::solve(cell, angle, g_sigmaT[cell], 166 | localPsiBound, localSource, localPsi); 167 | 168 | 169 | // localPsi -> psi 170 | for (UINT group = 0; group < g_nGroups; group++) { 171 | for (UINT vrtx = 0; vrtx < g_nVrtxPerCell; vrtx++) { 172 | c_psi(group, vrtx, angle, cell) = localPsi(vrtx, group); 173 | }} 174 | } 175 | 176 | private: 177 | PsiData &c_psi; 178 | PsiBoundData &c_psiBound; 179 | const PsiData &c_source; 180 | const Mat2 &c_priorities; 181 | std::vector> c_localFaceData; 182 | std::vector> c_localSource; 183 | std::vector> c_localPsi; 184 | std::vector> c_localPsiBound; 185 | }; 186 | 187 | #endif 188 | 189 | -------------------------------------------------------------------------------- /src/SweepSchedule.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SWEEP_SCHEDULE_HH__ 41 | #define __SWEEP_SCHEDULE_HH__ 42 | 43 | #include "Global.hh" 44 | #include 45 | 46 | 47 | class SweepSchedule 48 | { 49 | public: 50 | 51 | // Class holding a unit of work for the sweeper 52 | class Work 53 | { 54 | private: 55 | UINT c_cell; 56 | UINT c_angle; 57 | 58 | public: 59 | Work(UINT cell, UINT angle) : c_cell(cell), c_angle(angle) {} 60 | UINT getCell() const { return c_cell; } 61 | UINT getAngle() const { return c_angle; } 62 | }; 63 | 64 | 65 | // SweepSchedule implementation 66 | SweepSchedule(const std::vector &angles, 67 | const UINT maxCellsPerStep, 68 | const UINT intraAngleP, 69 | const UINT interAngleP); 70 | 71 | UINT nSteps() const 72 | { return c_workOrders.size(); } 73 | const std::vector& getWork(const UINT step) const 74 | { return c_workOrders[step]; } 75 | const std::vector& getSendProcs(const UINT step) const 76 | { return c_sendProcs[step]; } 77 | const std::vector& getRecvProcs(const UINT step) const 78 | { return c_recvProcs[step]; } 79 | 80 | 81 | private: 82 | // work to be performed in each step 83 | std::vector > c_workOrders; 84 | // processors to send data to after each step 85 | std::vector > c_sendProcs; 86 | // processors to receive data from after each step 87 | std::vector > c_recvProcs; 88 | }; 89 | 90 | 91 | #endif 92 | 93 | -------------------------------------------------------------------------------- /src/Sweeper.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SWEEPER_HH__ 41 | #define __SWEEPER_HH__ 42 | 43 | #include "PsiData.hh" 44 | #include "SweeperAbstract.hh" 45 | 46 | class Sweeper : public SweeperAbstract 47 | { 48 | public: 49 | Sweeper(); 50 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 51 | void solve(); 52 | 53 | private: 54 | 55 | }; 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/SweeperAbstract.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SWEEPER_ABSTRACT_HH__ 41 | #define __SWEEPER_ABSTRACT_HH__ 42 | 43 | #include "PsiData.hh" 44 | #include 45 | 46 | 47 | class SweeperAbstract 48 | { 49 | public: 50 | virtual 51 | void sweep(PsiData &psi, const PsiData &source, 52 | bool zeroPsiBound = false) = 0; 53 | 54 | virtual 55 | void solve() = 0; 56 | 57 | void writePsiToFile(std::string &filename) 58 | { 59 | c_psi.writeToFile(filename); 60 | } 61 | 62 | PsiData& getPsi() 63 | { 64 | return c_psi; 65 | } 66 | 67 | protected: 68 | PsiData c_psi; 69 | PsiData c_source; 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/SweeperPBJ.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 5 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 6 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 7 | the U.S. Department of Energy. The U.S. Government has rights to use, 8 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 9 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 10 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 11 | to produce derivative works, such modified software should be clearly marked, 12 | so as not to confuse it with the version available from LANL. 13 | Additionally, redistribution and use in source and binary forms, with or 14 | without modification, are permitted provided that the following conditions 15 | are met: 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 22 | National Laboratory, LANL, the U.S. Government, nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 26 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 27 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 29 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 35 | OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #ifndef __SWEEPER_PBJ_HH__ 39 | #define __SWEEPER_PBJ_HH__ 40 | 41 | #include "PsiData.hh" 42 | #include "SweeperAbstract.hh" 43 | #include "CommSides.hh" 44 | 45 | 46 | /* 47 | SweeperPBJ 48 | 49 | Used for PBJ inside collision operator. 50 | */ 51 | class SweeperPBJ : public SweeperAbstract 52 | { 53 | public: 54 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 55 | void solve(); 56 | 57 | private: 58 | CommSides c_commSides; 59 | PsiBoundData c_psiBoundPrev; 60 | UINT c_iters; 61 | }; 62 | 63 | 64 | /* 65 | SweeperPBJOuter 66 | 67 | Used for PBJ outside collision operator. 68 | */ 69 | class SweeperPBJOuter : public SweeperAbstract 70 | { 71 | public: 72 | void solve(); 73 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 74 | 75 | private: 76 | CommSides c_commSides; 77 | PsiBoundData c_psiBound; 78 | PsiBoundData c_zeroPsiBound; 79 | }; 80 | 81 | 82 | /* 83 | SweeperPBJSI 84 | 85 | Used for PBJ and source iteration at the same time. 86 | */ 87 | class SweeperPBJSI : public SweeperAbstract 88 | { 89 | public: 90 | void solve(); 91 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 92 | 93 | private: 94 | CommSides c_commSides; 95 | PsiBoundData c_psiBound; 96 | }; 97 | 98 | 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /src/SweeperSchur.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 5 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 6 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 7 | the U.S. Department of Energy. The U.S. Government has rights to use, 8 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 9 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 10 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 11 | to produce derivative works, such modified software should be clearly marked, 12 | so as not to confuse it with the version available from LANL. 13 | Additionally, redistribution and use in source and binary forms, with or 14 | without modification, are permitted provided that the following conditions 15 | are met: 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 22 | National Laboratory, LANL, the U.S. Government, nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 26 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 27 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 29 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 35 | OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #ifndef __SWEEPER_SCHUR_HH__ 39 | #define __SWEEPER_SCHUR_HH__ 40 | 41 | #include "PsiData.hh" 42 | #include "SweeperAbstract.hh" 43 | #include "CommSides.hh" 44 | #include "KrylovSolver.hh" 45 | 46 | 47 | /* 48 | SweeperSchur 49 | 50 | Used for Schur inside collision operator. 51 | */ 52 | class SweeperSchur : public SweeperAbstract 53 | { 54 | public: 55 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 56 | void solve(); 57 | 58 | private: 59 | CommSides c_commSides; 60 | PsiBoundData c_psiBoundPrev; 61 | KrylovSolver *c_krylovSolver; 62 | UINT c_iters; 63 | }; 64 | 65 | 66 | /* 67 | SweeperSchurOuter 68 | 69 | Used for Schur outside collision operator. 70 | */ 71 | class SweeperSchurOuter : public SweeperAbstract 72 | { 73 | public: 74 | void solve(); 75 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 76 | 77 | private: 78 | CommSides c_commSides; 79 | KrylovSolver *c_krylovSolver; 80 | PsiBoundData c_psiBound; 81 | PsiBoundData c_zeroPsiBound; 82 | }; 83 | 84 | 85 | /* 86 | SweeperSchurKrylov 87 | 88 | Combines Schur and Krylov iterations. 89 | */ 90 | class SweeperSchurKrylov : public SweeperAbstract 91 | { 92 | public: 93 | void solve(); 94 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 95 | 96 | private: 97 | CommSides c_commSides; 98 | KrylovSolver *c_krylovSolver; 99 | PsiBoundData c_psiBound; 100 | }; 101 | 102 | 103 | #endif 104 | 105 | -------------------------------------------------------------------------------- /src/SweeperTraverse.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include "SweeperTraverse.hh" 41 | #include "SourceIteration.hh" 42 | #include "Problem.hh" 43 | #include "SweepData.hh" 44 | #include "Global.hh" 45 | #include "GraphTraverser.hh" 46 | #include "Priorities.hh" 47 | #include "PsiData.hh" 48 | 49 | using namespace std; 50 | 51 | 52 | /* 53 | SweeperTraverse constructor 54 | */ 55 | SweeperTraverse::SweeperTraverse() 56 | { 57 | c_priorities.resize(g_nCells, g_nAngles); 58 | Priorities::calcPriorities(c_priorities); 59 | } 60 | 61 | 62 | /* 63 | solve 64 | */ 65 | void SweeperTraverse::solve() 66 | { 67 | Problem::getSource(c_source); 68 | c_psi.setToValue(0.0); 69 | 70 | if (g_useSourceIteration) 71 | SourceIteration::fixedPoint(*this, c_psi, c_source); 72 | else 73 | SourceIteration::krylov(*this, c_psi, c_source); 74 | } 75 | 76 | 77 | /* 78 | SweeperTraverse::sweep 79 | 80 | Sweep by traversing graph. 81 | */ 82 | void SweeperTraverse::sweep(PsiData &psi, const PsiData &source, 83 | bool zeroPsiBound) 84 | { 85 | UNUSED_VARIABLE(zeroPsiBound); 86 | PsiBoundData psiBound; 87 | SweepData sweepData(psi, source, psiBound, c_priorities); 88 | g_graphTraverserForward->traverse(g_maxCellsPerStep, sweepData); 89 | } 90 | 91 | -------------------------------------------------------------------------------- /src/SweeperTraverse.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __SWEEPER_TRAVERSE_HH__ 41 | #define __SWEEPER_TRAVERSE_HH__ 42 | 43 | #include "Mat.hh" 44 | #include "PsiData.hh" 45 | #include "Global.hh" 46 | #include "SweeperAbstract.hh" 47 | 48 | 49 | class SweeperTraverse : public SweeperAbstract 50 | { 51 | public: 52 | SweeperTraverse(); 53 | void sweep(PsiData &psi, const PsiData &source, bool zeroPsiBound); 54 | void solve(); 55 | 56 | private: 57 | Mat2 c_priorities; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Timer.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __TIMER_HH__ 41 | #define __TIMER_HH__ 42 | 43 | #include "Global.hh" 44 | #include "Assert.hh" 45 | #include 46 | 47 | 48 | /* 49 | Timer 50 | 51 | Implements a high resolution timer. 52 | */ 53 | class Timer 54 | { 55 | private: 56 | std::chrono::high_resolution_clock::time_point begin; 57 | std::chrono::high_resolution_clock::time_point end; 58 | bool timer_on; 59 | double sum_wall; 60 | UINT num_intervals; 61 | 62 | 63 | public: 64 | // Constructor 65 | Timer() 66 | { 67 | timer_on = false; 68 | reset(); 69 | } 70 | 71 | // Start the timer 72 | inline 73 | void start() 74 | { 75 | Assert(!timer_on); 76 | timer_on = true; 77 | ++num_intervals; 78 | begin = std::chrono::high_resolution_clock::now(); 79 | } 80 | 81 | // Stop the timer (does not reset the timer) 82 | inline 83 | void stop() 84 | { 85 | Assert(timer_on); 86 | end = std::chrono::high_resolution_clock::now(); 87 | timer_on = false; 88 | sum_wall += wall_clock(); 89 | } 90 | 91 | // Get last timer stop() - start() 92 | inline 93 | double wall_clock() const 94 | { 95 | Assert(!timer_on); 96 | std::chrono::duration timeSpan = end - begin; 97 | return timeSpan.count(); 98 | } 99 | 100 | // Return sum of stop() - start() times 101 | inline 102 | double sum_wall_clock() const 103 | { 104 | Assert(!timer_on); 105 | return sum_wall; 106 | } 107 | 108 | // Return number of times timer has been used 109 | inline 110 | int intervals() const 111 | { 112 | Assert(!timer_on); 113 | return num_intervals; 114 | } 115 | 116 | // Reset timer 117 | inline 118 | void reset() 119 | { 120 | Assert(!timer_on); 121 | num_intervals = 0; 122 | sum_wall = 0.0; 123 | } 124 | }; 125 | 126 | 127 | 128 | #endif 129 | 130 | -------------------------------------------------------------------------------- /src/Transport.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __TRANSPORT_HH__ 41 | #define __TRANSPORT_HH__ 42 | 43 | #include "Mat.hh" 44 | #include "PsiData.hh" 45 | #include "Global.hh" 46 | 47 | 48 | namespace Transport 49 | { 50 | void solve(const UINT cell, const UINT angle, 51 | const double sigmaTotal, 52 | const Mat3 &localPsiBound, 53 | const Mat2 &localSource, 54 | Mat2 &localPsi); 55 | 56 | void populateLocalPsiBound(const UINT angle, const UINT cell, 57 | const PsiData &psi, const PsiBoundData &psiBound, 58 | Mat3 &localPsiBound); 59 | } // End namespace Transport 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /src/Util.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include "Util.hh" 41 | #include "Global.hh" 42 | #include "Comm.hh" 43 | #include "SweepData.hh" 44 | #include "CommSides.hh" 45 | #include 46 | #include 47 | 48 | 49 | namespace Util 50 | { 51 | 52 | /* 53 | diffBetweenGroups 54 | */ 55 | double diffBetweenGroups(const PsiData &psi) 56 | { 57 | double maxDiff = 0.0; 58 | double maxEntry = 0.0; 59 | 60 | for(UINT cell = 0; cell < g_nCells; cell++) { 61 | for(UINT angle = 0; angle < g_nAngles; angle++) { 62 | for(UINT vrtx = 0; vrtx < g_nVrtxPerCell; vrtx++) { 63 | 64 | double psi0 = psi(0, vrtx, angle, cell); 65 | 66 | if(fabs(psi0) > maxEntry) 67 | maxEntry = fabs(psi0); 68 | 69 | for(UINT group = 1; group < g_nGroups; group++) { 70 | double psi1 = psi(group, vrtx, angle, cell); 71 | if (fabs(psi0 - psi1) > maxDiff) 72 | maxDiff = fabs(psi0 - psi1); 73 | } 74 | }}} 75 | 76 | maxDiff = maxDiff / maxEntry; 77 | Comm::gmax(maxDiff); 78 | return maxDiff; 79 | } 80 | 81 | 82 | /* 83 | psiToPhi 84 | */ 85 | void psiToPhi(PhiData &phi, const PsiData &psi) 86 | { 87 | phi.setToValue(0.0); 88 | 89 | #pragma omp parallel for 90 | for (UINT cell = 0; cell < g_nCells; ++cell) { 91 | for (UINT angle = 0; angle < g_nAngles; ++angle) { 92 | for (UINT vertex = 0; vertex < g_nVrtxPerCell; ++vertex) { 93 | for (UINT group = 0; group < g_nGroups; ++group) { 94 | phi(group, vertex, cell) += 95 | psi(group, vertex, angle, cell) * g_quadrature->getWt(angle); 96 | }}}} 97 | } 98 | 99 | 100 | /* 101 | phiToPsi 102 | */ 103 | void phiToPsi(const PhiData &phi, PsiData &psi) 104 | { 105 | #pragma omp parallel for 106 | for (UINT cell = 0; cell < g_nCells; ++cell) { 107 | for (UINT angle = 0; angle < g_nAngles; ++angle) { 108 | for (UINT vertex = 0; vertex < g_nVrtxPerCell; ++vertex) { 109 | for (UINT group = 0; group < g_nGroups; ++group) { 110 | psi(group, vertex, angle, cell) = phi(group, vertex, cell); 111 | }}}} 112 | } 113 | 114 | 115 | /* 116 | calcTotalSource 117 | */ 118 | void calcTotalSource(const PsiData &source, const PhiData &phi, 119 | PsiData &totalSource) 120 | { 121 | #pragma omp parallel for 122 | for (UINT cell = 0; cell < g_nCells; ++cell) { 123 | for (UINT angle = 0; angle < g_nAngles; ++angle) { 124 | for (UINT vertex = 0; vertex < g_nVrtxPerCell; ++vertex) { 125 | for (UINT group = 0; group < g_nGroups; ++group) { 126 | totalSource(group, vertex, angle, cell) = 127 | source(group, vertex, angle, cell) + 128 | g_sigmaS[cell] / (4.0 * M_PI) * phi(group, vertex, cell); 129 | }}}} 130 | } 131 | 132 | 133 | /* 134 | sweepLocal 135 | 136 | Solves L_I Psi = L_B Psi_B + Q 137 | */ 138 | void sweepLocal(PsiData &psi, const PsiData &source, PsiBoundData &psiBound) 139 | { 140 | Mat2 priorities(g_nCells, g_nAngles); 141 | const UINT maxComputePerStep = std::numeric_limits::max(); 142 | SweepData sweepData(psi, source, psiBound, priorities); 143 | 144 | g_graphTraverserForward->traverse(maxComputePerStep, sweepData); 145 | } 146 | 147 | 148 | /* 149 | operatorS 150 | */ 151 | void operatorS(const PhiData &phi1, PhiData &phi2) 152 | { 153 | for (UINT cell = 0; cell < g_nCells; ++cell) { 154 | for (UINT vertex = 0; vertex < g_nVrtxPerCell; ++vertex) { 155 | for (UINT group = 0; group < g_nGroups; ++group) { 156 | phi2(group,vertex,cell) = g_sigmaS[cell] / (4.0 * M_PI) * 157 | phi1(group,vertex,cell); 158 | }}} 159 | } 160 | 161 | 162 | } // End namespace Util 163 | -------------------------------------------------------------------------------- /src/Util.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #ifndef __UTIL_HH__ 41 | #define __UTIL_HH__ 42 | 43 | 44 | #include "PsiData.hh" 45 | 46 | namespace Util 47 | { 48 | 49 | double diffBetweenGroups(const PsiData &psi); 50 | void psiToPhi(PhiData &phi, const PsiData &psi); 51 | void phiToPsi(const PhiData &phi, PsiData &psi); 52 | void calcTotalSource(const PsiData &source, const PhiData &phi, 53 | PsiData &totalSource); 54 | void sweepLocal(PsiData &psi, const PsiData &source, PsiBoundData &psiBound); 55 | void operatorS(const PhiData &phi1, PhiData &phi2); 56 | 57 | } // End namespace 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /test/diff.py: -------------------------------------------------------------------------------- 1 | # Calculates the relative error between two .psi files 2 | 3 | import numpy 4 | import sys 5 | 6 | 7 | # Print usage info if not right number of args 8 | if len(sys.argv) < 3: 9 | print "Calculates the L1 and Linf relative error between two .psi files." 10 | print "Usage 1: python diff.py " 11 | print " Prints differences." 12 | print "Usage 2: python diff.py " 13 | print " Prints differences." 14 | print " Returns 1 to OS if errors not within tolerance." 15 | sys.exit(1) 16 | 17 | 18 | # Get the vectors from file 19 | v1 = numpy.fromfile(sys.argv[1]) 20 | v2 = numpy.fromfile(sys.argv[2]) 21 | 22 | 23 | # Get rid of header data 24 | v1 = v1[8:] 25 | v2 = v2[8:] 26 | 27 | 28 | # Check vector lengths 29 | if len(v1) != len(v2): 30 | print "Vector lengths not the same." 31 | sys.exit(1) 32 | 33 | 34 | # Get the tolerance 35 | tolerance = -1.0 36 | if len(sys.argv) == 4: 37 | tolerance = float(sys.argv[3]) 38 | 39 | 40 | # Find the errors 41 | v1 = v1 - v2 42 | errL1 = numpy.linalg.norm(v1, 1) / numpy.linalg.norm(v2, 1) 43 | errLinf = max(abs(v1)) / max(abs(v2)) 44 | 45 | 46 | # Print the errors if either: 47 | # tolerance not specified or errors don't meet tolerance 48 | print " L1 relative error:", "%.2e" % errL1 49 | print " Linf relative error:", "%.2e" % errLinf 50 | 51 | 52 | # Check tolerance 53 | if errL1 < tolerance and errLinf < tolerance and tolerance > 0.0: 54 | sys.exit(0) 55 | 56 | sys.exit(1) 57 | 58 | -------------------------------------------------------------------------------- /test/regression.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | 4 | tolerance = "1e-10" 5 | 6 | 7 | # Print what we're doing 8 | print " " 9 | print "--- Running Regression Tests ---" 10 | 11 | 12 | # Move necessary files to this folder 13 | subprocess.call(["cp", "../sweep.x", "./"]) 14 | subprocess.call(["cp", "../util/PartitionColumns.x", "./"]) 15 | subprocess.call(["cp", "../util/cube-208.smesh", "./"]) 16 | 17 | 18 | # Get all run*.sh files 19 | output = subprocess.check_output(["ls", "regression"]) 20 | output = output.split() 21 | output1 = [] 22 | for s in output: 23 | if s.endswith(".sh") > 0: 24 | output1.append(s) 25 | 26 | 27 | # Do regressions 28 | numFail = 0 29 | numPass = 0 30 | for s in output1: 31 | name = "regression/" + s 32 | name2 = s + ".regression.txt" 33 | 34 | print "Test", s 35 | subprocess.check_output(["sh", name, ">", name2]) 36 | status = subprocess.call(["python", "diff.py", "regression/gold.psi", "out.psi", tolerance]) 37 | if status == 0: 38 | print " Pass" 39 | print " " 40 | numPass = numPass + 1 41 | else: 42 | print " Fail" 43 | print " " 44 | numFail = numFail + 1 45 | 46 | subprocess.call(["rm", "out.psi"]) 47 | 48 | 49 | 50 | # Print overall stats 51 | print "Num Pass/Fail", numPass, numFail 52 | print " " 53 | 54 | 55 | # Remove un-necessary files 56 | subprocess.call(["rm", "sweep.x"]) 57 | subprocess.call(["rm", "PartitionColumns.x"]) 58 | subprocess.call(["rm", "cube-208.smesh"]) 59 | -------------------------------------------------------------------------------- /test/regression/gold.psi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/test/regression/gold.psi -------------------------------------------------------------------------------- /test/regression/input-gaussCramer1.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | DD_IterMax 100 21 | DD_ErrMax 1e-10 22 | 23 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 24 | SweepType TraverseGraph 25 | 26 | 27 | GaussElim CramerGlu 28 | -------------------------------------------------------------------------------- /test/regression/input-gaussCramer2.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim CramerIntel 29 | -------------------------------------------------------------------------------- /test/regression/input-gaussPivot.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim Original 29 | -------------------------------------------------------------------------------- /test/regression/input-gold-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-gold.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-inter0.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 0 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-inter1.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-inter2.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 2 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-intra0.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 0 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-intra1.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 1 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-intra2.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 2 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-intra3.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-intra4.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 4 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-maxcells20.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 20 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType TraverseGraph 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepOrig1-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType OriginalTycho1 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepOrig1.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType OriginalTycho1 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepOrig2-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType OriginalTycho2 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepOrig2.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType OriginalTycho2 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepPBJ-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType PBJ 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepPBJ.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType PBJ 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepPBJOuter-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType PBJOuter 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepPBJOuter.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType PBJOuter 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepPBJSI.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType PBJSI 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepSchur-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType Schur 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepSchur.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType Schur 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepSchurKrylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType SchurKrylov 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepSchurOuter-krylov.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration false 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType SchurOuter 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/input-sweepSchurOuter.deck: -------------------------------------------------------------------------------- 1 | # Sample input deck 2 | # Copy this to input.deck (or any other name you choose) 3 | 4 | snOrder 8 5 | iterMax 100 6 | errMax 1e-10 7 | maxCellsPerStep 100 8 | intraAngleP 3 9 | interAngleP 1 10 | nGroups 2 11 | sigmaT1 10 12 | sigmaS1 5 13 | sigmaT2 10 14 | sigmaS2 5 15 | OutputFile true 16 | OutputFilename out.psi 17 | SourceIteration true 18 | MPIType TychoTwoSided 19 | 20 | 21 | DD_IterMax 100 22 | DD_ErrMax 1e-10 23 | 24 | # Types: OriginalTycho1, OriginalTycho2, TraverseGraph 25 | SweepType SchurOuter 26 | 27 | 28 | GaussElim NoPivot 29 | -------------------------------------------------------------------------------- /test/regression/run-gaussCramer1-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gaussCramer1.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gaussCramer2-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gaussCramer2.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gaussPivot-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gaussPivot.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gold-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gold-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gold-mpi2.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=1 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gold.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gold-mpi3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=1 4 | NY=3 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gold.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gold-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gold.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gold-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gold.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-gold.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=1 4 | NY=1 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-gold.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-inter0-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-inter0.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-inter1-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-inter1.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-inter2-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-inter2.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-intra0-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-intra0.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-intra1-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-intra1.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-intra2-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-intra2.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-intra3-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-intra3.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-intra4-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-intra4.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-maxcells20-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-maxcells20.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepOrig1-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepOrig1-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepOrig1-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepOrig1.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepOrig1-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepOrig1.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepOrig2-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepOrig2-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepOrig2-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepOrig2.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepOrig2-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepOrig2.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJ-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJ-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJ-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJ.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJ-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJ.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJOuter-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJOuter-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJOuter-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJOuter.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJOuter-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJOuter.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepPBJSI-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepPBJSI.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchur-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchur-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchur-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchur.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchur-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchur.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchurKrylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchurKrylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchurOuter-krylov-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchurOuter-krylov.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchurOuter-mpi4-omp3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchurOuter.deck" 9 | export OMP_NUM_THREADS=3 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /test/regression/run-sweepSchurOuter-mpi4.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | NX=2 4 | NY=2 5 | NUM_PARTS=$((NX*NY)) 6 | IN_FILE="cube-208.smesh" 7 | OUT_FILE="temp.pmesh" 8 | INPUT_DECK="regression/input-sweepSchurOuter.deck" 9 | export OMP_NUM_THREADS=1 10 | 11 | ./PartitionColumns.x $NX $NY $IN_FILE $OUT_FILE 12 | mpirun -n $NUM_PARTS ./sweep.x $OUT_FILE $INPUT_DECK 13 | rm $OUT_FILE 14 | -------------------------------------------------------------------------------- /util/CreateGaussLegendre.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | MAX_DEGREE = 30 4 | file = open('GaussLegendre.dat', 'w') 5 | 6 | for deg in range(2,MAX_DEGREE+1,2): 7 | x, w = np.polynomial.legendre.leggauss(deg) 8 | 9 | # Write nodes 10 | file.write('static double s_n' + str(deg) + '[] = { ' + format(x[0], '.16f')) 11 | for k in range(1,deg): 12 | file.write(', ' + format(x[k], '.16f')) 13 | file.write(' };\n') 14 | 15 | # Write weights 16 | file.write('static double s_w' + str(deg) + '[] = { ' + format(w[0], '.16f')) 17 | for k in range(1,deg): 18 | file.write(', ' + format(w[k], '.16f')) 19 | file.write(' };\n') 20 | 21 | -------------------------------------------------------------------------------- /util/Makefile: -------------------------------------------------------------------------------- 1 | ##### Settings for local environment ##### 2 | include make.inc 3 | 4 | 5 | ##### Variables ##### 6 | CPP1 = $(CPP) -DPARALLEL_MESH_READ_SERIAL_ONLY 7 | 8 | SRC_MESH = ../src/SerialMesh.cc \ 9 | ../src/ParallelMesh.cc 10 | 11 | SRC_MESH2 = ../src/SerialMesh.cc \ 12 | ../src/ParallelMesh.cc \ 13 | ../src/Comm.cc \ 14 | ../src/Assert.cc 15 | 16 | INC = -I../src \ 17 | -I$(MOAB_DIR)/include \ 18 | -I$(METIS_DIR)/include 19 | 20 | LIB_MOAB = $(MOAB_DIR)/lib/libMOAB.a \ 21 | $(MOAB_DIR)/lib/libiMesh.a \ 22 | $(CGNS_DIR)/lib/libcgns.a \ 23 | $(HDF5_DIR)/lib/libhdf5.a \ 24 | -ldl -lz 25 | 26 | LIB_METIS = $(METIS_DIR)/lib/libmetis.a 27 | 28 | 29 | ##### Applications ##### 30 | APPS = PartitionMetis \ 31 | SerialMeshInfo \ 32 | ParallelMeshInfo \ 33 | PartitionColumns \ 34 | MoabToSerialMesh \ 35 | RefineSerialMesh \ 36 | SerialMeshToMoab \ 37 | ParallelMeshToMoab 38 | 39 | 40 | 41 | ##### Make Commands ##### 42 | # all 43 | .PHONY: all 44 | all: $(APPS) 45 | 46 | # clean 47 | .PHONY: clean 48 | clean: 49 | @echo Delete executables 50 | rm *.x 51 | @echo " " 52 | 53 | # PartitionMetis 54 | .PHONY: PartitionMetis 55 | PartitionMetis: 56 | @echo Making PartitionMetis 57 | $(CPP1) $(INC) $(SRC_MESH) PartitionMetis.cc -o PartitionMetis.x $(LIB_METIS) 58 | @echo " " 59 | 60 | # SerialMeshInfo 61 | .PHONY: SerialMeshInfo 62 | SerialMeshInfo: 63 | @echo Making SerialMeshInfo 64 | $(CPP1) $(INC) $(SRC_MESH) SerialMeshInfo.cc -o SerialMeshInfo.x 65 | @echo " " 66 | 67 | # ParallelMeshInfo 68 | .PHONY: ParallelMeshInfo 69 | ParallelMeshInfo: 70 | @echo Making ParallelMeshInfo 71 | $(CPP) $(INC) $(SRC_MESH2) ParallelMeshInfo.cc -o ParallelMeshInfo.x 72 | @echo " " 73 | 74 | # PartitionColumns 75 | .PHONY: PartitionColumns 76 | PartitionColumns: 77 | @echo Making PartitionColumns 78 | $(CPP1) $(INC) $(SRC_MESH) PartitionColumns.cc -o PartitionColumns.x 79 | @echo " " 80 | 81 | # MoabToSerialMesh 82 | .PHONY: MoabToSerialMesh 83 | MoabToSerialMesh: 84 | @echo Making MoabToSerialMesh 85 | $(CPP1) $(INC) $(SRC_MESH) MoabToSerialMesh.cc -o MoabToSerialMesh.x $(LIB_MOAB) 86 | @echo " " 87 | 88 | # RefineSerialMesh 89 | .PHONY: RefineSerialMesh 90 | RefineSerialMesh: 91 | @echo Making RefineSerialMesh 92 | $(CPP1) $(SRC_MESH) RefineSerialMesh.cc -o RefineSerialMesh.x 93 | @echo " " 94 | 95 | # SerialMeshToMoab 96 | .PHONY: SerialMeshToMoab 97 | SerialMeshToMoab: 98 | @echo Making SerialMeshToMoab 99 | $(CPP1) $(INC) $(SRC_MESH) SerialMeshToMoab.cc -o SerialMeshToMoab.x $(LIB_MOAB) 100 | @echo " " 101 | 102 | # ParallelMeshToMoab 103 | .PHONY: ParallelMeshToMoab 104 | ParallelMeshToMoab: 105 | @echo Making ParallelMeshToMoab 106 | $(CPP1) $(INC) $(SRC_MESH) ParallelMeshToMoab.cc -o ParallelMeshToMoab.x $(LIB_MOAB) 107 | @echo " " 108 | 109 | -------------------------------------------------------------------------------- /util/ParallelMeshInfo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "Comm.hh" 45 | #include "ParallelMesh.hh" 46 | 47 | using namespace std; 48 | 49 | 50 | /* 51 | main 52 | */ 53 | int main(int argc, char* argv[]) 54 | { 55 | ParallelMesh parallelMesh; 56 | ParallelMesh::PartitionData partData; 57 | string inputFile; 58 | bool verbose = false; 59 | 60 | 61 | // Start MPI 62 | MPI_Init(&argc, &argv); 63 | 64 | 65 | // Print utility name 66 | if (Comm::rank() == 0) { 67 | printf("--- ParallelMeshInfo Utility ---\n"); 68 | } 69 | 70 | 71 | // Get input file 72 | if (argc == 2) { 73 | verbose = false; 74 | } 75 | else if (argc == 3 && strcmp(argv[2], "verbose") == 0) { 76 | verbose = true; 77 | } 78 | else { 79 | if (Comm::rank() == 0) { 80 | printf("Incorrect number of arguments\n"); 81 | printf("Usage: ./ParallelMeshInfo.x (verbose)\n"); 82 | printf("\n\n\n"); 83 | } 84 | return 0; 85 | } 86 | inputFile = argv[1]; 87 | 88 | 89 | // Read in parallel mesh serially and print info 90 | if (Comm::rank() == 0) { 91 | printf("Parallel mesh data read serially.\n"); 92 | parallelMesh.read(inputFile); 93 | parallelMesh.print(verbose); 94 | } 95 | Comm::barrier(); 96 | 97 | 98 | // Read parallel mesh in parallel and print info 99 | if (Comm::rank() == 0) { 100 | printf("\n\n\nParallel mesh data read in parallel.\n"); 101 | } 102 | ParallelMesh::readInParallel(inputFile, partData); 103 | for (int part = 0; part < Comm::numRanks(); part++) { 104 | if (Comm::rank() == part) { 105 | printf("Partition %d\n", Comm::rank()); 106 | ParallelMesh::printPartitionData(partData, verbose); 107 | } 108 | Comm::barrier(); 109 | } 110 | 111 | 112 | // Cleanup 113 | Comm::barrier(); 114 | if (Comm::rank() == 0) { 115 | printf("\n\n\n"); 116 | } 117 | MPI_Finalize(); 118 | return 0; 119 | } 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /util/ParallelMeshToMoab.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "ParallelMesh.hh" 45 | #include 46 | #include 47 | 48 | using namespace moab; 49 | using namespace std; 50 | 51 | 52 | /* 53 | moabCreateAllFaces 54 | */ 55 | static 56 | void createMoabMesh(Core &moab, const EntityHandle &meshSet, 57 | const ParallelMesh &mesh, const uint64_t part) 58 | { 59 | vector cellHandles; 60 | ErrorCode moabStatus; 61 | const ParallelMesh::PartitionData &partData = mesh.c_partitionData[part]; 62 | 63 | 64 | // Go through cells in mesh and create tets for Moab 65 | for (uint64_t cell = 0; cell < partData.numCells; cell++) { 66 | EntityHandle vrtxHandles[4]; 67 | for (int vrtx = 0; vrtx < 4; vrtx++) { 68 | uint64_t node = partData.cellData[cell].boundingNodes[vrtx]; 69 | moabStatus = moab.create_vertex(partData.nodeData[node].coords, 70 | vrtxHandles[vrtx]); 71 | assert(moabStatus == MB_SUCCESS); 72 | } 73 | 74 | EntityHandle cellHandle; 75 | moabStatus = moab.create_element(MBTET, vrtxHandles, 4, cellHandle); 76 | assert(moabStatus == MB_SUCCESS); 77 | cellHandles.push_back(cellHandle); 78 | } 79 | 80 | 81 | // Add all the tets to Moab mesh 82 | moabStatus = moab.add_entities(meshSet, cellHandles.data(), cellHandles.size()); 83 | assert(moabStatus == MB_SUCCESS); 84 | } 85 | 86 | 87 | /* 88 | getFilePrefix 89 | */ 90 | string getFilePrefix(const string &inputFile) 91 | { 92 | int length = inputFile.length(); 93 | assert(inputFile.substr(length - 6) == ".pmesh"); 94 | return inputFile.substr(0, length - 6); 95 | } 96 | 97 | 98 | /* 99 | writeVisitFile 100 | */ 101 | void writeVisitFile(const string &prefix, const vector &filenames) 102 | { 103 | ofstream file; 104 | file.open(prefix + ".visit"); 105 | file << "!NBLOCKS " << filenames.size() << endl; 106 | 107 | for (size_t i = 0; i < filenames.size(); i++) { 108 | file << filenames[i] << endl; 109 | } 110 | 111 | file.close(); 112 | } 113 | 114 | 115 | /* 116 | main 117 | */ 118 | int main(int argc, char* argv[]) 119 | { 120 | Core moab; 121 | string inputFile; 122 | string outputFilePrefix; 123 | ParallelMesh mesh; 124 | ErrorCode moabStatus; 125 | vector filenames; 126 | 127 | 128 | // Print utility name 129 | printf("--- ParallelMeshToMoab Utility ---\n"); 130 | 131 | 132 | // Get input/output files 133 | if (argc != 2) { 134 | printf("Incorrect number of arguments\n"); 135 | printf("Usage: ./ParallelMeshToMoab.x \n"); 136 | printf("\n\n\n"); 137 | return 0; 138 | } 139 | inputFile = argv[1]; 140 | outputFilePrefix = getFilePrefix(inputFile); 141 | 142 | 143 | // Convert mesh to moab 144 | printf("Reading parallel mesh from file\n"); 145 | mesh.read(inputFile); 146 | 147 | for (uint64_t part = 0; part < mesh.c_numPartitions; part++) { 148 | EntityHandle meshSet; 149 | 150 | moabStatus = moab.create_meshset(MESHSET_SET, meshSet); 151 | assert(moabStatus == MB_SUCCESS); 152 | 153 | printf("Creating Moab mesh for partition %" PRIu64 "\n", part); 154 | createMoabMesh(moab, meshSet, mesh, part); 155 | 156 | printf(" Writing Moab mesh to file\n"); 157 | string outputFile = outputFilePrefix; 158 | outputFile += "-"; 159 | outputFile += to_string(part); 160 | outputFile += "p.vtk"; 161 | moabStatus = moab.write_mesh(outputFile.c_str(), &meshSet, 1); 162 | assert(moabStatus == MB_SUCCESS); 163 | 164 | filenames.push_back(outputFile); 165 | } 166 | 167 | 168 | // Write main file 169 | printf("Writing .visit file\n"); 170 | writeVisitFile(outputFilePrefix, filenames); 171 | 172 | 173 | // Cleanup 174 | printf("\n\n\n"); 175 | return 0; 176 | } 177 | -------------------------------------------------------------------------------- /util/PartitionMetis.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "SerialMesh.hh" 45 | #include "ParallelMesh.hh" 46 | 47 | using namespace std; 48 | 49 | 50 | /* 51 | partitionMesh 52 | */ 53 | static 54 | void partitionMesh(const int numPartitions, const SerialMesh &serialMesh, 55 | vector &partitionVector) 56 | { 57 | assert(partitionVector.size() == serialMesh.c_numCells); 58 | 59 | 60 | // Check for only 1 partition 61 | if (numPartitions == 1) { 62 | for (uint64_t cell = 0; cell < partitionVector.size(); cell++) { 63 | partitionVector[cell] = 0; 64 | } 65 | return; 66 | } 67 | 68 | 69 | // Parameters for metis 70 | idx_t nvtxs = serialMesh.c_numCells; 71 | idx_t ncon = 1; 72 | vector xadj(nvtxs+1); 73 | vector adjncy(2 * serialMesh.c_numFaces); // Allocating more than needed. 74 | idx_t *vwgt = NULL; 75 | idx_t *vsize = NULL; 76 | idx_t *adjwgt = NULL; 77 | idx_t nparts = numPartitions; 78 | real_t *tpwgts = NULL; 79 | real_t *ubvec = NULL; 80 | idx_t *options = NULL; 81 | idx_t objval; 82 | vector part(nvtxs); 83 | 84 | 85 | // Setup adjacency graph 86 | xadj[0] = 0; 87 | for (uint64_t cell = 0; cell < serialMesh.c_numCells; cell++) { 88 | uint64_t numConnections = 0; 89 | for (uint64_t lface = 0; lface < 4; lface++) { 90 | uint64_t face = serialMesh.c_cellData[cell].boundingFaces[lface]; 91 | uint64_t cell1 = serialMesh.c_faceData[face].boundingCells[0]; 92 | uint64_t cell2 = serialMesh.c_faceData[face].boundingCells[1]; 93 | uint64_t adjCell = (cell1 == cell) ? cell2 : cell1; 94 | if (adjCell != numeric_limits::max()) { 95 | uint64_t index = xadj[cell] + numConnections; 96 | adjncy[index] = adjCell; 97 | numConnections++; 98 | } 99 | } 100 | xadj[cell+1] = xadj[cell] + numConnections; 101 | } 102 | 103 | 104 | // Partition graph 105 | int retValue = METIS_PartGraphKway( 106 | &nvtxs, &ncon, xadj.data(), adjncy.data(), vwgt, 107 | vsize, adjwgt, &nparts, tpwgts, ubvec, options, 108 | &objval, part.data()); 109 | 110 | assert(retValue == METIS_OK); 111 | 112 | 113 | // Put partition data in my format 114 | for (uint64_t cell = 0; cell < partitionVector.size(); cell++) { 115 | partitionVector[cell] = part[cell]; 116 | } 117 | } 118 | 119 | 120 | /* 121 | main 122 | */ 123 | int main(int argc, char* argv[]) 124 | { 125 | SerialMesh serialMesh; 126 | ParallelMesh parallelMesh; 127 | string inputFile; 128 | string outputFile; 129 | vector partitionVector; 130 | int numPartitions = 0; 131 | 132 | 133 | // Print utility name 134 | printf("--- PartitionMetis Utility ---\n"); 135 | 136 | 137 | // Get input/output files 138 | if (argc != 4) { 139 | printf("Incorrect number of arguments\n"); 140 | printf("Usage: ./PartitionMetis.x <# partitions> \n"); 141 | printf("\n\n\n"); 142 | return 0; 143 | } 144 | numPartitions = atoi(argv[1]); 145 | inputFile = argv[2]; 146 | outputFile = argv[3]; 147 | assert(numPartitions > 0); 148 | printf("Partition %s into %d partitions.\n", inputFile.c_str(), numPartitions); 149 | printf("Write to %s\n", outputFile.c_str()); 150 | 151 | 152 | // Read in serial mesh and convert to parallel mesh 153 | serialMesh.read(inputFile); 154 | partitionVector.resize(serialMesh.c_numCells); 155 | partitionMesh(numPartitions, serialMesh, partitionVector); 156 | parallelMesh.createFromSerialMesh(serialMesh, partitionVector, numPartitions); 157 | parallelMesh.write(outputFile); 158 | 159 | 160 | // Cleanup 161 | printf("\n\n\n"); 162 | return 0; 163 | } 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /util/SerialMeshInfo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "SerialMesh.hh" 45 | 46 | using namespace std; 47 | 48 | 49 | /* 50 | main 51 | */ 52 | int main(int argc, char* argv[]) 53 | { 54 | SerialMesh serialMesh; 55 | string inputFile; 56 | bool verbose = false; 57 | 58 | 59 | // Print utility name 60 | printf("--- SerialMeshInfo Utility ---\n"); 61 | 62 | 63 | // Get input file 64 | if (argc == 2) { 65 | verbose = false; 66 | } 67 | else if (argc == 3 && strcmp(argv[2], "verbose") == 0) { 68 | verbose = true; 69 | } 70 | else { 71 | printf("Incorrect number of arguments\n"); 72 | printf("Usage: ./SerialMeshInfo.x (verbose)\n"); 73 | printf("\n\n\n"); 74 | return 0; 75 | } 76 | inputFile = argv[1]; 77 | 78 | 79 | // Read in serial mesh and convert to parallel mesh 80 | serialMesh.read(inputFile); 81 | serialMesh.print(verbose); 82 | 83 | 84 | // Cleanup 85 | printf("\n\n\n"); 86 | return 0; 87 | } 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /util/SerialMeshToMoab.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Los Alamos National Security, LLC 3 | All rights reserved. 4 | 5 | Copyright 2016. Los Alamos National Security, LLC. This software was produced 6 | under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National 7 | Laboratory (LANL), which is operated by Los Alamos National Security, LLC for 8 | the U.S. Department of Energy. The U.S. Government has rights to use, 9 | reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS 10 | ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 11 | ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified 12 | to produce derivative works, such modified software should be clearly marked, 13 | so as not to confuse it with the version available from LANL. 14 | 15 | Additionally, redistribution and use in source and binary forms, with or 16 | without modification, are permitted provided that the following conditions 17 | are met: 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 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | 3. Neither the name of Los Alamos National Security, LLC, Los Alamos 24 | National Laboratory, LANL, the U.S. Government, nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND 28 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 29 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL 31 | SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "SerialMesh.hh" 45 | 46 | using namespace moab; 47 | using namespace std; 48 | 49 | 50 | /* 51 | moabCreateAllFaces 52 | */ 53 | static 54 | void createMoabMesh(Core &moab, const EntityHandle &meshSet, const SerialMesh &mesh) 55 | { 56 | vector cellHandles; 57 | ErrorCode moabStatus; 58 | 59 | 60 | // Go through cells in serial mesh and create tets for Moab 61 | for (uint64_t cell = 0; cell < mesh.c_numCells; cell++) { 62 | EntityHandle vrtxHandles[4]; 63 | for (int vrtx = 0; vrtx < 4; vrtx++) { 64 | uint64_t node = mesh.c_cellData[cell].boundingNodes[vrtx]; 65 | moabStatus = moab.create_vertex(mesh.c_nodeData[node].coords, vrtxHandles[vrtx]); 66 | assert(moabStatus == MB_SUCCESS); 67 | } 68 | 69 | EntityHandle cellHandle; 70 | moabStatus = moab.create_element(MBTET, vrtxHandles, 4, cellHandle); 71 | assert(moabStatus == MB_SUCCESS); 72 | cellHandles.push_back(cellHandle); 73 | } 74 | 75 | 76 | // Add all the tets to Moab mesh 77 | moabStatus = moab.add_entities(meshSet, cellHandles.data(), cellHandles.size()); 78 | assert(moabStatus == MB_SUCCESS); 79 | } 80 | 81 | 82 | /* 83 | getOutputFile 84 | */ 85 | string getOutputFile(const string &inputFile) 86 | { 87 | int length = inputFile.length(); 88 | assert(inputFile.substr(length - 6) == ".smesh"); 89 | return inputFile.substr(0, length - 6) + ".vtk"; 90 | } 91 | 92 | 93 | /* 94 | main 95 | */ 96 | int main(int argc, char* argv[]) 97 | { 98 | Core moab; 99 | string inputFile; 100 | string outputFile; 101 | SerialMesh mesh; 102 | ErrorCode moabStatus; 103 | EntityHandle meshSet; 104 | 105 | 106 | // Print utility name 107 | printf("--- SerialMeshToMoab Utility ---\n"); 108 | 109 | 110 | // Get input/output files 111 | if (argc != 2) { 112 | printf("Incorrect number of arguments\n"); 113 | printf("Usage: ./SerialMeshToMoab.x \n"); 114 | printf("\n\n\n"); 115 | return 0; 116 | } 117 | inputFile = argv[1]; 118 | outputFile = getOutputFile(inputFile); 119 | 120 | 121 | // Convert mesh to moab 122 | moabStatus = moab.create_meshset(MESHSET_SET, meshSet); 123 | assert(moabStatus == MB_SUCCESS); 124 | 125 | printf("Reading serial mesh from file\n"); 126 | mesh.read(inputFile); 127 | 128 | printf("Creating Moab mesh\n"); 129 | createMoabMesh(moab, meshSet, mesh); 130 | 131 | printf("Writing Moab mesh to file\n"); 132 | moabStatus = moab.write_mesh(outputFile.c_str(), &meshSet, 1); 133 | assert(moabStatus == MB_SUCCESS); 134 | 135 | 136 | // Cleanup 137 | printf("\n\n\n"); 138 | return 0; 139 | } 140 | -------------------------------------------------------------------------------- /util/cube-10717.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-10717.cgns -------------------------------------------------------------------------------- /util/cube-10717.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-10717.smesh -------------------------------------------------------------------------------- /util/cube-12.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-12.cgns -------------------------------------------------------------------------------- /util/cube-12.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-12.smesh -------------------------------------------------------------------------------- /util/cube-1374.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-1374.cgns -------------------------------------------------------------------------------- /util/cube-1374.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-1374.smesh -------------------------------------------------------------------------------- /util/cube-208.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-208.cgns -------------------------------------------------------------------------------- /util/cube-208.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-208.smesh -------------------------------------------------------------------------------- /util/cube-4128.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-4128.cgns -------------------------------------------------------------------------------- /util/cube-4128.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-4128.smesh -------------------------------------------------------------------------------- /util/cube-571760.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-571760.cgns -------------------------------------------------------------------------------- /util/cube-571760.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-571760.smesh -------------------------------------------------------------------------------- /util/cube-67249.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-67249.cgns -------------------------------------------------------------------------------- /util/cube-67249.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube-67249.smesh -------------------------------------------------------------------------------- /util/cube_no_mesh.hdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/cube_no_mesh.hdf -------------------------------------------------------------------------------- /util/make.inc.example: -------------------------------------------------------------------------------- 1 | # Settings to change for local environment 2 | # Copy this file to make.inc and fill in your local environment settings 3 | 4 | 5 | # Compile command 6 | # Note: the c++11 standard is required so this must be in the compile 7 | # command for some compilers. 8 | 9 | ### Cray compiler 10 | CPP = CC -Wall -std=c++11 11 | 12 | 13 | # Library directories 14 | MOAB_DIR = 15 | CGNS_DIR = 16 | HDF5_DIR = 17 | 18 | ### Trinitite 19 | METIS_DIR = /users/ckgarrett/tt-fey/lib/metis-5.1.0 20 | -------------------------------------------------------------------------------- /util/notes.txt: -------------------------------------------------------------------------------- 1 | Made PartitionedMesh.hdf and PartitionedMesh.cgns with Salome. 2 | The mesh is made up of two cubes both centered at (50,50) with sizes 3 | 100x100x100 and 50x50x50. 4 | The mesh hint for the tet generator was length=20. 5 | -------------------------------------------------------------------------------- /util/pcube-1649.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-1649.cgns -------------------------------------------------------------------------------- /util/pcube-1649.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-1649.smesh -------------------------------------------------------------------------------- /util/pcube-17700.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-17700.cgns -------------------------------------------------------------------------------- /util/pcube-17700.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-17700.smesh -------------------------------------------------------------------------------- /util/pcube-4684.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-4684.cgns -------------------------------------------------------------------------------- /util/pcube-4684.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-4684.smesh -------------------------------------------------------------------------------- /util/pcube-9482.cgns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-9482.cgns -------------------------------------------------------------------------------- /util/pcube-9482.smesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube-9482.smesh -------------------------------------------------------------------------------- /util/pcube.hdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/tycho2/4564c1fe9c0ef9eafd656854a81e4b4010b5a429/util/pcube.hdf --------------------------------------------------------------------------------