Skip to content

Commit

Permalink
Add codespell (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Oct 2, 2023
1 parent 4ce3f1c commit 32ae14e
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .codespell-ignore-words
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dum
pres
blocs
renewl
frop
fpr
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = .git,*.ipynb,*.bib,*.ps,*.patch,*~,CHANGES,*/Submodules,*/Build,*/build,*/tmp_build_dir,plt*,chk*,__pycache__,.ccls,.ccls-cache,tran.dat,GNUmakefile,*.pdf,Testing,sphinx_doc,*/html,*.cti
ignore-words = .codespell-ignore-words
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,25 @@ jobs:
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif-results/cpp.sarif
Lint-codespell:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: false
- name: Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Dependencies
run: |
# Install Python packages
python -m pip install --upgrade pip
pip install codespell
- name: Run codespell
run: codespell
Save-PR-Number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx/Algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ chosen through the ``ppm_type`` flag:
* ``ppm_type = 0`` uses a piecewise linear interpolation to reconstruct values at face.
* ``ppm_type = 1`` is the original PPM method presented in Colella and Woodward [JCP 1984].
* ``ppm_type = 2`` is the "extrema preserving" variant of the PPM method.
* ``ppm_type = 3`` is a new hybrid PPM/WENO method developped by Motheau and Wakefield [CAMCOS 2020], that replace the interpolation and slope limiting procedures by a WENO reconstruction.
* ``ppm_type = 3`` is a new hybrid PPM/WENO method developed by Motheau and Wakefield [CAMCOS 2020], that replace the interpolation and slope limiting procedures by a WENO reconstruction.

In the remainder of this section, the extrema preserving PPM method, i.e ``ppm_type = 2``, is presented. Note that the implementation
in PeleC is a recollection of different extension of the PPM method published in Miller and Colella [JCP 2002] and Colella and Sekora [JCP 2008].
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx/BoundaryConditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ More complex boundary conditions require user input that is prescribed explicitl
.. note::
To ensure conservation, when Godunov schemes are used the order of accuracy is reduced at boundaries specified using ``bcnormal``; PLM is used and the predictor step is omitted when computing fluxes through these boundaries. This does not affect any other boundary types or simulations using MOL.

Special care should be taken when prescribing subsonic ``Inflow`` or an ``Outflow`` boundary conditions. It might be tempting to directly impose target values in the boundary filler function (for ``Inflow``), or to perform a simple extrapolation (for ``Outflow``). However, this approach would fail to correctly respect the flow of information along solution characteristics - the system would be ill-posed and would lead to unphysical behavior. In particular, at a subsonic inflow boundary, at a subsonic inlet there is one outgoing characteristic, so one flow variable must be specified using information from inside the domain. Similarly, there is one incoming characteristic at outflow boundaries. The NSCBC method, described below, is the preffered method to account for this, but has not been ported to the all C++ version of PeleC. In the meantime, the recommended strategy for subsonic inflow and outflow boundaries for confined geometries such as nozzles and combustors is as follows:
Special care should be taken when prescribing subsonic ``Inflow`` or an ``Outflow`` boundary conditions. It might be tempting to directly impose target values in the boundary filler function (for ``Inflow``), or to perform a simple extrapolation (for ``Outflow``). However, this approach would fail to correctly respect the flow of information along solution characteristics - the system would be ill-posed and would lead to unphysical behavior. In particular, at a subsonic inflow boundary, at a subsonic inlet there is one outgoing characteristic, so one flow variable must be specified using information from inside the domain. Similarly, there is one incoming characteristic at outflow boundaries. The NSCBC method, described below, is the preferred method to account for this, but has not been ported to the all C++ version of PeleC. In the meantime, the recommended strategy for subsonic inflow and outflow boundaries for confined geometries such as nozzles and combustors is as follows:

* Subsonic Inflows: Specify the desired temperature, velocity, and composition (if relevant) in the ghost cells. Take the pressure from the domain interior. Based on these values, compute the density, internal energy, and total energy for the ghost cells.

Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx/InputFiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ fine-covered regions are masked. The following provide examples for each diagnos
pelec.xnormP.center = 0.5 # Coordinate in the normal direction
pelec.xnormP.int = 5 # Frequency (as step #) for performing the diagnostic
pelec.xnormP.interpolation = Linear # [OPT, DEF=Linear] Interpolation type : Linear or Quadratic
pelec.xnormP.field_names = x_velocity magvort density # List of variables outputed to the 2D pltfile
pelec.xnormP.field_names = x_velocity magvort density # List of variables outputted to the 2D pltfile

pelec.condT.type = DiagConditional # Diagnostic type
pelec.condT.file = condTest # Output file prefix
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx/Testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Testing and Verification
------------------------

Testing and verfication of PeleC can be performed using CTest, which is included in the CMake build system. If one builds PeleC with CMake, the testing suite, and the verification suite, can be enabled during the CMake configure step. A nightly test is reflected on the dashboard `here <https://my.cdash.org/index.php?project=PeleC>`_ .
Testing and verification of PeleC can be performed using CTest, which is included in the CMake build system. If one builds PeleC with CMake, the testing suite, and the verification suite, can be enabled during the CMake configure step. A nightly test is reflected on the dashboard `here <https://my.cdash.org/index.php?project=PeleC>`_ .

An example ``cmake`` configure command performed in the ``Build`` directory in PeleC is shown below with options relevant to the testing suite:

Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx/ebverification/ConvergingNozzle/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ allows the exterior pressure to be specified. This outlet specification comes fr
This figure shows the minimum and maximum pressures in the domain as a function of time for each boundary
condition specification. The first two approaches, which ignore the transfer of information through
characteristics, result in unphysical behavior. In the first, the pressure ratio across the nozzle is incorrect.
In the second, the pressure ratio is correct once the sytem reaches a steady state, but no boundary condition
In the second, the pressure ratio is correct once the system reaches a steady state, but no boundary condition
fixes the pressure, so the magnitude of inlet and outlet pressure evolve to undesired values. The third set of
boundary conditions leads to the desired behavior, with the outlet pressure fixed at the specified value and
the inlet pressure having the appropriate relationship given the inlet Mach number and area ratio across the
Expand Down
5 changes: 2 additions & 3 deletions Docs/sphinx/geometry/EB.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ Redistribution
--------------
.. _Redist:

A straightforward implemention of the finite-volume advance of intensive conserved fields is numerically unstable (this is the well-known "small cell issue") due to presence of
the fluid cell volume in the denominator of the conservative divergence (:math:`(DC)_l`):
A straightforward implementation of the finite-volume advance of intensive conserved fields is numerically unstable (this is the well-known "small cell issue") due to presence of the fluid cell volume in the denominator of the conservative divergence (:math:`(DC)_l`):

.. math::
(DC)_l = \frac{1}{V_l} \sum_{k_l} \left( F_k \cdot n_k A_k \right),
Expand Down Expand Up @@ -143,7 +142,7 @@ Several structures exist to store geometry dependent information. These are popu
| FaceSten |:math:`3^2` matrix of weights to apply face-based stencil |
+----------------+--------------------------------------------------------------------------------------+

An array of structures is created on level creation by copying data from the AMReX dense datastrcutures on a per-FAB basis as indicated in Figure :ref:`eb_structs` .
An array of structures is created on level creation by copying data from the AMReX dense datastructures on a per-FAB basis as indicated in Figure :ref:`eb_structs` .


.. _eb_structs:
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB-C10/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def parse_ic(fname):
"""
Parse the file written by PeleC to understand the initial condition
Returns a dictionary for easy acces
Returns a dictionary for easy access
"""

# Read into dataframe
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB-C4-5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Identical problem setup can be used to validate thermal diffusion and
viscous diffusion (impulsively started plate). Boundary conditions would
be more of an issue for the viscous diffusion problem.

Due to bounary effects, only validate profiles in the normal direction
Due to boundary effects, only validate profiles in the normal direction
near the center of the planar surface where boundary effect will be smallest
for either case.

Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB-C9/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def parse_ic(fname):
"""
Parse the file written by PeleC to understand the initial condition
Returns a dictionary for easy acces
Returns a dictionary for easy access
"""

# Read into dataframe
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB-ConvergingNozzle/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def AofX(X, inletdiam, outletdiam, nozzlestart, nozzleend):
return np.pi * (diam / 2) ** 2


# Nominal Conditons
# Nominal Conditions
M = 0.22
indiam = 10.0
outdiam = 10.0 / np.sqrt(2.0)
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/TGReact/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def parse_ic(fname):
"""
Parse the file written by PeleC to understand the initial condition
Returns a dictionary for easy acces
Returns a dictionary for easy access
"""

# Read into dataframe
Expand Down
2 changes: 1 addition & 1 deletion Exec/UnitTests/AmrexTestEnv.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace pelec_tests {

/** Global setup/teardown test enviroment configuration for PeleC unit tests
/** Global setup/teardown test environment configuration for PeleC unit tests
*
* This class is registered with GoogleTest infrastructure to perform global
* setup/teardown tasks. The base implementation calls the amrex::Initialize
Expand Down
2 changes: 1 addition & 1 deletion Source/Diffterm.H
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ pc_set_wall_temperature(
const amrex::Array4<amrex::Real>& Twall)
{
/*
if desired: compute x,y,z and make wall temp an arbitray function of space
if desired: compute x,y,z and make wall temp an arbitrary function of space
const amrex::Real* prob_lo = geom.ProbLo();
const amrex::Real* dx = geom.CellSize();
Expand Down
4 changes: 2 additions & 2 deletions Source/Diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PeleC::getMOLSrcTerm(
5. Compute divergence of face-centered fluxes with hybrid divergence
operator, include wall fluxes for diffusion and hydro,
6. Perform weigthed redistribution at the EB
6. Perform weighted redistribution at the EB
Extra notes:
Expand Down Expand Up @@ -142,7 +142,7 @@ PeleC::getMOLSrcTerm(
bcMask[dir].setVal(0);
}
// Becase bcMask is read in the Riemann solver in any case,
// Because bcMask is read in the Riemann solver in any case,
// here we put physbc values in the appropriate faces for the
non-nscbc case set_bc_mask(lo, hi, domain_lo, domain_hi,
AMREX_D_DECL(AMREX_TO_FORTRAN(bcMask[0]),
Expand Down
2 changes: 1 addition & 1 deletion Source/Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ ExtrudedTriangles::build(
amrex::Vector<amrex::Array<amrex::Real, AMREX_SPACEDIM>> alltri(
npts_in_tri * max_tri);

// initalize all triangles with some dummy values
// initialize all triangles with some dummy values
// that fall outside of the domain
const amrex::Real* problo;
const amrex::Real* probhi;
Expand Down
2 changes: 1 addition & 1 deletion Source/Hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ PeleC::construct_hydro_source(
bcMask[dir].setVal(0);
}
// Becase bcMask is read in the Riemann solver in any case,
// Because bcMask is read in the Riemann solver in any case,
// here we put physbc values in the appropriate faces for the
non-nscbc case set_bc_mask(lo, hi, domain_lo, domain_hi,
AMREX_D_DECL(AMREX_TO_FORTRAN(bcMask[0]),
Expand Down
2 changes: 1 addition & 1 deletion Source/IndexDefines.H
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#define NGDNV 6

#if AMREX_SPACEDIM == 1
// hopefully we wont do EB in 1D
// hopefully we won't do EB in 1D
#define NLSPTS 1
#define NEL_TRIMAT 1

Expand Down
2 changes: 1 addition & 1 deletion Source/InitEB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ PeleC::extend_signed_distance(
});
amrex::Gpu::synchronize();

// Iteratively compute the distance function in boxes, propagating accross
// Iteratively compute the distance function in boxes, propagating across
// boxes using ghost cells If needed, increase the number of loop to extend
// the reach of the distance function
const int nMaxLoop = 4;
Expand Down
2 changes: 1 addition & 1 deletion Source/PPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ trace_ppm(
// The choice of reference state is designed to minimize the
// effects of the characteristic projection. We subtract the I's
// off of the reference state, project the quantity such that it is
// in terms of the characteristic varaibles, and then add all the
// in terms of the characteristic variables, and then add all the
// jumps that are moving toward the interface to the reference
// state to get the full state on that interface.

Expand Down
2 changes: 1 addition & 1 deletion Source/React.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ PeleC::react_state(
}
} else {
// in MOL update all non-reacting sources
// are passed into auxillary sources
// are passed into auxiliary sources
non_react_src = aux_src;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/SumIQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ PeleC::monitor_extrema()
minima[ii], pc_lev.minDerive(extrema_vars[ii], time, local_flag));
}

// Handle species seperately
// Handle species separately
auto mf = pc_lev.derive("massfrac", time, 0);
BL_ASSERT(!(mf == nullptr));
amrex::MultiFab sumY(pc_lev.grids, pc_lev.dmap, 1, 0);
Expand Down
2 changes: 1 addition & 1 deletion Source/Utilities.H
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ pc_ctoprim(
q(i, j, k, QPRES) = p;
q(i, j, k, QGAME) = p / (e * rho) + 1.0;

// Auxilary Fab
// Auxiliary Fab
qa(i, j, k, QDPDR) = dpdr_e;
qa(i, j, k, QDPDE) = dpde;
qa(i, j, k, QGAMC) = gam1;
Expand Down

0 comments on commit 32ae14e

Please sign in to comment.