Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for installing the squadgen conda package #8

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 172 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
\file README.md
```
\file README.md
\author Paul Ullrich
\version May 8, 2024
```

Copyright 2024 Paul Ullrich

Expand All @@ -10,149 +12,220 @@ source code and its documentation under the terms of the GNU General
Public License. This software is provided "as is" without express
or implied warranty.

Spherical Quadrilateral Mesh Generator (SQuadGen)
=================================================
# Spherical Quadrilateral Mesh Generator (SQuadGen)

REQUIRED EXTERNAL LIBRARIES
libpng
libnetcdf
## REQUIRED EXTERNAL LIBRARIES

BUILDING
Modify src/Makefile to specify NetCDF paths
make all
libnetcdf

SYNOPSIS
## BUILDING

Modify `src/Makefile` to specify NetCDF paths

```sh
make all
```

## INSTALLING FROM CONDA PACKAGE

An alternative to building SQuadGen from source is to install a pre-built Linux
verison from a conda package.

If you don't already have a conda base environment set up, you can install
[miniforge3](https://github.com/conda-forge/miniforge?tab=readme-ov-file#miniforge3).

To add SQuadGen to an existing conda environment, activate the environment and
run:
```sh
conda install squadgen
```

To create a new conda environment with SQuadGen in it (and any other packages
you like, run:
```sh
conda create -n <env_name> squadgen <package> <package>
```
Then, activate the environment with:
```sh
conda activate <env_name>
```
The `SQuadGen` executable will be in your path.

## SYNOPSIS
```sh
./SQuadGen <Parameter List>
```

## PARAMETERS

PARAMETERS
```
--grid_type <string> ["CS"] (Options: CS | ICO | OCT1 | OCT2)
--refine_type <string> ["LOWCONN"] (Options: LOWCONN | CUBIT | LOWCONNOLD)
--refine_level <integer> [2]
--resolution <integer> [10]
--refine_file <string> [""]
--refine_rect <string> [""]
--output <string> [""]
--loadcsrefinementmap <bool> [false]
--refine_level <integer> [2]
--resolution <integer> [10]
--refine_file <string> [""]
--refine_rect <string> [""]
--output <string> [""]
--loadcsrefinementmap <bool> [false]
--smooth_type <string> ["NONE"] (Options: NONE | SPRING | PRESSURE)
--smooth_dist <integer> [1] (Smooth distance, -1 = smooth entire mesh)
--smooth_iter <integer> [10]
--lon_base <double> [-180.000000]
--lat_base <double> [0.000000]
--x_rotate <double> [0.000000]
--y_rotate <double> [0.000000]
--lon_ref <double> [0.000000]
--lat_ref <double> [0.000000]
--orient_ref <double> [0.000000]
--tessellate <integer> [0]
--subcellres <integer> [0]
--invert <bool> [false]
--block_refine <bool> [false]


DESCRIPTION
SQuadGen is a mesh generation utility that uses a cubed-sphere base mesh to
--smooth_iter <integer> [10]
--lon_base <double> [-180.000000]
--lat_base <double> [0.000000]
--x_rotate <double> [0.000000]
--y_rotate <double> [0.000000]
--lon_ref <double> [0.000000]
--lat_ref <double> [0.000000]
--orient_ref <double> [0.000000]
--tessellate <integer> [0]
--subcellres <integer> [0]
--invert <bool> [false]
--block_refine <bool> [false]
```

## DESCRIPTION

`SQuadGen` is a mesh generation utility that uses a cubed-sphere base mesh to
generate quadrilateral meshes with user-specified enhancements. In order to
determine where enhancement is desired, the user provides a PNG file which
corresponds to a latitude-longitude grid. Raster values with higher brightness
(whiter values) are tagged for refinement. The algorithm uses a basic paving
technique and supports two paving stencil types: Low-connectivity (LOWCONN)
and CUBIT-type transition regions.
technique and supports two paving stencil types: Low-connectivity (`LOWCONN`)
and `CUBIT`-type transition regions.

## OPTIONS

`--grid_type (CS) | ICO`
<dd>

Type of base mesh to use for refinement: cubed-sphere (`CS`) or icosahedral
(`ICO`). If `ICO` is specified, generate a basic icosahedral flag mesh. All
refinement criteria will be ignored in this case.
</dd>

`--refine_type (LOWCONN) | CUBIT | LOWCONNOLD`
<dd>

OPTIONS
--grid_type (CS) | ICO
Type of paving stencil to use `LOWCONN`, `CUBIT` or `LOWCONNOLD`. `LOWCONN` provides
a few enhancements over the previous `LOWCONN` old template by removing
spurious elements with high aspect ratios (typically near interior corners).
</dd>

Type of base mesh to use for refinement: cubed-sphere (CS) or icosahedral
(ICO). If ICO is specified, generate a basic icosahedral flag mesh. All
refinement criteria will be ignored in this case.
`--refine_level <integer>`
<dd>

--refine_type (LOWCONN) | CUBIT | LOWCONNOLD
Number of levels of refinement to use in grid generation. Each refinement
level corresponds to a 2x refinement of the mesh.
</dd>

Type of paving stencil to use LOWCONN, CUBIT or LOWCONNOLD. LOWCONN provides
a few enhancements over the previous LOWCONN old template by removing
spurious elements with high aspect ratios (typically near interior corners).
`--resolution <integer>`
<dd>

--refine_level <integer>
Base resolution of the mesh. For cubed-sphere meshes this corresponds to the
number of faces along each edge of the cubed-sphere.
</dd>

Number of levels of refinement to use in grid generation. Each refinement
level corresponds to a 2x refinement of the mesh.
`--refine_file <filename>`
<dd>

--resolution <integer>
Filename of the PNG file to use for specifying refinement regions.
</dd>

Base resolution of the mesh. For cubed-sphere meshes this corresponds to the
number of faces along each edge of the cubed-sphere.

--refine_file <filename>
`--refine_rect <string>`
<dd>

Filename of the PNG file to use for specifying refinement regions.
An argument specifying rectangular regions on the cubed-sphere where
refinement should be applied. Each refine_rect should be separated by a
semi-colon and consists of five arguments:

--refine_rect <string>
```
<lon1>,<lat1>,<lon2>,<lat2>,<level>
```

An argument specifying rectangular regions on the cubed-sphere where
refinement should be applied. Each refine_rect should be separated by a
semi-colon and consists of five arguments:
<lon1>,<lat1>,<lon2>,<lat2>,<level>
where `<lon1>,<lat1>` are the longitude-latitude coordinates of the lower-right
corner of the refinement region, `<lon2>,<lat2>` are the longitude-latitude
coordinates of the upper-right corner of the refinement region, and `<level>`
is the number of levels of refinement.
</dd>

where <lon1>,<lat1> are the longitude-latitude coordinates of the lower-right
corner of the refinement region, <lon2>,<lat2> are the longitude-latitude
coordinates of the upper-right corner of the refinement region, and <level>
is the number of levels of refinement.
`--output <filename>`
<dd>

--output <filename>
Filename for the output EXODUS-format grid file.
</dd>

Filename for the output EXODUS-format grid file.
`--loadcsrefinementmap`
<dd>

--loadcsrefinementmap
(ADVANCED) If specified, the refinement map will be reloaded from the
previously generated refine_map.dat file. This option allows for manual
editing of the cubed-sphere refine map.
</dd>

(ADVANCED) If specified, the refinement map will be reloaded from the
previously generated refine_map.dat file. This option allows for manual
editing of the cubed-sphere refine map.
`--smooth_type (NONE) | SPRING`
<dd>

--smooth_type (NONE) | SPRING
If `SPRING` is specified, use spring-dynamics type mesh smoothing once the
refined mesh has been generated.
</dd>

If SPRING is specified, use spring-dynamics type mesh smoothing once the
refined mesh has been generated.
`--smooth_dist <integer>`
<dd>

--smooth_dist <integer>
By default (smooth dist 1) only nodes which are part of the transition region
will be smoothed. Larger values of smooth_dist includes nodes of distance
smooth_dist away from the transition region (by edge connectivity). If
smooth_dist is set to -1 then the entire mesh will be subjected to smoothing.
</dd>

By default (smooth dist 1) only nodes which are part of the transition region
will be smoothed. Larger values of smooth_dist includes nodes of distance
smooth_dist away from the transition region (by edge connectivity). If
smooth_dist is set to -1 then the entire mesh will be subjected to smoothing.
`--smooth_iter <integer>`
<dd>

--smooth_iter <integer>
Number of smoothing iterations to perform. A larger value will typically
result in a smoother mesh.
</dd>

Number of smoothing iterations to perform. A larger value will typically
result in a smoother mesh.
`--lon_base <double>`
<dd>

--lon_base <double>
Longitude coordinate (in degrees) of the left-most edge of the PNG image.
</dd>

Longitude coordinate (in degrees) of the left-most edge of the PNG image.
`--lon_shift <double>`
<dd>

--lon_shift <double>
Amount of rotation (in degrees) to apply to the base mesh.
</dd>

Amount of rotation (in degrees) to apply to the base mesh.
`--lon_ref <double>`
<dd>

--lon_ref <double>
The central longitude of the first panel of the cubed-sphere (in degrees).
</dd>

The central longitude of the first panel of the cubed-sphere (in degrees).

--lat_ref <double>
`--lat_ref <double>`
<dd>

The central latitude of the first panel of the cubed-sphere (in degrees).
The central latitude of the first panel of the cubed-sphere (in degrees).
</dd>

--orient_ref <double>
`--orient_ref <double>`
<dd>

The orientation of the cubed sphere at <lon_ref>,<lat_ref> in degrees.
A value of 0 means the cubed-sphere is aligned perfectly zonal at the\
reference point. A value of 45 means the cubed-sphere is inclined by 45
degrees at this point.

--invert
The orientation of the cubed sphere at `<lon_ref>,<lat_ref>` in degrees.
A value of 0 means the cubed-sphere is aligned perfectly zonal at the
reference point. A value of 45 means the cubed-sphere is inclined by 45
degrees at this point.
</dd>

Invert the base image (so black identifies regions of refinement).
`--invert`
<dd>

--block_refine
Invert the base image (so black identifies regions of refinement).
</dd>

Turn on block-wise tagging of elements for refinement.
`--block_refine`
<dd>

Turn on block-wise tagging of elements for refinement.
</dd>
1 change: 0 additions & 1 deletion src/SQuadGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/// or implied warranty.
/// </remarks>

#include <png.h>
#include "netcdfcpp.h"

#include <string>
Expand Down