initial upload

This commit is contained in:
2025-12-17 11:00:57 +08:00
parent 2bc7b24a71
commit a09a73537f
4614 changed files with 3478433 additions and 2 deletions

48
docs/pages/applications.md Executable file
View File

@@ -0,0 +1,48 @@
---
title: Applications
tags: ok
---
LaGriT Applications
-------------------
Visit [meshing.lanl.gov](https://meshing.lanl.gov/proj/index.md) for
examples of mesh applications in geological applications: porous flow,
hydrology, carbon dioxide sequestration, oil and gas, crustal deformation, hydrothermal systems,
and more. The following are graphics and software output formats used
with LaGriT and may be obtained from their respective sources.
### Mesh and Simulation Visualization Software
- [AVS](https://www.avs.com) (commercial)
- [ParaView (free)](https://www.paraview.org)
- [GMV (General Mesh
Viewer)](http://www.gmv-barracuda.com/index.html)
- [Tecplot](https://www.tecplot.com) (commercial)
- [VISIT](https://computing.llnl.gov/vis/visit.md) (free)
### Mesh Tools
- [GRIDDER - a simple grid generation tool for creating orthogonal
quadralateral and hexahedral
grids.](https://meshing.lanl.gov/gridder/gridder.md)
GRIDDER open source LA-CC-15-082
https://github.com/lanl/gridder
- MSTKLA - Mesh ToolKit using the functionality of LaGriT
MSTK open source LA-CC-04-010
https://github.com/MeshToolkit/MSTK
- [LASETUP - interface for generating and viewing LaGriT
geometries.](lasetup.md)
### Modeling Software Used with LaGriT generated files
- [FEHM](https://fehm.lanl.gov) (Subsurface Flow and Transport)
- [PFLOTRAN](https://ees.lanl.gov/pflotran/) (Parallel Reactive Flow
and Transport)
- [GEOFEST](https://www.openchannelsoftware.com/projects/GeoFEST)
(Geophysical Finite Element Simulation Tool)

BIN
docs/pages/boron2.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

214
docs/pages/commands.md Executable file
View File

@@ -0,0 +1,214 @@
---
title: "LaGriT Commands - Alphabetical"
tags: command list all options
---
# Alphabetic Listing of LaGriT Commands <a name="top"></a>
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: |
| [&nbsp;A&nbsp;](#a) | [&nbsp;B&nbsp;](#b) | [&nbsp;C&nbsp;](#c) | [&nbsp;D&nbsp;](#d) | [&nbsp;E&nbsp;](#e) | [&nbsp;F&nbsp;](#f) | [&nbsp;G&nbsp;](#g) | [&nbsp;H&nbsp;](#h) | [&nbsp;I&nbsp;](#i) | [&nbsp;J&nbsp;](#j) | [&nbsp;K&nbsp;](#k) | [&nbsp;L&nbsp;](#l) | [&nbsp;M&nbsp;](#m) | [&nbsp;N&nbsp;](#n) | [&nbsp;O&nbsp;](#o) | [&nbsp;P&nbsp;](#p) | [&nbsp;Q&nbsp;](#q) | [&nbsp;R&nbsp;](#r) | [&nbsp;S&nbsp;](#s) | [&nbsp;T&nbsp;](#t) | [&nbsp;U&nbsp;](#u) | [&nbsp;V&nbsp;](#v) | [&nbsp;W&nbsp;](#w) | [&nbsp;X&nbsp;](#x) | [&nbsp;Y&nbsp;](#y) | [&nbsp;Z&nbsp;](#z) |
--------------
<br>
<a name="a"></a><br>
* [**`ADDMESH`**](docs/commands/ADDMESH.md) (join meshes, merge multiple meshes)
* [**`ASSIGN`**](docs/commands/ASSIGN.md) (set global mesh object variables)
<br>
<a name="b"></a><br>
* [**`BOUNDARY`**](docs/commands/BOUNDAR1.md) (set boundary attributes on surfaces)
* [**`BOUNDARY_COMPONENTS`**](docs/commands/BOUNDARY_C.md) (count boundary components)
* [**`BUBBLE`**](docs/commands/bubble.md) (extrude to 3D and extract boundary)
<br>
<a name="c"></a><br>
* [**`CALC_RDIST`**](docs/commands/calc_rdist.md) (calculate radial distance)
* [**`CMO`**](docs/commands/CMO2.md) (mesh object operations)
* [**`COLORMAP`**](docs/commands/COLORMAP.md) (build adjacency map)
* [**`COMPUTE`**](docs/commands/COMPUTE.md) (compute a new mesh attribute value)
* [**`CONNECT`**](docs/commands/CONNECT1.md) (connect points into tetrahedral mesh)
* [**`COORDSYS`**](docs/commands/COORDSY.md) (change coordinate system)
* [**`COPYPTS`**](docs/commands/COPYPTS.md) (copy points into mesh object)
* [**`CREATEPTS`**](docs/commands/createpts.md) (create point distribution)
* [**`CREATE_GRAPH`**](docs/commands/create_graph.md) (create adjacency graph)
* [**`CRUSH_THIN_TETS`**](docs/commands/crush_thin_tets.md) (reduce number of thin tets)
<br>
<a name="d"></a><br>
* [**`DEFINE`**](docs/commands/DEFINE.md) (assign value to variable name)
* [**`DEREFINE`**](docs/commands/DEREFINE.md) (merge nodes away)
* [**`DOPING`**](docs/commands/DOPING1.md) (deprecated, see interpolate)
* [**`DUMP`**](docs/commands/DUMP2.md) (write output files)
* [**`DUMP_RECOLOR`**](docs/commands/DUMP_RECOLOR.md) (use adjacency map)
<br>
<a name="e"></a><br>
* [**`EDIT`**](docs/commands/EDIT2.md) (print some mesh info)
* [**`ELMTEST`**](docs/commands/elmtest.md) (validate connectivity)
* [**`ELTSET`**](docs/commands/ELTSET2.md) (set of elements for mesh object)
* [**`EXTRACT`**](docs/commands/EXTRACT1.md) (extract 2D from 3D)
* [**`EXTRACT SURFMESH`**](docs/commands/dump/EXTRACT_SURFMESH.md) (extract boundary surface)
* [**`EXTRUDE`**](docs/commands/extrude.md) (extrude a surface)
<br>
<a name="f"></a><br>
* [**`FIELD`**](docs/commands/FIELD.md) (manipulate a field attribute)
* [**`FILTER`**](docs/commands/FILTER.md) (filter duplicate nodes)
* [**`FINISH`**](docs/commands/FINISH.md) (end processing, EXIT)
* [**`FSET`**](docs/commands/FSET.md) (set of faces for mesh object)
<br>
<a name="g"></a><br>
* [**`GENIEE`**](docs/commands/GENIEE.md) (make or check element connectivity)
* [**`GEOMETRY`**](docs/commands/geometry.md) (name geometry for mesh object)
* [**`GRID2GRID`**](docs/commands/GRID2GRID.md) (convert elements)
<br>
<a name="h"></a><br>
* [**`HELP`**](docs/commands/HELP.md) (print global variable)
* [**`HEXTOTET`**](docs/commands/HEXTOTE.md) (convert elements, see grid2grid)
<br>
<a name="i"></a><br>
* [**`INFILE`**](docs/commands/INPUT.md) (read commands from a file, also input)
* [**`INPUT`**](docs/commands/INPUT.md) (read commands from a file, also infile)
* [**`INTERSECT`**](docs/commands/INTERSECT.md) (intersect 2D meshes to get line)
* [**`INTERSECT_ELEMENTS`**](docs/commands/intersectelements.md) (intersect meshes)
* [**`INTERPOLATE`**](docs/commands/main_interpolate.md)(values from nodes or elements)
<br>
<a name="k"></a><br>
* [**`KDTREE`**](docs/commands/kdtree.md) (represent mesh as kd-tree)
<br>
<a name="l"></a><br>
* [**`LOG`**](docs/commands/LOG.md) (turn log file off and on)
* [**`LOOP`**](docs/commands/loop.md) (execute command multiple times)
* [**`LOWER_D`**](docs/commands/lower_d.md) (create lower dimension structures)
<br>
<a name="m"></a><br>
* [**`MASSAGE`**](docs/commands/MASSAGE.md)(optimize the grid)
* [**`MASSAGE2`**](docs/commands/MASSAGE2.md) (optimize based on gradient field)
* [**`MATH`**](docs/commands/MATH.md) (math operations on attributes)
* [**`MEMORY`**](docs/commands/memory.md) (query state of memory)
* [**`MERGE`**](docs/commands/MERGE.md) (remove nodes)
* [**`METIS`**](docs/commands/metis.md) (graph partition algorithms)
* [**`MODE`**](docs/commands/MODE.md) (set modes)
* [**`MREGION`**](docs/commands/MREGION.md) (define material region for mesh object)
<br>
<a name="n"></a><br>
* [**`NEGATIVE_AIJ`**](docs/commands/NEGATIVE.md) (test bndry for neg. coef.)
<br>
<a name="o"></a><br>
* [**`OFFSETSURF`**](docs/commands/OFFSETSURF.md) (offset a triangulated surface)
<br>
<a name="p"></a><br>
* [**`PERTURB`**](docs/commands/PERTURB.md) (perturb node locations)
* [**`PSET`**](docs/commands/PSET.md) (set of nodes for mesh object)
* [**`PSTATUS`**](docs/commands/PSTATUS.md) (operate on point set)
<br>
<a name="q"></a><br>
* [**`QUADXY`**](docs/commands/QUADXY.md) (define a logical X,Y node set)
* [**`QUADXYZ`**](docs/commands/QUADXYZ1.md) (define a logical X,Y,Z node set)
* [**`QUALITY`**](docs/commands/QUALITY.md) (report mesh quality values)
<br>
<a name="r"></a><br>
* [**`RADAPT`**](docs/commands/RADAPT.md) (adaptive smoothing)
* [**`RANKVOLUME`**](docs/commands/rankvolume.md)(list small volume elements)
* [**`READ`**](docs/commands/READ.md) (read input file)
* [**`RECON`**](docs/commands/RECON.md) (swap edges/faces)
* [**`REFINE`**](docs/commands/REFINE.md) (refine elements, edges)
* [**`REFINE2D`**](docs/commands/refine2d.md) (refine a triangle)
* [**`REGION`**](docs/commands/REGION.md) (define a geometric region)
* [**`REGNPTS`**](docs/commands/REGNPTS.md) (distributes nodes in region)
* [**`REORDER`**](docs/commands/REORDER.md) (reorder nodes in a mesh)
* [**`RESETPTS`**](docs/commands/RESETPT.md) (reset node type values)
* [**`RM`**](docs/commands/RM.md) (remove nodes in area)
* [**`RMMAT`**](docs/commands/RMMAT.md) (remove a material)
* [**`RMPOINT`**](docs/commands/RMPOINT.md) (remove nodes or elements)
* [**`RMREGION`**](docs/commands/RMREGION.md) (remove a geometric region)
* [**`RMSPHERE`**](docs/commands/RMSPHERE.md) (remove nodes in a sphere)
* [**`RMSURF`**](docs/commands/RMSURF.md) (remove nodes in or on a surface)
* [**`ROTATELN`**](docs/commands/ROTATELN.md) (rotate nodes about a line)
* [**`ROTATEPT`**](docs/commands/ROTATEPT.md)  (rotate nodes about a point)
* [**`RZ`**](docs/commands/RZ.md) (deprecated, see createpts)
* [**`RZAMR`**](docs/commands/RZAMR.md) (deprecrated, see createpts)
* [**`RZBRICK`**](docs/commands/RZBRICK.md) (create a brick, hex mesh)
* [**`RZRAN`**](docs/commands/RZRAN.md) (deprecrated, see createpts)
* [**`RZS`**](docs/commands/RZS.md) (deprecrated, see createpts)
* [**`RZV`**](docs/commands/RZV_LG.md) (deprecrated, see createpts)
<br>
<a name="s"></a><br>
* [**`SCALE`**](docs/commands/SCALE.md) (scale node coordinates)
* [**`SETPTS`**](docs/commands/SETPTS.md) (set node type and material)
* [**`SETSIZE`**](docs/commands/SETSIZE.md) (set epsilon values based on space size)
* [**`SETTETS`**](docs/commands/SETTETS.md) (make parent-child nodes, set element material)
* [**`SMOOTH`**](docs/commands/SMOOTH.md) (optimize with node smoothing)
* [**`SORT`**](docs/commands/SORT.md) (sort an attribute)
* [**`STACK`**](docs/commands/STACK.md) (read and merge surfaces)
* [**`SURFACE`**](docs/commands/SURFACE.md) (define a geometric surface)
* [**`SURFPTS`**](docs/commands/SURFPTS.md) (make nodes on a surface)
<br>
<a name="t"></a><br>
* [**`TRANS`**](docs/commands/TRANS.md) (translate node coordinates)
* [**`TRIANGULATE`**](docs/commands/TRIAGN.md) (triangulate inside polygon)
<br>
<a name="u"></a><br>
* [**`UNG2AVS`**](docs/commands/UNG2AVS.md) (UNGenerate to AVS)
* [**`UPSCALE`**](docs/commands/UPSCALE.md) (attributes from a fine grid to a coarse grid)
<br>
<br> <a name="z"></a>
* [**`ZQ`**](docs/commands/ZQ.md) (deprecrated, see cmo/setatt)
<br>
<br>
[Back to Top](#top)
<br>
<br>
[Tutorials and Examples](tutorial/index.md)
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

216
docs/pages/commands_cat.md Executable file
View File

@@ -0,0 +1,216 @@
LaGriT Commands by Category
===========================
## Geometry Commands:
[GEOMETRY](docs/commands/geometry.md) (set the geometry name)
[MREGION](docs/commands/MREGION.md) (define a material region)
[OFFSETSURF](docs/commands/OFFSETSURF.md) (..triangulated surface)
[REGION](docs/commands/REGION.md) (define a geometric region)
[RZS](docs/commands/RZS.md) (depreciated, see createpts)
[SURFACE](docs/commands/SURFACE.md) (define a geometric surface)
## Point Placement:
[COPYPTS](docs/commands/COPYPTS.md) (copy existing points)
[CREATEPTS](docs/commands/createpts.md) (create points)
[QUADXY](docs/commands/QUADXY.md) (define a logical xy node set)
[QUADXYZ](docs/commands/QUADXYZ1.md) (define a logical xyz node set)
[RZAMR](docs/commands/RZAMR.md) (depreciated, see createpts)
[REGNPTS](docs/commands/REGNPTS.md) (distributes nodes in region)
[REFINE2D](docs/commands/refine2d.md) (refine a triangle)
[REORDER](docs/commands/REORDER.md) (reorder nodes in a mesh)
[RZ](docs/commands/RZ.md) (depreciated, see createpts)
[RZRAN](docs/commands/RZRAN.md) (depreciated, see createpts)
[SURFPTS](docs/commands/SURFPTS.md) (make nodes on a surface)
## Point Modification and Selection:
[COORDSYS](docs/commands/COORDSY.md) (change coordinate system)
[COPYPTS](docs/commands/COPYPTS.md) (copy existing points)
[FILTER](docs/commands/FILTER.md) (filter nodes)
[PERTURB](docs/commands/PERTURB.md) (perturb node locations)
[PSET](docs/commands/PSET.md) (define, name sets of nodes)
[PSTATUS](docs/commands/PSTATUS.md) (operate on point set)
[RESETPTS](docs/commands/RESETPT.md) (reset node values)
[RM](docs/commands/RM.md) (remove nodes in area)
[RMMAT](docs/commands/RMMAT.md) (remove a material)
[RMPOINT](docs/commands/RMPOINT.md) (remove nodes/elements)
[RMREGION](docs/commands/RMREGION.md) (remove a geometric region)
[RMSPHERE](docs/commands/RMSPHERE.md) (remove nodes in a sphere)
[RMSURF](docs/commands/RMSURF.md) (remove nodes in /on a surface
[ROTATELN](docs/commands/ROTATELN.md) (rotate nodes about a line)
[ROTATEPT](docs/commands/ROTATEPT.md)  (rotate nodes about a point)
[SCALE](docs/commands/SCALE.md) (scale node coordinates)
[TRANS](docs/commands/TRANS.md) (translate node coordinates)
[ZQ](docs/commands/UNG2AVS.md) (depreciated, see cmo/setatt)
## Connecting the Mesh:
[CONNECT](docs/commands/CONNECT1.md) (make tetrahedral mesh)
[GENIEE](docs/commands/GENIEE.md) (make element connectivity)
[RZBRICK](docs/commands/RZBRICK.md) (create a brick, hex mesh)
[SETPTS](docs/commands/SETPTS.md) (set node type and material)
[SETTETS](docs/commands/SETTETS.md) (make child nodes, set element
material)
[TRIANGULATE](docs/commands/TRIAGN.md) (make triangles)
## Element Modification and Selection:
[ELTSET](docs/commands/ELTSET2.md) (select, name a set of elements)
[FSET](docs/commands/FSET.md) (define a face set)
[RMPOINT](docs/commands/RMPOINT.md) (remove nodes/elements)
## Creating, modifying, assessing and deleting mesh objects and their attributes:
[ADDMESH](docs/commands/ADDMESH.md) (join meshes)
[BOUNDARY](docs/commands/BOUNDAR1.md) (set attributes on surfaces)
[BOUNDARY_COMPONENTS](docs/commands/BOUNDARY_C.md) (count boundary edges)
[CALC_RDIST](docs/commands/calc_rdist.md) (calculate radial distance)
[CMO](docs/commands/CMO2.md) (modify mesh object)
[COLORMAP](docs/commands/COLORMAP.md) (build adjacency map)
[COMPUTE](docs/commands/COMPUTE.md) (compute a new mesh attribute)
[COPYPTS](docs/commands/COPYPTS.md) (copy points)
[CREATE_GRAPH](docs/commands/create_graph.md) (create adjacency graph)
[DOPING](docs/commands/DOPING1.md) (set an attribute; depreciated, see
interpolate)
[EXTRACT](docs/commands/EXTRACT1.md) (extract a surface)
[EXTRUDE](docs/commands/extrude.md) (extrude a surface)
[FIELD](docs/commands/FIELD.md) (manipulate a field attribute)
[GRID2GRID](docs/commands/GRID2GRID.md) (element type conversion)
[INTERPOLATE](docs/commands/main_interpolate.md) (interpolate
attribute values from nodes or elements )
[INTERSECT](docs/commands/INTERSECT.md) (intersect 2d meshes to get line)
[INTERSECT_ELEMENTS](docs/commands/intersectelements.md) (intersect mesh elements)
[KDTREE](docs/commands/kdtree.md) (represent mesh as kd-tree)
[LOWER_D](docs/commands/lower_d.md) (create lower dimen. structs.)
[MATH](docs/commands/MATH.md) (do math on attributes)
[QUALITY](docs/commands/QUALITY.md) (evaluate mesh quality)
[RANKVOLUME](docs/commands/rankvolume.md)(list small volume elements)
[SORT](docs/commands/SORT.md) (sort an attribute)
[UPSCALE](docs/commands/UPSCALE.md) (attribute from fine to coarse
grid)
## Optimize or customize the mesh:
[BUBBLE](docs/commands/bubble.md) (extrude to 3d and extract bndry)
[CRUSH_THIN_TETS](docs/commands/crush_thin_tets.md) (reduce number of thin tets)
[DEREFINE](docs/commands/DEREFINE.md) (merge nodes away)
[HEXTOTET](docs/commands/HEXTOTE.md) (convert element types)
[MASSAGE](docs/commands/MASSAGE.md)(optimize the grid)
[MASSAGE2](docs/commands/MASSAGE.md)(optimize the grid)
[MERGE](docs/commands/MERGE.md) (remove nodes)
[METIS](docs/commands/MERGE.md) (graph partition algorithms)
[MODE](docs/commands/MODE.md) (set modes)
[RADAPT](docs/commands/RADAPT.md) (adaptive smoothing)
[RECON](docs/commands/RECON.md) (swap edges/faces)
[REFINE](docs/commands/REFINE.md) (refine elements, edges)
[SETSIZE](docs/commands/SETSIZE.md) (calc size of space, set epsilon)
[SMOOTH](docs/commands/SMOOTH.md) (node smoothing)
## Input/Output:
[DEFINE](docs/commands/DEFINE.md) (give a name to a number)
[DUMP](docs/commands/DUMP2.md) (write output files)
[DUMP_RECOLOR](docs/commands/DUMP_RECOLOR.md) (use adjacency map)
[EDIT](docs/commands/EDIT2.md) (prints some mesh info)
[HELP](docs/commands/HELP.md) (print global variable)
[INFILE](docs/commands/INPUT.md) (read input from a file)
[INPUT](docs/commands/INPUT.md) (read input from a file)
[LOG](docs/commands/LOG.md) (turn log file off and on)
[MEMORY](docs/commands/memory.md) (query state of memory)
[READ](docs/commands/READ.md) (read data)
[STACK](docs/commands/STACK.md) (read, merge surfaces)
[UNG2AVS](docs/commands/UNG2AVS.md) (UNGenerate to AVS)
## Validation, Manipulation:
[ASSIGN](docs/commands/ASSIGN.md) (set global variables)
[ELMTEST](docs/commands/elmtest.md) (validate connectivity)
[FINISH](docs/commands/FINISH.md) (end processing, EXIT)
[LOOP](docs/commands/loop.md) (execute command multiple times)
[NEGATIVE_AIJ](docs/commands/NEGATIVE.md) (test bndry for neg.
coef.)
[RZV](docs/commands/RZV_LG.md) (depreciated, see createpts)

4
docs/pages/denise.md Executable file
View File

@@ -0,0 +1,4 @@
Pictures Created By Denise George
---------------------------------
<img height="300" width="300" src="https://lanl.github.io/LaGriT/assets/images/nist.jpg">

23
docs/pages/development.md Executable file
View File

@@ -0,0 +1,23 @@
LaGriT Code Development Team
----------------------------
[Carl W. Gable](http://www.lanl.gov/search-capabilities/profiles/carl-gable.shtml) Author (Retired from LANL)
[Terry Miller](http://www.lanl.gov/search-capabilities/profiles/terry-miller.shtml) Support
[Jeffrey De'Haven Hyman](http://www.lanl.gov/search-capabilities/profiles/jeffrey-hyman.shtml) Applications
[Tinka Gammel](http://public.lanl.gov/jtg/)
Denise George (Retired)
[Andrew Kuprat](http://www.pnnl.gov/science/staff/staff_info.asp?staff_num=7019)
Frank A. Ortega
[Harold Trease](http://www.sysbio.org/resources/staff/trease.stm) Retired from LANL
[Lynn Trease](http://www.sysbio.org/resources/staff/l-trease.stm) Retired from LANL
Robert B. Walker

29
docs/pages/docs/DEFINEII.md Executable file
View File

@@ -0,0 +1,29 @@
**3. Define interior interfaces**
Interfaces are defined with the **[surface](commands/SURFACE.md)**
command. In this case the boundary type is **intrface**. If the command
defines a volume (e.g. box, cylinder) then the interface is the surface
of the volume defined. If the command defines a plane or sheet then the
interface is the plane or sheet. It is important to remember that planes
are infinite and that the order of points specifying the plane
determines a normal to the plane in the usual right-hand-rule sense
([see Section II.a.9](conventions.md)). This direction is important in
determining regions. In order to divide the unit cube defined above in
half vertically, define a plane by:
**surface**/cutplane**/intrface** **/plane**/0.,0.,.5/1.,0.,.5/1.,1.,.5
The normal to this plane points in the positive z direction.
<img height="300" width="300" src="https://lanl.github.io/LaGriT/assets/images/Image222.gif">
Interfaces must not be coincident with reflective boundaries. For
example to embed a rectangle inside a cube, it is necessary to extend
the ends of the rectangle beyond the cube to avoid coincident reflective
and interface surfaces:
**surface**/cube**/reflect** **/box**/0.0,0.0,0.0/1.0,1.0,1.0
**surface**/rect **/intrface/box**/-0.1,0.5,0.2/1.1,0.6,0.5
<img height="300" width="300" src="https://lanl.github.io/LaGriT/assets/images/Image223.gif">

View File

@@ -0,0 +1,131 @@
---
title: "Quality for Tetrahedrons"
---
# quality measures to characterize tets as type: equilateral, sliver, wedge, cap or needle elements.
## Characteristics
- **Equilateral**: Characterized by equal edge lengths, aspect ratio 1, and angles near 70 degrees.
- **Sliver**: Characterize by small minimum dihedral angle and large maximum dihedral angle but not a large solid angle.
- **Cap**: Characterize by large maximum solid angle.
- **Needle**: Characterize by small min/max edge length ratio but not small minimum dihedral angle.
- **Wedge**: Characterize by small minimum dihedral angle and small min/max edge length ratio.
See example input and output files for these elements in test/level01/quality.
Characteristic | Equilateral | Sliver | Cap | Needle | Wedge |
------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------- |
**Picture** | <img src="https://lanl.github.io/LaGriT/assets/images/quality_tet_equilateral.png" width="100%"> | <img src="https://lanl.github.io/LaGriT/assets/images/quality_tet_sliver.png" width="100%"> | <img src="https://lanl.github.io/LaGriT/assets/images/quality_tet_cap.png" width="100%"> | <img src="https://lanl.github.io/LaGriT/assets/images/quality_tet_needle.png" width="100%"> | <img src="https://lanl.github.io/LaGriT/assets/images/quality_tet_wedge.png" width="100%"> |
**Coordinates** | 0 0 0<br>0 1 1<br>1 0 1<br>1 1 0 | 1 0 0.1<br>-1 0 0.1<br> 0 1 -0.1<br> 0 -1 -0.1<br> | 1 0 0<br>1 1 0<br>0 0 0<br>0.75 0.25 0.1<br> | .1 -.1 0<br> .1 .1 0<br>-.1 0 0<br> 0 0 1<br> | 1 0 0<br> -1 0 0<br> 0 1 0.1<br> 0 1 -0.1<br> |
**Aspect Ratio** | 1.0 | 0.2927 | 0.07447 | 0.3429 | 0.2617 |
**Min Dihedral Angle** | 7.05288E+01 | 1.59424E+01 | 1.57931E+01 | 5.33585E+01 | 1.14212E+01 |
**Max Dihedral Angle** | 7.05288E+01 | 1.57380E+02 | 1.49549E+02 | 8.74394E+01 | 90.0 |
**Max Solid Angle** | 3.15863E+01 | 9.26487E+00 | 2.60111E+02 | 5.56182E+01 | 8.19307E+01 |
**Min/Max Edge Length Ratio** | 1.0 | 7.14143E-01 | 2.59807E-01 | 1.98030E-01 | 0.1 |
## Example: LaGriT input file to identify sliver, cap, needle and wedge type elements.
*--* ex_id_tet_types
*--* Header Begin
*--* LAGriT Example Identify Sliver, Cap, Needle, Wedge
* Carl Gable
* gable -at- lanl -dot- gov
*
*
*--* Create a random point distribution
*--* Connect them into a tet mesh
*--*
*--*----------------------------------------------------
*--* Header End
*--* ex_id_tet_types
*--*
cmo / create / cmo1 / / / tet
surface / outer / reflect / box / 0,0,0 / 1,1,1
region / r1 / le outer /
mregion / m1 / le outer /
createpts / random / xyz / 0.1 / 0,0,0 / 1,1,1
setpts
connect
dump / gmv / output_tets.gmv
*
* Compute the various tet quality measures
*
* Minimum Dihedral Angle, (degree)
cmo / addatt / cmo1 / ang_mind / ang_mind
* Minimum Dihedral Angle, (radian)
cmo / addatt / cmo1 / ang_minr / ang_minr
* Maximum Dihedral Angle, (degree)
cmo / addatt / cmo1 / ang_maxd / ang_maxd
* Maximum Dihedral Angle, (radian)
cmo / addatt / cmo1 / ang_maxr / ang_maxr
* Minimum Solid Angle, (degree)
cmo / addatt / cmo1 / ang_mind_solid / s_mind
* Minimum Solid Angle, (radian)
cmo / addatt / cmo1 / ang_minr_solid / s_minr
* Maximum Solid Angle, (degree)
cmo / addatt / cmo1 / ang_maxd_solid / s_maxd
* Maximum Solid Angle, (radian)
cmo / addatt / cmo1 / ang_maxr_solid / s_maxr
* Aspect Ratio
quality / aspect / y
* ( minimum edge lenght ) / ( maximum edge length )
quality / edge_ratio / y
* Edge lenght minimum
quality / edge_min / y
* Edge length maximum
quality / edge_max / y
*
* Identify Slivers
*
* Define adjustable parameters to determine cut-off values.
*
define / MIN_DIHEDRAL / 10.0
define / MAX_DIHEDRAL / 170.0
define / MAX_SOLID_ANG_BIG / 170.0
define / MAX_SOLID_ANG_SMALL / 10.0
define / EDGE_RATIO / 0.1
*
eltset / e_dih_small / ang_mind / le / MIN_DIHEDRAL
eltset / e_dih_big / ang_maxd / ge / MAX_DIHEDRAL
eltset / e_solid_big / s_maxd / le / MAX_SOLID_ANG_SMALL
eltset / e_tmp / inter / e_dih_small e_dih_big
eltset / e_sliver / inter / &
e_tmp e_solid_big
*
* Identify Cap elements
*
eltset / e_cap / s_maxd / ge / MAX_SOLID_ANG_BIG
*
* Identify Needle elements
*
eltset / e_edge_ratio / eratio / le / EDGE_RATIO
eltset / e_dih_small / ang_mind / le / MIN_DIHEDRAL
eltset / e_needle / not / e_edge_ratio e_dih_small
*
* Identify Wedge elements
*
eltset / e_wedge / inter / e_edge_ratio e_dih_small
*
* Set up some attributes to tag the elements.
*
cmo/addatt/cmo1/if_sliv/vint/scalar/nelements/-def-/-def-/-def-/1
cmo/addatt/cmo1/if_cap/vint/scalar/nelements/-def-/-def-/-def-/1
cmo/addatt/cmo1/if_ned/vint/scalar/nelements/-def-/-def-/-def-/1
cmo/addatt/cmo1/if_wed/vint/scalar/nelements/-def-/-def-/-def-/1
cmo/setatt/cmo1/if_sliv/eltset get e_sliver/ 2
cmo/setatt/cmo1/if_cap /eltset get e_cap / 2
cmo/setatt/cmo1/if_ned /eltset get e_needle/ 2
cmo/setatt/cmo1/if_wed /eltset get e_wedge / 2
dump / gmv / tet_types.gmv / cmo1
* begin compare here
cmo / status
cmo / printatt / / -all- / minmax
quality
finish

41
docs/pages/docs/REFINE1.md Executable file
View File

@@ -0,0 +1,41 @@
---
title: "Section Grid Refinement Criteria and Algorithms"
tags: Grid Refinement Criteria Algorithms
---
## Grid Refinement and Criteria - Algorithms
-------------
The Refine command for the grid generation code LaGriT uses various criteria to tag grid elements for refinement or derefinement. When
utilizing unstructured grids generated by LaGriT for applications such as solution of partial differential equations (PDE) for
physical systems, it is desirable to modify the grid in order to optimize it for the particular problem based on several principles.
The goal is to produce a better solution by creating better grid elements in various regions of the domain of the PDE's. This can
involve physical criteria such as choosing smaller elements where
physical variables are rapidly changing or larger elements where the
variables are relatively constant in order not to waste computational effort.
Grid elements can also be chosen on various geometric criteria related to their shape such as different
formulations of an aspect ratio. In time dependent problems, it may be necessary to refine and derefine the grid after each time step in
order to follow various changing phenomena such as moving concentration fronts, shock waves, or advancing oxide layers. These
factors make mesh refinement crucial to the practical solution of physical modeling problems.
We therefore will detail several algorithms that are currently implemented for identifying which grid
elements should be refined or derefined based on geometric and physical criteria. New algorithms will be added to this list and the
current ones modified as we obtain feed back from users.
[I. Edges: Each edge is tested separately to see if it should be tagged for refinement or derefinement](./edges.md)
[II. Faces: Each face is tested separately for refinement or derefinement.](refine_faces.md)
[III. Tets: Each tetrahedron is tested separately for refinement or derefinement](refine_tets.md)
IV. Face Edges: Same algorithms of the Faces category except all edges
of the face are tagged for refinement or derefinement if the condition
is met for the  face.
V. Tet Edges: Same algorithms of the tet category except all edges
of the tet are tagged for refinement or derefinement if the
condition is met for the tet.

76
docs/pages/docs/References.md Executable file
View File

@@ -0,0 +1,76 @@
# LaGriT References
To reference LaGriT in a publication use the following citation:
Los Alamos Grid Toolbox, LaGriT, Los Alamos National Laboratory,
&lt;http://lagrit.lanl.gov&gt;, *year_of_lagrit_version*.
For example:
Los Alamos Grid Toolbox, LaGriT, Los Alamos National Laboratory,
&lt;http://lagrit.lanl.gov&gt;, 2013.
1.  Kuprat, Andrew, "[Modeling Microstructure Evolution using
Gradient-Weighted Moving Finite Elements<a href="https://lanl.github.io/LaGriT/assets/images/mfegg.pdf" download> </a>"
LA-UR-98-4879, submitted to SIAM J. Sci. Comp. (1998).
2.  Kuprat, Andrew and George, Denise, "[Maintaining Tetrahedral Mesh
Quality in Response to Time-DependentTopological    and Geometrical
Deformation<a href="https://lanl.github.io/LaGriT/assets/images/london98_pn.pdf" download> </a>", LA-UR--5187, Proceedings of
the 6th International Conference on  Numerical Grid Generation in
Computational Field Simulations, M. Cross (ed.), International Society
of Grid Generation  (ISBN 0-9651627), pp. 5-598, May 1998.
3.  George, Denise, "[Unstructured Toolbox for Modeling and
Simulation"<a href="https://lanl.github.io/LaGriT/assets/images/nasa.pdf" download> </a>, LA-UR--3052, presented at the 19
Workshop on Computational Electronics and Nanoelectronics, Urbana,
Illinois, October 20-22, 19.
4.  Kuprat, Andrew; Cartwright David; Gammel J. Tinka; George Denise;
Kendrick Brian; Kilcrease David; Trease Harold;  and Walker, Robert,["X3D, Moving Grid Methods for Semiconductor
Applications"<a href="https://lanl.github.io/LaGriT/assets/images/21.pdf" download> </a> ,LA-UR--21.
5.  Kuprat, Andrew, "[Adaptive Smoothing Techniques for 3-D Unstructured
Meshes<a href="https://lanl.github.io/LaGriT/assets/images/MSU96.pdf" download> </a>", LA-UR-96-1 (1996).
6.   Kuprat, Andrew, Denise George, Eldon Linnebur, Harold Trease , R.
Kent Smith, "[Moving Adaptive Unstructured 3-D  Meshes in Semiconductor
Process Modeling Applications<a href="https://lanl.github.io/LaGriT/assets/images/BORON.pdf" download> </a>", LA-UR-95-4128, VLSI
Design, Vol. 6(1-4), (1998),  pp373-378.
7.  Khamayseh, Ahmed; Ortega,Frank; Trease, Harold, "Ray Tracing for
Point Distribution in Unstructured Grid Generation",  LA-UR-95-4470
(1995).
8.  Kuprat, Andrew and Khamayseh, Ahmed, "[Non-Parametric Volume
Conserving Smoothin<a href="https://lanl.github.io/LaGriT/assets/images/volsmooth.pdf" download> </a>g, LA-UR-98-3381 (1998).
9.  Khamayseh, Ahmed and Kuprat, A, "[Anisotropic Smoothing and Solution
Adaption for Unstructured Grids,<a href="https://lanl.github.io/LaGriT/assets/images/ahmandrew1.pdf" download> </a>"  
LA-UR-95-2205, International Journal for Numerical Methods in
Engineering, Vol. 39, pp. 3163-3174 (1996).
10.  Khamayseh, Ahmed; Ortega,Frank; Kuprat, Andrew, "A Robust Point
Location Algorithm for General Polyhedra",   LA-UR-95-4465 (1995).
11.  Khamayseh, A., and Kuprat, A., "Surface Grid Generation Systems,"
LA-UR--87, CRC Handbook ofGrid Generation,  ed. Joe Thompson , CRC
Press, (ISBN 0849326877), (1998).
12.  Khamayseh, A., Kuprat, A., and W. Mastin, "Boundary Orthogonality
in Elliptic Grid Generation", LA-UR--3827, CRC Handbook of Grid
Generation, ed.
13.  Gammel, J. Tinka and Kuprat, Andrew, "Modeling Metallic
Microstructure Using Moving Finite Elements", presented at the
Computational and Theory Symposium Pacific Coast Meeting of the American
Ceramic Society, IRvine, CA, Oct.  21-24, 1998.
14.  Gammel, J. Tinka; Kuprat, A; Carlson, N.N.; George D.C, "Modeling
Metallic Microstructure: OrientationDependence",to be presented at the
APS meeting, March 1999.
15.  Denise C. George, Andrew P. Kuprat, "[Optimizing 3D Tetrahedral
Grids<a href="https://lanl.github.io/LaGriT/assets/images/2pager-massage-20000.pdf" download> </a>"  Theoretical Division - Self
Assessment, April 2000. LA-UR-00-1.

346
docs/pages/docs/STOR_Form.md Executable file
View File

@@ -0,0 +1,346 @@
# FEHMN Stor File Format
The sparse matrix data file is both an input and an output file the FEHM application uses for storing or reading geometric coefficients associated with a finite element mesh. The sparse matrix data file is read during FEHM initialization if being used for input. The generated name is of the form filename.stor and can be written in ascii or binary (unformatted) mode.
The stor file is written with "blocks" of information data in the following format.
1. ASCII Header consisting of 2 lines giving code version information, date, and time.
2. Single line with matrix integer parameters; number_coefs, nodes, memory_size, num_area_coefs, max_num_connections.
3. List of Voronoi Volumes associated with each node.
4. List indicating the number of entries for each row of the matrix. If a node in a mesh has N edge connections, this number is N+1.
5. Connectivity list. Row i is a list of all nodes j1, j2, j3... connected to node i. The list contains the matrix diagonal entry, i.
6. Pointers or index numbers into the last block containing values for area coefficients.
7. List of Geometric area coefficients. In general this is the area of each face of the Voronoi polygon associate with node i, face j
## ASCII Header Lines
```
fehmstor ascir8i4 LaGriT Sparse Matrix Voronoi Coefficients
Thu Jul 25 08:41:03 20193-D Linear Diffusion Model (matbld3d_astor)
```
Title Line: The first line consists of a character string of 72 or less characters. Characters 14-17 should be labled as one of r4i4 r4i8 r8i4 r8i8. This signifies the number of bytes used for reals 'r' and integers 'i'. For instance, r8i4 means 8 byte reals, 4 byte integer. The second word also contains information stating whether the file is binary or ASCII (text). If it is ASCII, then characters 10-16 should be 'asci.' If it is binary, then characters 10-16 should be 'ieee'.
Date Line: The second line contains a character string of 72 or less characters. This line contains a time stamp of when the file was written and the code option used for writing this file.
## Matrix Parameters
```
3 12 65 1 5
```
The Parameter line has integer values: NUM_WRITTEN_COEFS, NEQ, NCOEF+NEQ+1, NUM_AREA_COEF, and optional value NCON_MAX.
NUM_WRITTEN_COEFS: is the number coefficient values written in the .stor file. If compression is not used, then this is number is equal to the number of connections in the grid. If compression is used, each unique value will be written once and pointers will reference the appropriate value.
NEQ: signifies the number of equations and is equivalent to the number of nodes in a triangular or tetrahedral grid.
NCOEF+NEQ+1: is a value used to allocate memory in FEHM for the integer pointers.
NUM_AREA_COEF: Can be (1,3, or 4) number of area coefficients. The area/distance coefficients are the area of a Voronoi face divided by the Delaunay edge length. This coefficient is either written as a scalar (1), a vector area (3), or both vector and scalar areas are written (4).
NCON_MAX: is an optional parameter indicating the maximum number of connections to a single node in the entire mesh. This is used for memory allocation. If omitted, FEHM will default to a value that might cause problems in highly unstructured meshes.
## Voronoi Volumes ##
```
1.250000000000E-01 2.500000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
2.500000000000E-01 2.500000000000E-01 2.500000000000E-01 1.250000000000E-01 1.250000000000E-01
1.250000000000E-01 1.250000000000E-01
```
This block has NEQ (number of nodes) floating point values which are the Voronoi Volumes associated with each node.
Each mesh node is a voronoi center for the volume. So nodes on the boundary will have a fractional volume, for instance a 90 degree corner node will have half or quarter volumes compared to the nodes internal to the mesh. A bottom node will have half the volume of nodes above and internal given the same spacing.
## Row Counts for Matrix ##
```
13 17 22 26 30
34 39 44 49 53
57 61 65
```
The purpose of this block is to indicate the number of specified entries each row of the matrix contains. (All unspecified entries are assumed to be 0).
The representation is circuitous. There are a total of NEQ+1 entries. The first entry is the value NEQ+1. The second entry is the value NEQ+1+the number of connections the in the first row. The third entry is value of the second entry + the number of connections in the second row. In general, the ith entry (for i1) is the i-1th entry + the number of specified entries in the row i-1. In this way, the difference between the i+1st and the ith value indicates how many entries row i has in the matrix.
In the above example the matrix has 13 entries as indicated in the first number (12 nodes + 1). After the first, there are 12 numbers, each representing the number of values in each row of the matrix.
## Row Entries ##
```
1 2 3
2 3
```
This block is used to state which entries of the matrix are explicitly represented. Since we know the number of entries per row, (given above), we can do this by stating which columns of each row are represented.
In above example we have a 3x3 matrix, use these numbers in the following manner:
The first row has specified entries in the first, second, and third columns (i.e, entries (1,1), (1,2) and (1,3) are specified ; the second row has an entry specified in the second column entry (i.e., (2,2)); the third row has an entry specified in the third column (i.e. (3,3)).
## Indices into Coefficient List ##
This block contains NCOEF integer pointers to entries to the Coefficient Block (described below.) The actual values of a matrix entry can be repeated many times, particularly in a matrix arising from the discretization of a structured mesh. Because floating point values require more storage than integers, we have set up the following data structure to allow compression:
View the floating point values as two dimensional array of dimensions NUM_WRITTEN_COEFS by NUM_AREA_COEF.
To represent a matrix entry, give the index of value contained in the floating point values block here. If a 0 is given, then the writer of the .stor file has explicitly stated he wants the value to be 0.0.
Following the NCOEF integer pointers are: 1) NEQ+1 0's for padding and 2) a set of NEQ+1 integer pointers stating which pointers correspond to diagonal elements.
## Geometric Area Coefficient Values ##
```
-5.000000000000E-01 -2.500000000000E-01 0.000000000000E+00
```
This block contains NUM_WRITTEN_COEFS x NUM_AREA_COEF floating point values.
NUM_AREA_COEF = 1 The scalar area for each connection a(i=1,k). This is the default.
NUM_AREA_COEF = 3 The vector area for each connection in the order a_x(i=1,k), a_y(i=1,k), a_z(i=1,k).
NUM_AREA_COEF = 4 The vector areas first followed by the scalar area. Note that a(i) = sqrt(a_x^2 + a_y^2 + a_z^2)
Note the negative values because flow is from high to low. The flow (energy/temperature, fluid/Darcy) is governed by the diffusion equation
q = C x grad(P)
The geometric part of the equation is area/distance. The area comes in for figuring out the mass flow given the material properties, gradient, etc. The distance is use in computing grad(P). The negative comes in because the grad(P) vector points from low to high P, but flow is from high to low.
## LaGriT Output ##
In addition to the .stor file, LaGriT writes a summary to the screen and file output. This includes information useful to the modeler such as the min and max voronoi volumes (should be greater or equal to zero), total voronoi volume, and possible negative coupling coefficients which can occur on non-convex boundaries.
```
# use default format for ASCII file with compression
dump/stor/ tet / cmotet
*** Construct and Compress Sparse Matrix:3D ***
*** Compress Area Coefficient Values ***
AMatbld3d_stor: Matrix compress_eps: 0.1000000E-07
AMatbld3d_stor: Local epsilon: 0.1000000E-14
SparseMatrix initialize epsilon to 1.000000e-08
SparseMatrix using Epsilon 1.000000e-08
AMatbld3d_stor: *****Zero Negative Coefficients ******
AMatbld3d_stor: Number of 'zero' (< compress_eps) coefs 0
AMatbld3d_stor: npoints = 12 ncoefs = 52
AMatbld3d_stor: Number of unique coefs = 3
AMatbld3d_stor: Maximum num. connections to a node = 5
AMatbld3d_stor: Volume min = 1.2500000E-01
AMatbld3d_stor: Volume max = 2.5000000E-01
AMatbld3d_stor: Total Volume: 2.0000000E+00
AMatbld3d_stor: abs(Aij/xij) min = 0.0000000E+00
AMatbld3d_stor: abs(Aij/xij) max = 5.0000000E-01
AMatbld3d_stor: (Aij/xij) max = 0.0000000E+00
AMatbld3d_stor: (Aij/xij) min = -5.0000000E-01
AMatbld3d_stor Matrix coefficient values stored as scalar area/distance
AMatbld3d_stor Matrix compression used for graph and coefficient values
ascii STOR file written with name tet.stor
*** SPARSE COEFFICIENT MATRIX _astor SUCCESSFUL ***
3D Matrix Coefficient file written with name tet.stor
```
## Example STOR file compress all, graph and coef (astor) ##
This is the default stor format and will compress values into an ASCII file. (Binary files can only be read on machines they have been written on). This provides the smallest possible file size based on the number of unique coefficient values in the mesh. This example file is summarized in the above output report.
```
fehmstor ascir8i4 LaGriT Sparse Matrix Voronoi Coefficients
Thu Jul 25 14:23:32 20193-D Linear Diffusion Model (matbld3d_astor)
3 12 65 1 5
1.250000000000E-01 2.500000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
2.500000000000E-01 2.500000000000E-01 2.500000000000E-01 1.250000000000E-01 1.250000000000E-01
1.250000000000E-01 1.250000000000E-01
13 17 22 26 30
34 39 44 49 53
57 61 65
1 2 3 4 1
2 7 8 11 1
3 5 8 1 4
5 7 3 4 5
6 5 6 7 8
12 2 4 6 7
9 2 3 6 8
10 7 9 11 12
8 10 11 12 2
9 10 11 6 9
10 12
3 2 2 2 2
3 1 1 2 2
3 2 2 2 3
2 2 2 2 3
2 2 3 1 1
2 1 2 1 3
2 1 2 1 3
2 2 3 2 2
2 3 2 2 2
2 2 3 2 2
2 3 0 0 0
0 0 0 0 0
0 0 0 0 0
14 19 24 28 33
36 43 48 51 55
61 65
-5.000000000000E-01 -2.500000000000E-01 0.000000000000E+00
```
## Example STOR file with no compression (nstor) ##
This is used if you want a file with all values in the matrix written, no compression.
```
fehmstor ascir8i4 LaGriT Sparse Matrix Voronoi Coefficients
08/14 10:23:54 20093-D Linear Diffusion Model (matbld3d_nstor)
46 8 55 1 8
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
9 14 22 27 32
37 42 50 55 1
2 3 5 7 1
2 3 4 5 6
7 8 1 2 3
4 7 2 3 4
7 8 1 2 5
6 7 2 5 6
7 8 1 2 3
4 5 6 7 8
2 4 6 7 8
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
26 27 28 29 30
31 32 33 34 35
36 37 38 39 40
41 42 43 44
46 0 0 0 0
0 0 0 0 0
10 16 25 30 35
40 49 55
0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01 0.000000000000E+00
-2.500000000000E-01 0.000000000000E+00 0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00
-2.500000000000E-01 0.000000000000E+00 0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00
0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01
0.000000000000E+00 0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01 0.000000000000E+00
0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01
0.000000000000E+00 0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00 0.000000000000E+00
-2.500000000000E-01 0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00 0.000000000000E+00
-2.500000000000E-01 0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01
0.000000000000E+00
```
## Example STOR file with coef compression but no graph compression (cstor) ##
```
fehmstor ascir8i4 LaGriT Sparse Matrix Voronoi Coefficients
08/13 15:40:06 20093-D Linear Diffusion Model (matbld3d_cstor)
2 8 55 1 8
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
9 14 22 27 32
37 42 50 55 1
2 3 5 7 1
2 3 4 5 6
7 8 1 2 3
4 7 2 3 4
7 8 1 2 5
6 7 2 5 6
7 8 1 2 3
4 5 6 7 8
2 4 6 7 8
1 2 2 2 1
2 1 1 2 1
2 1 1 2 1
1 2 2 2 2
1 1 2 2 1
1 2 2 2 2
1 1 2 1 1
2 1 2 1 1
2 1 2 2 2
1 0 0 0 0
0 0 0 0 0
10 16 25 30 35
40 49 55
0.000000000000E+00 -2.500000000000E-01
```
## Example STOR file with coef compression off and graph compression on (gstor) ##
```
fehmstor ascir8i4 LaGriT Sparse Matrix Voronoi Coefficients
08/13 15:40:06 20093-D Linear Diffusion Model (matbld3d_gstor)
20 8 41 1 4
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
9 13 17 21 25
29 33 37 41
1 2 3 5 1
2 4 6 1 3
4 7 2 3 4
8 1 5 6 7
2 5 6 8 3
5 7 8 4 6
7 8
1 2 3 4 2
5 6 7 3 8
9 10 6 9 11
12 4 13 14 15
7 14 16 17 10
15 18 19 12 17
19 20 0 0 0
0 0 0 0 0
0
10 15 19 24 27
32 36 41
0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01 -2.500000000000E-01 0.000000000000E+00
-2.500000000000E-01 -2.500000000000E-01 0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01
0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00 -2.500000000000E-01 -2.500000000000E-01
0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00 -2.500000000000E-01 0.000000000000E+00
```
## Example STOR file compress all, graph and coef (astor) ##
This is the default stor format and provides the smallest possible file size based on the number of unique coeficient values in the mesh.
```
fehmstor ascir8i4 LaGriT Sparse Matrix Voronoi Coefficients
08/13 15:40:06 20093-D Linear Diffusion Model (matbld3d_astor)
2 8 41 1 4
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
1.250000000000E-01 1.250000000000E-01 1.250000000000E-01
9 13 17 21 25
29 33 37 41
1 2 3 5 1
2 4 6 1 3
4 7 2 3 4
8 1 5 6 7
2 5 6 8 3
5 7 8 4 6
7 8
2 1 1 1 1
2 1 1 1 2
1 1 1 1 2
1 1 2 1 1
1 1 2 1 1
1 2 1 1 1
1 2 0 0 0
0 0 0 0 0
0
10 15 19 24 27
32 36 41
-2.500000000000E-01 0.000000000000E+00
```

131
docs/pages/docs/accessing.md Executable file
View File

@@ -0,0 +1,131 @@
---
title: Fortran Accessing the Mesh Object
---
# Accessing the Mesh Object using Fortran
LaGriT code is written mostly in Fortran, but also includes C and C++ codes. See the files in src and lg_util for more examples.
The following template is a Fortran code example of using the an existing mesh
object and of creating a new mesh object. The existing mesh object is a
3d object. The object to be created is a 2d object. It is first
necessary to set up the pointer statements for both the existing and new
mesh objects. All these mesh object attributes are integers except
for xic,yix,zic which are real*8.
```
C Definitions for incoming (existing) cmo
pointer (ipimt1, imt1)
pointer (ipitp1, itp1)
pointer (ipicr1, icr1)
pointer (ipisn1, isn1)
integer imt1(1000000), itp1(1000000)
integer icr1(1000000), isn1(1000000)
pointer (ipxic, xic)
pointer (ipyic, yic)
pointer (ipzic, zic)
real*8 xic(1000000), yic(1000000), zic(1000000)
pointer (ipitetclr, itetclr)
pointer (ipitettyp, itettyp)
pointer (ipitetoff, itetoff)
pointer (ipjtetoff, jtetoff)
pointer (ipitet, itet)
pointer (ipjtet, jtet)
integer itetclr(1000000), itettyp(1000000)
integer itetoff(1000000), jtetoff(1000000)
integer itet(4,1000000) , jtet(4,1000000)
C Definitions for cmo that is to be created
pointer (ipimt1a, imt1a)
pointer (ipitp1a, itp1a)
pointer (ipicr1a, icr1a)
pointer (ipisn1a, isn1a)
integer imt1a(1000000), itp1a(1000000)
integer icr1a(1000000), isn1a(1000000)
pointer (ipxica, xica)
pointer (ipyica, yica)
pointer (ipzica, zica)
real*8 xica(1000000), yica(1000000), zica(1000000)
pointer (ipitetclra, itetclra)
pointer (ipitettypa, itettypa)
pointer (ipitetoffa, itetoffa)
pointer (ipjtetoffa, jtetoffa)
pointer (ipiteta, iteta)
pointer (ipjteta, jteta)
integer itetclra(1000000), itettypa(1000000)
integer itetoffa(1000000), jtetoffa(1000000)
integer iteta(3,1000000), jteta(3,1000000)
C Get the existing cmo - its name is in the variable cmoin
call cmo_get_name(cmoin,ier)
C Get the scalar mesh variables
call cmo_get_intinfo('nnodes',cmoin,npoints,lencm,itypcm,ier)
call cmo_get_intinfo('nelements',cmoin,ntets,lencm,itypcm,ier)
call cmo_get_intinfo('ndimensions\_topo',cmoin,ndt,lencm,itypcm,ier)
call cmo_get_intinfo('ndimensions\_geom',cmoin,ndg,lencm,itypcm,ier)
call cmo_get_intinfo('nodes\_per\_element',cmoin,npe,lencm,itypcm,ier)
call cmo_get_intinfo('faces\_per\_element',cmoin,nfpe,lencm,itypcm,ier)
call cmo_get_intinfo('mbndry',cmoin,mbndry,lencm,itypcm,ier)
C Get pointers to the vector variables
call cmo_get_info('ialias',cmoin,ipialias,lenialias,ictype,ier)
call cmo_get_info('imt1',cmoin,ipimt1,lenimt1,ictype,ier)
call cmo_get_info('itp1',cmoin,ipitp1,lenitp1,ictype,ier)
call cmo_get_info('icr1',cmoin,ipicr1,lenicr1,ictype,ier)
call cmo_get_info('isn1',cmoin,ipisn1,lenisn1,ictype,ier)
call cmo_get_info('xic',cmoin,ipxic,lenxic,ictype,ier)
call cmo_get_info('yic',cmoin,ipyic,lenyic,ictype,ier)
call cmo_get_info('zic',cmoin,ipzic,lenzic,ictype,ier)
call cmo_get_info('itetclr',cmoin,ipitetclr,lenitetclr,ictype,ier)
call cmo_get_info('itettyp',cmoin,ipitettyp,lenitettyp,ictype,ier)
call cmo_get_info('itetoff',cmoin,ipitetoff,lenitetoff,ictype,ier)
call cmo_get_info('jtetoff',cmoin,ipjtetoff,lenjtetoff,ictype,ier)
call cmo_get_info('itet',cmoin,ipitet,lenitet,ictype,ier)
call cmo_get_info('jtet',cmoin,ipjtet,lenjtet,icmotype,ier)
C Create the new 2d cmo - call it cmoout.
call cmo_exist(cmoout,ier)
C ier.eq.0 means that the cmo already exists - if so release it.
if(ier.eq.0) call cmo_release(cmoout,idelete)
C Set active cmo to cmoout
call cmo_set_name(cmoout,ier)
C set scalar mesh variables
call cmo_set_intinfo('nnodes',cmoout,npoints,1,1,ier)
call cmo_set\intinfo('nelements',cmoout,ntets,1,1,ier)
C the following scalars need to be set for a 2d cmo
call cmo_set_info('ndimensions_topo',cmoout,2,1,1,ier)
call cmo_set_info('ndimensions_geom',cmoout,3,1,1,ier)
call cmo_set_info('nodes_per_element',cmoout,3,1,1,ier)
call cmo_set_info('faces_per_element',cmoout,3,1,1,ier)
C allocate memory for vector variables
call cmo_newlen(cmoout,ier)
C now get the pointers to the allocated memory for the vector data
call cmo_get_info('imt1',cmoout,ipimt1a,lenimt1a,icmotype,ier)
call cmo_get_info('itp1',cmoout,ipitp1a,lenitp1a,icmotype,ier)
call cmo_get_info('icr1',cmoout,ipicr1a,lenicr1a,icmotype,ier)
call cmo_get_info('isn1',cmoout,ipisn1a,lenisn1a,icmotype,ier)
call cmo_get_info('xic',cmoout,ipxica,lenxica,icmotype,ier)
call cmo_get_info('yic',cmoout,ipyica,lenyica,icmotype,ier)
call cmo_get_info('zic',cmoout,ipzica,lenzica,icmotype,ier)
call cmo_get_info('itetclr',cmoout,ipitetclra,lenclra,icmotype,ier)
call cmo_get_info('itettyp',cmoout,ipitettypa,lentypa,icmotype,ier)
call cmo_get_info('itetoff',cmoout,ipitetoffa,lenoffa,icmotype,ier)
call cmo_get_info('jtetoff',cmoout,ipjtetoffa,lenoffa,icmotype,ier)
call cmo_get_info('itet',cmoout,ipiteta,leniteta,icmotype,ier)
call cmo_get_info('jtet',cmoout,ipjteta,lenjteta,icmotype,ier)
C now the values for the components of the 2d mesh object can be assigned.
```

45
docs/pages/docs/arrcomp.md Executable file
View File

@@ -0,0 +1,45 @@
**Array Compression**
The following utility routines compress arrays. Note that the output
array may be the same as the input array in which case the compression
is done in place. Also the mask array may be the same as the input
array. The name suffixes of the compression routine may be decoded as
**m** minus (negative), **n** non-zero, **p** positive, **z** equal to
zero. If the routine name ends in **rrr**, the mask, input and output
arrays are all real. If the name ends in a single **r** , the mask is
real, the input and output arrays are integers. Otherwise the mask,
input and output arrays are all integers. For example
kmprsn(100, int, 1, int, 1, int, 1, num) will compress all the zeros out of
array int.
:x
n              length of z and x
z               array of masks
iz              stride in z
x               array of source
ix              stride in x
y               array of output
iy              stride in y
count       length of y
**kmprsn(n, z, iz, x, ix, y, iy, count)**
**kmprsnr(n, z, iz, x, ix, y, iy, count)**
**kmprsnrrr(n, z, iz, x, ix, y, iy, count)**
**kmprsp(n, z, iz, x, ix, y, iy, count)**
**kmprspr(n, z, iz, x, ix, y, iy, count)**
**kmprsz(n, z, iz, x, ix, y, iy, count)**
**kmprszr(n, z, iz, x, ix, y, iy, count)**

113
docs/pages/docs/arrsort.md Executable file
View File

@@ -0,0 +1,113 @@
**Array sorting**
The following utility routines sort arrays.
**hpsort1(n, ra, ascend, iprm)**
--------- ---------------------------------------
n number of elements to be sorted
ra  a real array
ascend  real which controls direction of sort
iprm  integer arry to be reordered
--------- ---------------------------------------
**hpsorti(n, ia)**
---- ---------------------------------
n  number of elements to be sorted
ia integer array to be sorted
---- ---------------------------------
**hpsortim(n, m, md, itemp, ia)**
------- --------------------------------------------------------------
n     no. of columns to sort into ascending order
m     maximum number of keys (rows) to consult for comparisons
md      column length of array IA (M&lt;=MD)
itemp     temp array of length MD.
ia     integer array of MD-tuples to be reordered
------- --------------------------------------------------------------
**hpsortimp(n, m, md, ia, ascend, iprm)**
-------- --------------------------------------------------------------------
n no. of elements to be sorted
m we interpret array IA as M-tuples
md actual first dimension of arry IA
ia integer array of values which determine how IPRM will be reordered
ascend real
*8 which controls direction of sort.
iprm integer array to be reordered
-------- --------------------------------------------------------------------
(this routine available but not distributed - contact site manager)
 
**hpsort(n, ra)**
---- ---------------------------------------
n          no. of elements to be sorted
ra          real
*8 array to be sorted
---- ---------------------------------------
**hpsortrmp(n, m, md, a, ascend, iprm)**
-------- -------------------------------------------------------------------------
n no. of elements to be sorted
m array A is treated a M-tuples
md actual first dimension of A
a real
*8 array to be used in ordering  IPRM
ascend real
*8 to control ascending descending sort order (1=ascend, 0=descend)
iprm integer array that will be reordered
-------- -------------------------------------------------------------------------
**hpsortip(n, ia, ascent, iprm)**
-------- ---------------------------------------------------------------------------
n number to sort
ia integer array that determines ho IPRM will be sorted
ascend real
*8 that controls if sort order is ascending or descending (1=ascend)
iprm sorted array of integers 
-------- ---------------------------------------------------------------------------

14
docs/pages/docs/assignmt.md Executable file
View File

@@ -0,0 +1,14 @@
**5. Assign material types to the regions**
Assign materials to regions using
the [**mregion**](commands/MREGION.md) command. This command has
similar syntax to the **[region](commands/REGION.md)** command except
that the interface should not be assigned to any material region. To
assign two materials, *mattop* and *matbot,* to the regions *top* and
*bottom:*
**mregion**/ mattop/ **le** cube **and gt** cutplane /
**mregion**/ matbot/ **le** cube **and lt** cutplane /
<img height="300" width="300" src="https://lanl.github.io/LaGriT/assets/images/Image225.gif">

210
docs/pages/docs/build.md Executable file
View File

@@ -0,0 +1,210 @@
---
Title: "Manual - Building an Executable"
Tags: Manual Building an executable and running LaGriT
---
# Building an executable with LaGriT
------
The executable is built by linking a driver routine with the code and
utility libraries. The driver routine must contain a call to initLaGriT
and a call to control_command_lg and must contain a subroutine called
user_sub. 
The input arguments to initLaGriT are:
**mode** - set to 'noisy' for output to be echoed to the screen - set to
'silent' for no echo
**log_file** - name of log file (if ' ' or '-def-' use default name which
is lagrit.log)  This file will contain a list of commands.
**batch_file** - name of batch file (if ' ' or '-def-' use default name
which is lagrit.out). This file will contain a list of commands and the
error, warning and informational messages generated by the command.
User_sub is used to implement user commands, see [User Commands](writing.md).
A sample Fortran driver routine is listed below (C++ examples are in examples/liblagrit/):
<pre>
program adrivgen
C PURPOSE LaGriT driver
implicit none
integer ierror_return
call initLaGriT('noisy',' ',' ')
call control_command_lg(ierror_return)
stop
end
C Subroutine user_sub
C
C PURPOSE
C Process user supplied commands
C
C INPUT ARGUMENTS
C
C imsgin - integer array of tokens returned by parser
C xmsgin - real array of tokens returned by parser
C cmsgin - character array of tokens returned by parser
C msgtyp - int array of token types returned by parser
C nwds - number of tokens returned by parser
C
C OUTPUT ARGUMENTS
C
C ierr1 - 0 for successful completion - -1 otherwise
subroutine user_sub(imsgin,xmsgin,cmsgin,msgtyp,nwds,ierr1)
character*32 cmsgin(nwds)
integer imsgin(nwds),msgtyp(nwds)
integer nwds,ierr1,lenc
real*8 xmsgin(nwds)
C set default error return to fail
ierr1=-1
C Insert code here to handle user coded subroutines
C For example
if(cmsgin(1).eq.'my_cmnd') then
call my_rtn(imsgin,xmsgin,cmsgin,msgtyp,nwds,ierr1)
else
ierr1=-1
endif
return
end
</pre>
### Sample build scripts
LaGriT can be compiled on most modern machines including Linux, and Mac. WINDOWS is still under development, but pre-cmake versions were successful under Cygwin. LaGriT now uses cmake to build with or without external libraries such as Seacas Exodus.
The most recent instructions can be found on the github pages.
Simple install, build, and test: [LaGriT Github README](https://github.com/lanl/LaGriT/blob/master/README.md)
Build options and instructions for developers: [LaGriT Github cmake README](https://github.com/lanl/LaGriT/blob/master/cmake/README.md)
### Running LaGriT
To execute, use standard unix file redirection for standard input and
output. LaGriT will produce two additional files, lagrit.out and
lagrit.log. The user can change the names of these files by supplying new
names as arguments in the call to initLaGriT before compiling.  These files contain
detailed output information and the list of commands respectively.
LaGriT may also be run interactively in which case the user will be
prompted to enter commands at the machine prompt.
lagrit < lagrit_command_file
### The following are examples to build old releases (pre V3.2) but may be helpful on older machines.
**Sun OS and Sun Solaris forte version 7 compiler:**
f90 -O2 -lf77compat -o LaGriTgen adrivgen.f libLaGriT.a libutil.a
if the user wishes to link in user subroutines that contain CRAY type
pointer statements, these routines must be compiled using the f77
compiler and then the .o files linked in with f90:
f77 -c -O2 user_routines.f
f90 -O2 -lf77compat -o LaGriTgen adrivgen.f user_routines.o
libLaGriT.a libutil.a
older sun compilers:
f90 -O2 -o LaGriTgen adrivgen.f libLaGriT.a libutil.a
**IBM RISC**
xlf -g -o LaGriTgen -qintlog -qcharlen=500 -brename:.fdate,.fdate_
adrivgen.f
libLaGriT.a libutil.a
**SGI**
f90 -O2 -n32 -r10000 -o LaGriTgen adrivgen.f libLaGriT.a libutil.a
Compile for 64 bit I8 SGI:
f90 -O2 -64 -i8 -o LaGriTgen adrivgen.f  libLaGriT.a libutil.
**HP:**
f90 +U77 -R8 -lm -o LaGriTgen adrivgen.f libLaGriT.a libutil.a
**DEC COMPAQ compiler**
fort -i8 -O -fast -pipeline -transform_loops -o LaGriTgen 
adrivgen.f  libLaGriT.a libutil.a
**ABSOFT compiler**:
f90 -YTEXT_NAMES=LCS  -o LaGriTgen adrivgen.f fdate.f libLaGriT.a
libutila. -lm -lu77
where fdate.f is
<pre>
subroutine fdate(string)
character*(*) string
call fdate_(string)
return
end
</pre>
**LINUX**
if ($OSTYPE == 'Linux') then
set OSTAG = _lin
set F77FLAG = "-c -f -m32 -YEXT_NAMES=ASIS"
set F90FLAG = "-m32 -YEXT_NAMES=ASIS"
set LINKFLAG = "-lm -lU77"
set F90DIR = /opt/absoft10.0/bin
else if ($OSTYPE == 'Darwin') then
set OSTAG = _mac
set F77FLAG = "-c -f -N113 -N90 -B19 -q"
set F90FLAG = ""
set LINKFLAG = " -lU77"
set F90DIR = /Applications/Absoft/bin
else if ($OSTYPE == 'SunOS') then
set OSTAG = _sun
source /n/env/local.forte.7
set F77FLAG = -c
set F90FLAG = "-lf77compat "
set LINKFLAG = " "
set F90DIR = /n/local_SunOS/forte7/SUNWspro/bin
else
echo 'OS $OSTYPE not recognized '
exit 1
endif
set FFILES = "lagrit_main.f lagrit_fdate.f"
set OFILES = "lagrit_main.o lagrit_fdate.o"
set binname = lagrit$OSTAG$COPT
set binname_date = lagrit$OSTAG$COPT$DATETAG
set liblagrit = lagrit$OSTAG$COPT.a
set libutil = util$OSTAG$COPT.a
'rm' -f *.o
$F90DIR/f77 $CFLAG $F77FLAG $FFILES
$F90DIR/f90 $CFLAG $F90FLAG -o $binname $OFILES $LAGRIT_LIBS/$liblagrit $UTIL_LIBS/$libutil $LINKFLAG

View File

@@ -0,0 +1,124 @@
# C-FORTRAN Interface
Mesh Objects and their attribute data are accessed through a set of fortran subroutines.
A set of c-fortran wrappers enable C++ codes to create and access a mesh object.
The main drivers and interface is written in Fortran, these are used to parse command lines and create mesh objects. Once setup, the mesh data is passed to Fortran, C, or C++ routines.
As an example of how these c-fortran routines are used, see the poisson files in the LaGriT/src directory.
```
poi_driver.f = poisson command, parsing, data prep for polygon
calls poisson_2d_()
poi_routine_2D.cpp = sets polygon and calls poi_ routines
poi_polygon.cpp and poi_polygon.h = definitions and routines for polygon object
```
## C++ Routines to Access Mesh Object
These files are used for c-fortran codes:
```
lg_c_wrappers.cpp = exposes the raw fortran subroutines to C/C++ codes
wrappers for dotask and cmo_get_info routines
lg_fc_wrappers.f90 = fortran calls for C to get mesh object pointers
assigns mesh data cray pointer to C pointer
lg_c_interface.h = C++ declarations for lg_c_wrappers.cpp
lg_f_interface.h = fortran declarations
fc_mangle.h (name mangling created by cmake with names for c-fortran)
lg_example.cpp = test lg c and fc wrappers
lg_example_fortran.f90 = test various fotran commands used as wrappers
In general:
lg_routines are C++ wrappers calling fortran using C arguments
fc_routines are f90 wrappers calling fortran using c-fortran arguments
```
## C++ Wrappers for Fortran Subroutines
```
LG_ERR lg_cmo_get_name(char* name_buffer, int name_buffer_size);
example:
char cmo_name[32];
err = lg_cmo_get_name(cmo_name, 32);
```
Get the name of the current mesh object. (Only one mesh object is current at any time.)
Note the length of the string must be included as the last argument.
```
LG_ERR lg_dotask(const char* cmd);
example:
const char* cmds[] = {
"cmo/create/tmp_hex/ / /hex",
"createpts/brick/xyz/3,3,3 /1.,2.,3./1.5,2.5,3.5/"};
for (int i = 0; i < sizeof(cmds)/sizeof(cmds[0]); ++i) {
err = lg_dotask(cmds[i]);
}
err = lg_dotask("cmo/status/tmp_hex/");
```
The lg_dotask() routine uses a char buffer to send LaGriT commands for processing. This is similar to calling commands during LaGriT runs.
```
int lg_cmo_get_intinfo(const char* ioption, const char* cmo_name);
example: int nnodes = lg_cmo_get_intinfo("nnodes", cmo_name);
```
Get mesh object attribute, returns the integer value of the named attribute in named mesh object. In this example the number of nodes in a mesh is returned.
```
void lg_cmo_get_int(const char* ioption, const char* cmo_name, long ival);
void lg_cmo_get_vint(const char* ioption, const char* cmo_name, long* ival);
example:
char att1[ ]="imt";
cmolen = strlen(cmo_name);
iattlen = strlen(att1);
fc_cmo_get_vint_(cmo_name,att1,&iptr,&nlen,&ierr,icmolen,iattlen);
printf("return imt nlength: %d\n", nlen);
```
Get a pointer to the scaler or vector array of mesh object attribute of type int. In this example the pointer to the mesh array for "imt" is assigned to iptr, with the length in variable nlen.
## Fortran Wrappers for data pointers
```
void fc_cmo_get_double(const char* cmo, const char* att, double xval, integer ierr);
void fc_cmo_get_vdouble(const char* cmo, const char* att, double** iptr, long* nlen, size_t cmolen, size_t attlen);
example:
icmolen = strlen(mo_poly_name);
iattlen = 4;
fc_cmo_get_double_(mo_poly_name,"xmin",&xmin,&ierr,icmolen,iattlen);
iattlen = 3;
fc_cmo_get_vdouble_(mo_poly_name,"xic",&xptr,&nlen,&ierr,icmolen,iattlen);
```
Get a pointer to the scaler or vector array of mesh object attribute of type double. These examples show the mesh attribute xmin assigned to the variable xmin scalar value and the xptr pointer to the xic attribute with length nlen.
## Rules for C++ calling fortran codes
C++ prototype declarations must be extern "C" (this is not used for C codes)
Must match the Fortran and C++ types, for lagrit integers are 8 bytes
So make sure all are 8 bytes for integer=long, real*8=double
All Fortran arguments are passed as pointers, whether they are input or output values.
Array names such as cmd_buffer are already pointers, so argument is cmd_buffer.
but use & to pass values such as &size
Arrays in C and C++ index starts at 0. In Fortran the index starts at 1.
Fortran matrix element A(3,5) translates to C/C++ matrix element a[4][2].
(Subtract 1 for zero base indexing and reverse the order of the subscripts.)
All arguments are passed as pointers except char string which is an array of characters
A Char string must pass the lenth at end of argument list, this is a hidden value in the fortran call.

28
docs/pages/docs/charlen.md Executable file
View File

@@ -0,0 +1,28 @@
**Character Length**
The following functions are provided to return character string
length (number of characters in iword ignoring terminator
character).
**icharln**(iword)
Get length by searching forward for first blank or
null.
**icharlnf**(iword)
Ignore leading blanks then search for terminating
blank or null.
**icharlnb**(iword)
Search backwards for first non-blank or non-null -
uses FORTRAN function **len** to give starting point (this is a risky
assumption).
**nulltoblank\_lg**(iword, length)
iword is the character string that will be searched for null
characters. All null characters will be replaced by blanks.
length is the number of characters in iword.

96
docs/pages/docs/commandi.md Executable file
View File

@@ -0,0 +1,96 @@
---
Title: "command interface"
Tags: Manual command interface
---
# Command Interface
---
LaGriT runs on the command line as interactive mode or with an input command file. LaGriT will write two output files upon completion, by default they are `lagrit.out` (summary and reports for each command) and `lagrit.log` (saved commands).
Run on the command line with either method:
```
lagrit
lagrit < input_commands.lgi
```
Run the Tutorial and see Example command files at [Tutorials and Examples](../tutorial/index.md)
To get started with the commands, the user must create a mesh object.
The mesh object can be defined by reading in a mesh file, or by creating one.
To create an empty mesh object use the command [**cmo/create**](commands/cmo/cmo_create.md) mesh_name.
There is no limit on the number of Mesh Objects that can be
defined, but at any time there is only one 'current' or 'active' Mesh
Object. For more advanced problems, such as those requiring more than
one Mesh Object or requiring extensions to the basic Mesh Object
template, the Mesh Object(s) is(are) manipulated via the [**cmo**](commands/CMO2.md) commands.
For example, additional user defined attributes may be added to
a Mesh Object by using the [**cmo/addatt**](commands/cmo/cmo_addatt.md) command, or the
'active' Mesh Object can be changed using the [**cmo/select**](commands/cmo/cmo_select.md) command.
This example session reads 2 mesh files into 2 mesh objects mo_tet and cmo_1. The command **cmo/list** reports all mesh objects including the default template and the 2 new mesh objects. The last mesh object created is the current mesh object.
The command **cmo / status / -all- / brief** gives a brief description of each mesh object.
The command **finish** will exit the command line interface. A command file MUST have a **finish** for a clean exit.
The following is an example of the screen output during a session, this will also be recorded in file **lagrit.out**
<pre class="lg-output">
read / avs / tet.inp / mo_tet
read / avs / test_tet_small.inp / cmo_1
cmo / list
The current-mesh-object(CMO) is: cmo_1
0 Mesh Object name: -default-
1 Mesh Object name: mo_tet
2 Mesh Object name: cmo_1
cmo / status / -all- / brief
The current-mesh-object(CMO) is: cmo_1
1 Mesh Object name: mo_tet
number of nodes = 1110 number of elements = 5031
dimensions geometry = 3 element type = tet
dimensions topology = 3 4 nodes 4 faces 6 edges
boundary flag = 16000000 status = inactive
2 Mesh Object name: cmo_1
number of nodes = 5 number of elements = 2
dimensions geometry = 3 element type = tet
dimensions topology = 3 4 nodes 4 faces 6 edges
boundary flag = 16000000 status = active
finish
</pre>
The output file lagrit.out will save the same information you see on the screen while running LaGriT. The output file lagrit.log will save the commands and you can copy this file and possibly edit to run again.
<pre class="lg-output">
% cat lagrit.log
read/avs/tet.inp/mo_tet
read/avs/test_tet_small.inp/cmo_1
cmo/list
cmo/status/-all-/brief
finish
</pre>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,125 @@
---
title: ADDMESH
tags: addmesh merge amr append glue excavate
---
# ADDMESH #
-------------------------------------
This routine joins two meshes together at their common interface to
produce a third mesh. The **merge** and **append** options are commonly used to create a single mesh object from many. This can make refinement based on ojects easier to manage.
Some operations may only work with tet meshes.
NOTE: Care must be taken when using these commands because nothing is
done to clean up the point type (itp) array after the **addmesh**
operation. The user must often use the commands
[**resetpts/itp**](RESETPT.md) and [**filter**](FILTER.md)
## SYNTAX
<pre>
<b>addmesh / add</b> / mesh3 / mesh1 / mesh2 / [refine_factor] / [tet edge]
<b>addmesh / amr</b> / mesh3 / mesh1 / mesh2 /
<b>addmesh / append</b> / mesh3 / mesh1 / mesh2 /
<b>addmesh / delete</b> / mesh3 / mesh1 / mesh2 /
<b>addmesh / glue</b> / mesh3 / mesh1 / mesh2 /
<b>addmesh / intersect</b> / pset_name / mesh1 / mesh2 /
<b>addmesh / match</b> / mesh3 / mesh1 / mesh2 / i1 12 i3 i4 i5 i6/
<b>addmesh / match</b> / mesh3 / mesh1 / mesh2 /rx1 ry1 rz1/rx2 ry2 rz2/rx3 ry3 rz3/rx4 ry4 rz4/rx5 ry5 rz5/rx6/ry6/rz6/
<b>addmesh / merge</b> / mesh3 / mesh1 / mesh2 /
<b>addmesh / pyramid</b> / mesh3 / mesh1 / mesh2 /
<b>addmesh / excavate</b> / mesh3 / mesh1 / mesh2 / [bfs] / [connect] /
</pre>
<br>
**`add`** - Find the intersection of mesh1 and mesh2. Refine mesh1 where
it overlaps mesh2 using the following criteria. `refine_factor`
specifies the number of times that the background mesh will be
refined. If this number is negative, or if it does not appear, then
the it will use the default. The default method determines the number
of refinement iterations based on the volumes of the tets. It
continues to refine until the elements on the interface boundary of
the background mesh object are within a given factor (5.0) of the
volume of the elements on the border of the incoming mesh object. This
factor is a parameter constant called `size_difference` in the code
`continue_refinement.f`. For example, if `size_difference` is set to
5.0, then the background mesh will be refined until the maximum volume
element on the boundary with the incoming mesh object is no bigger
than 5 times the volume of the maximum volume element on the border of
the incoming mesh. refine_type is the type of refinement that is
executed. If the string `tet` appears, then tetrahedral refinement
is performed. Otherwise, `edge` based refinement is performed. After
the above refine steps have been done, the intersection of mesh1 and
mesh2 is found, elements that overlap are deleted from mesh1 and mesh2
is appended to mesh1 to create mesh3.
**`merge`** - Append `mesh2` to to `mesh1` and create `mesh3`. Essentially
this just concatenates two mesh objects.
**`glue`** - Synonym for `merge`.
**`append`** - Append mesh2 to mesh1 and create mesh3. Similar to
`merge` except `imt`, `icr`, `itetclr` of mesh2 have the value
`max(imt(mesh1))` added to mesh2.
**`delete`** - Create mesh3 which is mesh1 with elements that intersect
mesh2 deleted.
**`intersect`** - Create a pset called `pset_name` that contains all
nodes in mesh1 which intersect elements of mesh2.
**`amr`** - Use Adaptive mesh refinement to connect background mesh1
with submesh mesh2 and create mesh3.
**`match`** - Same as `merge` except the second mesh can be moved,
rotated and translated. The first mesh does not move scale or rotate.
If the interface needs to be scaled, translated and rotated that is
accomplished by specifing 3 node numbers in each mesh or 3 node
coordinates from each mesh that are to become coincident. If nodes are
given match `i1-i4`, `i2-i5`, `i3-i6`. If coordinates are given match
`(x1,y1,z1)-(x4,y4,z4)`, etc.
**`pyramid`** - join a hex mesh to a tet mesh. The common surface must
have matching nodes (i.e. there must be exactly two triangle faces on
the tet grid that fit into one quad face of the hex grid). Pyramid
elements will be constructed in the region where the two meshes join.
**`excavate`** - The circumscribed sphere of each triangle of mesh2 is computed and any node in mesh1 that falls inside one of the circumscribed spheres is marked as a dudded node, along with any cells of mesh1 associated with these nodes. mesh1 must be a 3D mesh (of any geometry) and mesh2
must be a 2D triangular mesh. This then excavates an area in mesh1
around mesh2, such that the surface could then be inserted into the 3D
mesh (such as to insert a fault into a background terrain mesh). The
background mesh, minus the excavated/removed nodes, is put into mesh3.
The following options are available:
- `[bfs]` will use a breadth-first search algorithm to find nodes to remove, as opposed to
the default KD-tree algorithm. This will find candidate nodes for deletion within the maximum circumradius of the surface. Then a breadth-first search across the surface will be searched for an element large enough to contain the candidate node.
- `[connect]` after excavation the following commands will be executed: **addmesh/append**
and then **connect**. This will produce a fully connected mesh with the surface
(mesh2) inserted into the background (mesh1).
## Examples
```
addmesh/merge/ moall / moall / mo_fault1
addmesh/merge/ moall / moall / mo_fault2
addmesh/merge/ moall / moall / mo_fault3
cmo/printatt/ moall / itetclr / minmax
cmo/printatt/ moall / imt / minmax
```
In this example, mo_fault1, mo_fault2, and mo_fault3 are all copied into the single mesh object named "moall". The values of itetclr and imt are not changed, so if itetclr values are 1, 2, and 3 respectively - then the itetclr minmax values will be 1 and 3.
As an alternative **addmesh/append** will increment itetclr and imt values based on *mesh2* and *mesh3* values. If all *mesh2* values are 1, the itetclr minmax value at end of calls will be 1 a 3.
Once merged, a mesh can be intersected and refined based on moall instead of multiple calls using mo_fault1, mo_fault2, and mo_fault3.
[Click here for demos](../demos/index.md)

View File

@@ -0,0 +1,44 @@
---
title: ASSIGN
tags: ok
---
# ASSIGN
-------------------
Assign a value to a global variable.  The set of global variables
includes: **incycle**, **ttime**, **monitor**, **hextotet_remove_volume**,
**hextotet_check_imt**, **hextotet_radavg**, **hextotet_remove_duplicates**.
Use **`cmo/setatt`** to assign values to mesh object attributes.
See [Mesh Object Definition](https://lanl.github.io/LaGriT/pages/docs/meshobject.md) for all mesh object variables and attributes.
## SYNTAX
<pre>
<b>assign</b>/category_name/column/variable_name/value.
</pre>
| GLOBALS | DEFAULTS |
| :------------------------| :----------|
| **incycle** | 0 |
| **ttime** | 0 |
| **monitor** | no |
| **hextotet_remove_volume** | yes |
| **hextotet_check_imt** | no |
| **hextotet_radavg** | no |
| **hextotet_remove_duplicates** | no |
## EXAMPLES
```
assign/time / 3.2
assign/hextotet_remove_duplicates / yes
```

View File

@@ -0,0 +1,69 @@
---
title: BOUNDARY
tags: boundary dirichlet
---
# BOUNDARY
-------------------
The boundary routine operates on the current mesh object. For the
nodes lying on the specified surface(s), it sets the specified node
based attribute to the specified value. Optionally boundary will
call the user supplied subroutine `set_user_bounds`.
See [this page](https://lanl.github.io/LaGriT/pages/docs/miscell.md)
## SYNTAX
<pre>
<b>boundary/dirichlet</b>/ attr_name / [ value identifier ] / surface_list
</pre>
**`dirichlet`** is currently unused but must be specified
`attr_name` is the name of the attribute to be set
`value` is a constant, and is the value to which the attribute is set
`identifier` is a character string that will be passed to subroutine `set_user_bounds`
`surface_list` is one of:
* **-all-** (all boundary nodes)
* `surface_name`/**inclusive** (all bndry nodes on surface)
* `surface_name`/**exclusive** (all bndry nodes ONLY on surface)
* `surface_name`/` (same as exclusive)
* `surface_name1` /`surface_name2`/**inclusive** (all bndry nodes on the union of the surfaces)
* `surface_name1`/`surface_name2`/**exclusive** (default) (all bndry nodes ONLY on the intersection of the surfaces)
* `surface_name1`/`surface_name2`/`surface_name3/...` (same as exclusive)
## EXAMPLES:
```
boundary/dirichlet/ vd_v / 7.0/-all-/
```
sets the attribute **vd_v** for all boundary nodes to be 7.0.
```
boundary/dirichlet/vi_s/8.0/pbot/
boundary/dirichlet/vd_v/9.0/pbot/inclusive/
```
sets the attribute **vd_v** for the nodes that are on the surface `pbot` to be 9.0.
```
boundary/dirichlet/vd_s/13.0/pfrt
```
sets the attribute **vd_s** for the nodes that are on the union of the surfaces `pfrt` and `prgt` to 13.0.
```
boundary/dirichlet/vi_t/12.0/prgt/
boundary/dirichlet/bconds/top_plane/s1,s2,s3/
```
will pass the set of nodes on the intersection of surfaces s1,s2, and s3 along with the string top-plane to subroutine `set_user_bounds`.

View File

@@ -0,0 +1,81 @@
---
title: BOUNDARY_COMPONENTS
tags: boundary_components, numbnd, numbnd_e
---
# BOUNDARY_COMPONENTS
----------------------------
Calculate the number of connected components of a mesh. This is
useful for looking for holes in a mesh or as a diagnostic when
looking at a single material (**itetclr**, **imt**) and determining if the
material is contiguous or broken into multiple pieces.
## SYNTAX
<pre>
<b>boundary_components</b>
<b>boundary_components</b> / <b>node</b> / [<b>reset</b> <b>noreset</b>]
<b>boundary_components</b> / <b>node</b> / material_id_number / [<u><b>reset</b></u> <b>noreset</b>]
<b>boundary_components</b> / <b>element</b> / [<b>reset</b> <u><b>noreset</b></u>]
<b>boundary_components</b> / <b>element</b> / material_id_number / [<b>reset</b> <u><b>noreset</b></u>]
</pre>
**`node`** adds node attribute **numbnd** and **id_numb** to which is written a representative node of each outside boundary component.
**`node/connected`** means that a set of nodes of type 'outside' (itp = 10 or
12) can be traversed via element edges that have both vertices of type 'outside'. This method is not really fool proof in detecting holes in a mesh since one can traverse from the exterior of a mesh to an interior hole in the mesh via an edge that is not really a boundary edge. More coding could deal with this situation.
In addition, the number of connected boundary components and a representative node number from each boundary component is assigned
to the **numbnd** array. The number of nodes in each boundary set is printed. Non-boundary nodes are assigned `numbnd = 0`. If the itp
array is not current, it must be updated first, with the command
**`resetpts/itp`**.
By default, **resetpts/itp** is called when the node option is invoked so the **reset**/**noreset** is optional. The node array **id_numb** is similar to **numbnd** in that nodes associate with the same boundary component have the same integer value, however **id_numb** is assigned values starting with 1 and going up to the number of boundary components in sequential order.
**`node`** / `material_id_number` means the distinction of boundary nodes as defined by itp array value is
ignored. Instead, all nodes with **imt** = `material_id_number` are examined and the number of edge connected components is determined
for just that material. Nodes with imt `material_id_number` are assigned **numbnd = 0**.
`element` adds element attribute **numbnd_e** with the element number of a representative element of a connected set.
The number of connected components of the mesh is computed where 'connected' means sets of elements can be traversed via the element faces. The attribute **numbnd_e** is filled with the element number of a representitive element of a connected set. In addition, the number of connected components and a representative element number from each connected component and the number of elements in each connected component set is printed. 
When the `material_id_number` option is invoked, only elements with **tetclr** = `material_id_number`
are examined. Elements with itetclr `material_id_number` are assigned **numbnd_e = 0**.
## EXAMPLES
```
boundary_components
boundary_components / element / 3
```
-----------------------------------
## DEMO for NODE and ELEMENT
<img width="300" src="https://lanl.github.io/LaGriT/assets/images/boundary_component_node.png">
Boundary components **node**
Note that the interior nodes have numbnd=0 and the nodes of the upper hole have the same value as the outside boundary since the upper hole can be reached by traversing an edge that is connected to the exterior.
<img width="300" src="https://lanl.github.io/LaGriT/assets/images/boundary_component_element.png">
Boundary components **element**
Note that the two pieces are have different values for `numbnd_e` even though element 15 is touching element 6. This is because one cannot traverse from the blue mesh (`numbnd_e = 15`) to the red mesh (`numbnd_e = 24`) through faces of the mesh.

179
docs/pages/docs/commands/CMO2.md Executable file
View File

@@ -0,0 +1,179 @@
---
title: CMO
tags: cmo operations options
---
# CMO
--------------------------
These Current Mesh Object commands operate on the selected Mesh Object.
<br>There can be many Mesh Objects in the code for a given problem. Only one
Mesh Object at a time is the Current and Active Mesh Object. (There is also one
Default Mesh Object which is used as the template for generating new
Mesh Objects).
Each Mesh Object is has both default and user added attributes. The following are CMO (Current Mesh Object) options, click to see more details.
| CMO Options &nbsp;&nbsp; | Short Description &nbsp;&nbsp; | Brief Syntax |
| :----------------- | :--------------------------------------------- | :--------------------------------------------------|
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_addatt.html">**`addatt`**</a> &nbsp;&nbsp; | Add an attribute to cmo &nbsp;&nbsp; | **cmo/addatt**/mo/att_name/type/rank/length|
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_addatt.html">**`addatt`**</a> &nbsp;&nbsp; | Create new cmo attributes &nbsp;&nbsp; | **cmo/addatt**/mo/keyword/keyword_options |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_att_derive.html">**`attribute_derive`** </a> &nbsp;&nbsp;| Derive attributes from another cmo | **cmo/attribute_derive**/sink_mo/src_mo |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_att_derive.html">**`attribute_union`** </a> | Combine attributes of two mesh objects | **cmo/attribute_union**/mo_1/mo_2 |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_compress.html">**`compress`** </a> | Compress cmo arrays to actual lengths | **cmo/compress**/mo_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_constraint.html">**`constraint`** </a> | Get surface constraints from cmo to another | **cmo/constraint**/cmo_sink/cmo_src |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_copy.html">**`copy`** </a> | Copy a cmo to new cmo | **cmo/copy**/mo_new/mo_master |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_copyatt.html">**`copyatt`** </a> | Copy attribute values to another attribute | **cmo/copyatt**/mo mosrc/att att_src |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_create.html">**`create`** </a> | Create a new cmo | **cmo/create**/mo_name [/// mesh_type] |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_delatt.html">**`delatt`** </a> | Delete a cmo attribute | **cmo/delatt**/mo_name/att_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_delatt.html">**`DELATT`** </a> | Force Delete a cmo attribute | **cmo/DELATT**/mo_name/att_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_release.html">**`delete`** </a> | Delete an existing cmo | **cmo/delete**/mo_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_derive.html">**`derive`** </a> | Copy cmo to new cmo with empty data | **cmo/derive**/mo_name/master_mo |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_geom.html">**`geometry`** </a> | Give geometry to cmo from another cmo | **cmo/geometry**/mo_name/geometry_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_length.html">**`length`** </a> | Print memory length for cmo attributes | **cmo/length**/mo_name/att_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_list.html">**`list`** </a> | List all mesh objects | **cmo/list** |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_memory.html">**`memory`** </a> | Set length for cmo memory | **cmo/memory**/mo_name/num_nodes/num_elements |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_modatt.html">**`modatt`** </a> | Modify cmo attribute parameters | **cmo/modatt**/mo/att_name/parameter/value |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_move.html">**`move`** </a> | Change the name of a cmo | **cmo/move**/mo_new/mo_old |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_newlen.html">**`newlen`** </a> | Adjust attribute lengths | **cmo/newlen**/mo_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_printatt.html">**`printatt`** </a> | Print attribute values | **cmo/printatt**/mo/att_name/[**minmax**] [1,0,0] |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_readatt.html">**`readatt`** </a> | Read attribute values from file | **cmo/readatt**/mo/att1,att2,[...] /1,0,0/file |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_release.html">**`release`** </a> | Delete an existing mesh object | **cmo/release**/mo_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_select.html">**`select`** </a> | Make cmo current and active | **cmo/select**/mo_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_setatt.html">**`setatt`** </a> | Set values in cmo attributes | **cmo/setatt**/mo/att_name/[1,0,0]/value |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_setid.html">**`set_id`** </a> | Create attribute with id numbers | **cmo/set_id**/mo/**node** or **element**/att_name |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_status.html">**`status`** </a> | Print mesh object status | **cmo/status**/mo_name/ [**brief**] |
|<a href="https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_verify.html">**`verify`** </a> | Verify memory for cmo | **cmo/verify**/mo_name |
## Active CMO
A mesh object is made current or active:
- As a result of any command that generates a new mesh object
- As a result of any command that changes a mesh object (e.g. **copyatt**)
- Use **cmo/select** to explicitly specify the current active mesh object.
## RESERVED NAMES
The following names are reserved and used in the various cmo commands:
**`-default-`** : the default template for the LaGriT mesh object
**`-def-`** : the default value for command options
**`-cmo-`** : the Current Mesh Object
**`-all-`**: all Mesh Objects or Attributes
**`-xyz-`**: Mesh Object Attributes xic, yic, and zic
## CMO Parameters
| Attribute | Possible Values (type character) default in bold |
| :-------------| :--------------------------------------------------|
|`mo_name` | |
|`att_name` | |
|`mesh_type` | **tet**, hex, pri, pyr, tri, triplane, quad, hyb, line, pnt |
|`type` | **VDOUBLE**, VINT, VCHAR, INT, REAL, CHARACTER |
|`rank` | **scalar**, vector, tensor, or any INT attribute |
|`length` | **nnodes** or any INT attribute  |
|`interpolate`&nbsp;&nbsp; | **linear** copy, sequence, log, asinh, max, min, user, and,or,incmax |
|`ioflag` | a g, f, l -- for output of avs, gmv, fehm, LaGriT |
## EXAMPLES
```
cmo/create/motet
cmo/status/motet/ brief
```
Create and print a brief status of the mesh object named motet:
<pre class="lg-output">
The current-mesh-object(CMO) is: motet
2 Mesh Object name: motet
number of nodes = 0 number of elements = 0
dimensions geometry = 3 element type = tet
dimensions topology = 3 4 nodes 4 faces 6 edges
boundary flag = 16000000 status = active
</pre>
```
cmo/addatt/moquad/zsave/VDOUBLE/scalar/nnodes/linear/permanent/gxaf/0.0
cmo/copyatt/moquad moquad/zsave zic
cmo/printatt/moquad/-all- minmax
```
Add the attribute zsave to the mesh object and copy zic attribute values into zsave attribute:
<pre class="lg-output">
ATTRIBUTE NAME MIN MAX DIFFERENCE LENGTH
-def- 0.000000000E+00 0.000000000E+00 0.000000000E+00 14241
scalar 1 1 0 1
vector 3 3 0 1
nnodes 14241 14241 0 1
nedges 0 0 0 1
nfaces 0 0 0 1
nelements 14000 14000 0 1
mbndry 16000000 16000000 0 1
ndimensions_topo 2 2 0 1
ndimensions_geom 3 3 0 1
nodes_per_element 4 4 0 1
edges_per_element 4 4 0 1
faces_per_element 4 4 0 1
isetwd 0 0 0 14241
ialias 0 0 0 14241
imt1 1 1 0 14241
itp1 0 10 10 14241
icr1 0 0 0 14241
isn1 0 0 0 14241
xic 4.980000000E+05 5.005000000E+05 2.500000000E+03 14241
yic 5.370000000E+05 5.405000000E+05 3.500000000E+03 14241
zic 1.638043335E+03 1.856468628E+03 2.184252930E+02 14241
xtetwd 0 0 0 14000
itetclr 1 1 0 14000
itettyp 4 4 0 14000
itetoff 0 55996 55996 14000
jtetoff 0 55996 55996 14000
itet 1 14241 14240 14000x4
jtet 2 16000000 15999998 14000x4
epsilon 1.000000004E-15 1.000000004E-15 0.000000000E+00 1
epsilonl 9.562806528E-10 9.562806528E-10 0.000000000E+00 1
epsilona 4.118418852E-06 4.118418852E-06 0.000000000E+00 1
epsilonv 4.243763815E-04 4.243763815E-04 0.000000000E+00 1
ipointi 1 1 0 1
ipointj 14241 14241 0 1
idebug 0 0 0 1
itypconv_sm 1 1 0 1
maxiter_sm 25 25 0 1
tolconv_sm 1.000000000E+00 1.000000000E+00 0.000000000E+00 1
nnfreq 1 1 0 1
ivoronoi 1 1 0 1
iopt2to2 2 2 0 1
xmin 4.980000000E+05 4.980000000E+05 0.000000000E+00 1
ymin 5.370000000E+05 5.370000000E+05 0.000000000E+00 1
zmin 1.638043335E+03 1.638043335E+03 0.000000000E+00 1
xmax 5.005000000E+05 5.005000000E+05 0.000000000E+00 1
ymax 5.405000000E+05 5.405000000E+05 0.000000000E+00 1
zmax 1.856468628E+03 1.856468628E+03 0.000000000E+00 1
kdtree_level 0 0 0 1
max_number_sets 64 64 0 1
number_of_psets 0 0 0 1
number_of_eltsets 0 0 0 1
number_of_fsets 0 0 0 1
zsave 1.638043335E+03 1.856468628E+03 2.184252930E+02 14241
</pre>

View File

@@ -0,0 +1,41 @@
---
title: COLORMAP
tags: colormap
---
# COLORMAP
----------------------
This command builds the colormap.  In reality it only builds the
material adjacency graph, from with the colormap can be quickly
generated when needed.
## SYNTAX
<pre>
<b>colormap</b>/ [<b>add</b> or <b>create</b> or <b>delete</b>] /[cmo_name]
</pre>
**`add`** -- The material adjacency characteristics of the specified
mesh object is added to the existing material adjacency graph, which
is created if it didn't exist.  This is the default action.
**`create`** -- The existing material adjacency graph is deleted and a
new one created from the specified mesh object.
**`delete`** -- The material adjacency graph is deleted if it exists. 
Any specified mesh object is ignored.
 
## EXAMPLES
```
colormap/create/ mesh1
colormap/mesh2
colormap/delete
```

View File

@@ -0,0 +1,111 @@
---
title: COMPUTE
tags: compute, signed_distance_field, distance_field
---
# COMPUTE
----------------------
This command contains modules that compute various attributes and functions based on one or more mesh objects. This operation will (often) result in new attributes
being added to the mesh objects. The action of the command will be controled by the keyword in the second argument position.
## SYNTAX
<pre>
<b>compute/distance_field</b>/mo_sink/mo_source/distance_field_attribute
<b>compute/signed_distance_field</b>/mo_sink/mo_source/distance_field_attribute
<b>compute/linear_transform</b>/mo_main/mo_surface/[direction/att_name]
</pre>
**`distance_field`** is the keyword for distance field calculation. Determine
the minimum distance from any node in
mo_source to every node in mo_sink and place the result in the
node based floating point attribute,
distance_field_attribute in mo_sink. The computation is
accelerated by using the [kdtree](kdtree.md) search algorithm.
**`signed_distance_field`** is the keyword for signed distance field
calculation. Determine the minimum distance    
from any node in mo_source to every node in mo_sink and place the
result in the node based floating        
point attribute, distance_field_attribute in mo_sink. The
computation is accelerated by using the      
[kdtree](kdtree.md) search algorithm.
This option requires the `mo_source` MUST be either a triangle or quad surface mesh object. If the surfaces form a topologically closed volume then
positive, 'above' distance is in the     direction of the surface normal vector. Negative is 'below' the
surface. If the surface is not a closed     volume, then the assumptions described in the
[surface](SURFACE.md) command are used to determine what is above and what is below the surface.
**`linear_transform`** is the keyword for an extrapolation from an attribute
value in a surface onto every node of a 3D mesh.
Given a 3D mesh and a 2D surface, this command will extrapolate a scalar value from that surface
onto every point of the mesh. This can be used to (for
example):
- Propagate head values from a surface onto all nodes of a
mesh.
- Expand a mesh to fit a surface, by propogating the
appropriate spatial coordinate.
- Compute the depth relative to a topographic surface to each
node of a mesh.
This is highly dependant on the spatial relation between the mesh
and the surface - values from the surface are extrapolated "downward" into the mesh in the direction
specified in the command. The
direction specified in the command must be one of
`zpos, zneg, ypos, yneg, xpos, xneg`
For example,
specifing [zpos] will result in the upper (positive
z-axis) side of the mesh having attribute values conforming exactly
to those on the surface, while the
lower side of the mesh will have whatever attribute values it had
previous, with all nodes in between
having attribute values distributed linearly between the two
extremes. If a direction is not specified,
it will default to zpos. If an
attribute is not specified, it will default to the spatial attribute
appropriate
to the chosen direction (i.e. if the direction is
yneg, the attribute will default to yic, the
y-coordinate of
each node. The attribute chosen must already exist in both the
surface and main meshes.
Other places to look for modules that compute some standard mesh
attributes include, [**QUALITY**](QUALITY.md), which
will compute aspect ratio and volume,
[**cmo/addatt**](cmo/cmo_addatt.md), which will compute normal vectors, dihedral angles, solid
angles, meadian points, Voronoi points and more. User functions can be computed with [**MATH**](MATH.md).
## EXAMPLES
```
cmo / create / cmo_src
createpts/rtz/1,91,1/3.,0.,0./3.,270.,0./1,1,1/
cmo / create / cmo_snk
createpts / xyz / 30 30 1 / -5. -5. -5. / 5. 5. 5. / 1 1 1
compute / distance_field / cmo_snk / cmo_src / dfield
finish
```
<img src="https://lanl.github.io/LaGriT/assets/images/distance_field_01.png" width="300">

View File

@@ -0,0 +1,183 @@
---
title: CONNECT
tags: connect, tet, Delaunay
---
# CONNECT #
-----------------------
Connect the nodes into a Delaunay tetrahedral or triangle grid. The Delaunay criterion requires that the circumsphere (circumcircle) defined by each tetrahedron (triangle) contains no mesh nodes in its interior. If the target simulator is one that uses two-point flux approximation and Voronoi control volumes (FEHM, PFLOTRAN, TOUGH2), use **connect** to create the mesh, then **dump/stor** to compute and output geometric coefficients file.
[Click here for a description of Delaunay](https://en.wikipedia.org/wiki/Delaunay_triangulation)
[Click here for more details on the connect algorithm](https://lanl.github.io/LaGriT/pages/docs/connect_notes.html)
## SYNTAX ##
<pre>
<b>connect</b>/[ <b>delaunay</b>/ ifirst,ilast,istride / big_tet_coordinates ]
<b>connect</b> / <b>noadd</b>
<b>connect</b> / <b>check_interface</b>
</pre>
## OPTIONS
**`delaunay`** is the default algorithm and requires that a "big tet" be constructed that contains all nodes in
its interior. For mesh points with multi-materials (imt with multi-values), connect will detect material interfaces and will look for edges that intersect the interfaces.  connect will add points at these intersections to create a conforming mesh, note that mesh quality may be impacted.  
*`ifirst,ilast,istride`* The user has the option of selecting a subset of nodes to connect.
*`big_tet_coordinates`* The user has the option of providing the coordinates of this "big tet".
**`noadd`** This option will turn off material interface detection.
**`check_interface`** option does a more exhaustive job of making sure there are no edges of the mesh that cross a material boundary.
## USAGE
For 2D and connecting points on a planar surface, the mesh must have **ndimensions_topo**=2 and **ndimensions_geom**=2. This command will create a mesh object with settings appropriate for the connect command.
*Note: the command will fail if you forget the spaced slashes acting a place holders for other options.*
```
cmo/create/ cmotri / / / triplane
```
The connect command does not filter out coincident vertices (sqrt[(xi-xj)<sup>2</sup> + (yi-yj)<sup>2</sup> + (zi-zj)<sup>2</sup>] < epsilon). Use the following commands before connect to remove duplicate points.
```
filter/ 1,0,0
rmpoint/compress
```
For better precision where large coordinate numbers are being used, translate the points close to zero before using connect. The following will move points, connect, then translate back to original position.
```
trans 1,0,0 /XBIG,YBIG,ZBIG/ 0. 0. 0./
connect
trans 1,0,0 / 0. 0. 0./ XBIG,YBIG,ZBIG
```
The connect algorithm creates a triangulation or tetrahedralization of the convex hull. If the domain to be meshed is not convex, there is no guarantee that all of its faces and edges will be within the specified mesh boundary. Connections will be formed across non-convex boundaries.
A convex geometry is not guaranteed. A point distribution over a large region where spacing varies from very small to very large can result in high aspect ratios with small concavities formed on mesh boundaries. You can mitigate the impact by adjusting the mesh resolution. Generally high aspect ratio tets (long dimension along the external boundary) are more of a problem. This means that mesh refinement that brings the mesh closer to unit aspect ratio will help.
The connect command may refuse to add nodes that will result in near
zero-volume tetahedra. The volume tests are based on the mesh object
epsilons. To ensure that these epsilons are based on the geometry,
issue a **setsize** command before **setpts**. Expert users may adjust the epsilons with the **cmo/setatt** command. 
The connect command will report if it is successful, check to see if there are any problems. For instance, connect may finish but may not be able to include all points due to a non-convex boundary or a poor point distribution. For instance:
```
Dudding 7181 points that have no associated tetrahedra.
The mesh is complete but could not include all points.
Number of points that could not be connected: 7181
LaGriT FINISH: connect
```
## EXAMPLES ##
```
connect
```
```
connect/delaunay/
```
These two commands are the same, they create the Delaunay tetrahedral connectivity of all nodes in the mesh. Add nodes to break multi-material connections.
```
cmo / create / mo_tri / / / triplane
createpts / xyz / 4 4 1 / 0. 0. 0. / 1. 1. 0. / 1 1 1
cmo / setatt / mo_tri / imt / 1 0 0 / 1
connect
cmo / setatt / mo_tri / itetclr / 1 0 0 / 1
resetpts / itp
```
Create a triplane mesh object (ndimensions_topo=2 and ndimensions_geom=2) with 4 x 4 points on plane with Z = 0. Connect into triangles and set node and element materials to 1. The resetpts/itp command will define the boundary nodes for this mesh.
```
connect/delaunay/1,0,0/0.,0.,0./1000.,0.,0./500.,1000.,0./500.,500.,10./
connect/1,0,0/ 0.,0.,0./1000.,0.,0./500.,1000.,0./500.,500.,10./noadd
connect/delaunay/1,0,0/ 0.,0.,0./1000.,0.,0./500.,1000.,0./500.,500.,10./noadd
connect/delaunay/1,0,0/0.,0.,0./1000.,0.,0./500.,1000.,0./500.,500.,10./check_interface
```
Create the Delaunay tetrahedral connectivity of all nodes in the mesh and specify explicitly the coordinates of the enclosing tetrahedron.
```
connect /pset, get, mypoints
```
Create the Delaunay tetrahedral connectivity of a subset of nodes with the name mypoints.
```
connect/noadd
```
Create the Delaunay tetrahedral connectivity of  all nodes in the mesh and disregard material interfaces.
```
# create a 2D triangle mesh
cmo / create / mo_tri / / / triplane
# Make some points at the four corners
createpts / xyz / 5 5 1 / 0. 0. 0. / 1. 1. 0. / 1 1 1
# Add some random points and delete duplicate points
createpts / random / xyz / 0.4 / 0.1 0.1 0. / 0.9 0.9 0.
filter / 1 0 0
rmpoint / compress
# set some defaults for the connect routine
cmo / setatt / mo_tri / imt / 1 0 0 / 1
cmo / setatt / mo_tri / itp / 1 0 0 / 0
connect
# set default materials and boundary tags
cmo / setatt / mo_tri / itetclr / 1 0 0 / 1
resetpts / itp
```
Create a simple 2D triangle mesh. Set defaults for material and boundary tags for nice behavior. This starts with points at the corner of a box and fills with random points. The connect command will create the triangulation and the result is a single material mesh with inside/outside boundary points tagged with the itp attribute.
```
connect/check_interface
```
Create the Delaunay tetrahedral connectivity of  all nodes in the
mesh with added checking of edges that have both nodes tagged as
itp='intrface' to be sure that the edge does not cross a material
interface. This option is more expensive but may fix situations
where multi-material edges do not get refined because they connect
an 'intrface' node to an 'intrface' node.
[Click here for 2D demos](../demos/main_2d_connect.md)
[Click here for 3D demos](../demos/main_connect.md)
The **connect** command replaces the LaGriT V1 command **search/delaunay**.

View File

@@ -0,0 +1,41 @@
---
title: COORDSYS
tags: coordsys, coordinate system
---
# COORDSYS
--------------------------
This routine defines a local coordinate system to be in effect until
another coordinate system is defined or the normal coordinate system
is reset. The new coordinate system is defined by specifying an
origin, a point on the new x-z plane and a point on the new z-axis.
These points are specified in the normal coordinate system. The
options available in ioption are:
## SYNTAX
<pre>
<b>coordsys</b>/ <b>define</b> /x0,y0,z0/xx,xy,xz/zx,zy,zz/
<b>coordsys</b>/ ioption
</pre>
**`normal`** return to the normal coordinate system
**`save`** save the current coordinate system for recall
**`restore`** recall the last saved coordinate system
**`define`** define a new local coordinate system
`x0,y0,z0` is the location of the new origin, `xx,xy,xz` is a
point on the new x-z plane and `zx,zy,zz` is a point on the new
z-axis. These points are defined with the normal coordinate system,
and used only with the **`define`** option.

View File

@@ -0,0 +1,92 @@
---
title: COPYPTS
tags: copypts, copy
---
# COPYPTS
---------------------
Copy a point distribution. There are two distinct forms of this
command. The first format is designed to copy points from one mesh
object into another. In this form if the names of the source and
sink mesh objects are omitted, the current mesh object will be used.
The copy may be restricted to a subset of points by including the
source point information. Points in the sink mesh object will be
overwritten if sink\_stride is not zero. Attribute fields may be
specified for both the source and sink mesh object. For example the
x-coordinate field in the source mesh object (xic) may be placed in
the y-coordinate field of the sink mesh object. Attribute values
will be copied from the source mesh object to the sink mesh object.
The user is warned that these values might not make sense in their
new context.
The second form of this command is included for historic reasons: it
duplicates points within a mesh object including all the attributes
of the points. Also note that if no sink points or sink stride are
specified, then the copied points are placed at the end of the data
arrays (see third FORMAT) otherwise the copied points are written
over the existing points starting at the 1st sink point. Note also
that the first form of the command gives the arguments sink first
then source whereas the second form gives the source then the sink.
## SYNTAX
<pre>
<b>copypts</b>/sink_cmo/source_cmo/sink_range/ src_range /source_attribute_name
<b>copypts</b>/sink_cmo/source_cmo/sink_range/ src_range
<b>copypts</b>/ range
</pre>
`sink_cmo` is the name of mesh object to copy points into.
`source_cmo` is the name of mesh object to copy points from.
`range` is the convention using numbers representing ifirst,ilast,istride for a set selection.
The range given as 1,0,0 means all are selected.
## EXAMPLES
```
copypts/3dmesh/2dmesh/
```
Copy all points in 2dmesh to the end of the 3dmesh point list.
```
copypts/3dmesh/2dmesh/0,0/pset,get,mypoints/
```
Copy the point set named mypoints from 2dmesh to the end of
3dmesh point list.
```
copypts/3dmesh/2dmesh/100,4/pset,get,mypoints/boron/arsenic/
```
Copy the arsenic field from the point set named mypoints
from 2dmesh replacing the boron field at every fourth point
beginning at point 100 in 3dmesh.
```
copypts/pset,get,mypoints/0,0/
```
Duplicate the point set named mypoints from the current mesh
object and place the duplicated points at the end of the point
list.
```
copypts/0,0/pset,get,mypoints/
```
Duplicate the point set named mypoints from the current mesh object
and place the duplicated points at the end of the point list. Same
effect as the example directly above. The current mesh object is
used since the fields are blank on the command line.

View File

@@ -0,0 +1,58 @@
---
title: DEFINE
tags: define variable
---
# DEFINE
------------------------------
Allows a value to be associated with a character string, such that
the character string can be used in input decks in place of the 
number. Up to 100 declarations can be defined.
The keyword **remove** in the third argument will remove a
defined variable from the stack of defined variables.
Each instance of the **`define`** command will overwrite the previous assignment.
## SYNTAX
<pre>
<b>define</b> / name / value_real
<b>define</b> / name / value_integer
<b>define</b> / name / value_character
<b>define</b> / name / <b>remove</b>
</pre>
## EXAMPLES
```
define / nx / 3
define / ny / 4
define / nz / 5
define / bottom / 0.1
define / top / 4.0
define / left / 9.8
define / type / reflect
surface/s1/reflect/box/0.0,left,bottom/1.0,right,top
rz/xyz/nx/nz/0.0,left,bottom/1.0,right,top/1,1,1
```
```
define / top / 1.0
define / top / 5.0
surface/s1/reflect/box/0.0,left,bottom/1.0,right,top
rz/xyz/nx/nz/0.0,left,bottom/1.0,right,top/1,1,1
define / nx / remove
define / ny / remove
define / nz / remove
```

View File

@@ -0,0 +1,58 @@
---
title: DEREFINE
tags: derefine, minsize
---
# DEREFINE
---------------------
## SYNTAX
<pre>
<b>derefine/minsize</b>/field/pointtype1 pointtype2/refine_type/first_point/last_point/stride/value
<b>derefine/merge</b> /first_point / second_point
</pre>
This routine derefines a mesh by deleting points using the merge
routine based on one of the following refine\_types. **edge** will
refine if element edge length is less then value. **volume** will
merge if element volume is less than value. The merge routine will
first attempt the smallest element edge then the next smallest, etc.
**aspect** will derefine where aspect ratio is less than value.
**pinchedge** will allow merging of adjacent points across a thin
layer to eliminate the layer where it is too thin. **pinchedge**
should be used only with pointtype1 and pointtype2 both equal to 2.
Two criteria are currently enabled; **minsize** and **merge**.
**minsize** allows merges if the calculation implied by refine\_type
is less than value. **merge** will merge the following first\_point
and second\_point. The field option is not enabled and should be
left default. The user specifies which merges are acceptable by
designating the allowable pointtypes. Nodes with pointtype1 are
merged to nodes of pointtype2. If pointtype1 and pointtype2 are both
equal to 2, the code only merges if the nodes are both on the same
material interface (use **pinchedge** if deleted nodes should be on
different interfaces of the same material). **derefine** will not
merge if an unacceptable element is created. **derefine** will work
on material interfaces if all the children are set with the
**settets** command. Various combinations of **derefine** may be
used to improve the mesh. **recon** may be used to return to a
delaunay mesh after using the **derefine** command.
## EXAMPLES
```
derefine/minsize/0 0/aspect/ 1 0 0/1.e-3
derefine/minsize/0 2/volume/pset,get,apset/5.
derefine/minsize/10 10/edge/1 0 0/5.
derefine/minsize/2 2/pinchedge/1 0 0/1
derefine/merge/21/22
```

View File

@@ -0,0 +1,148 @@
---
title: DOPING
tags: doping, deprecrated
---
# DOPING replaced with [INTERPOLATE](main_interpolate.md)
--------------------
Old command to interpolate between mesh object attributes or assign values to a mesh object attribute.
Note: **`interpolate/map`** replaces the command **`doping/integer1`** which copied source itetclr values
to sink imt values. **`interpolate/voronoi`** replaces **`doping/integer2`** which copied nearest node source imt to sink imt.
**`interpolate/continuous`** evolved from the **`doping/table`** command. The interpolate command has newer updates
to include attribute selections and expanded options.
## SYNTAX
<pre>
<b>doping</b>/constant/field_out/set|add|sub/ ifirst,ilast,istride/value
<b>doping</b>/gaussian/field_out/set|add|sub/ ifirst,ilast,istride/ xyz/x1,y1,z1/x2,y2,z2/lateral_diffusion/ concentration/standard_deviation/
<b>doping</b>/table/field_out/set|add|sub/cmo_ref/attr_ref/[linear|log|asinh]
<b>doping</b>/table/field_out/set|add|sub/cmo_ref/attr_ref/[linear|log|asinh]/ [geom_out/geom_ref]
<b>doping</b>/integer1/imt1/set/ifirst,ilast,istride/cmo_ref /imt1/min|max
<b>doping</b>/integer2/field_out2/set/ifirst,ilast,istride/cmo_ref/attr_ref/min|max|minp|maxp/[create|use]
</pre>
Options **constant** and **gaussian** assign values to a mesh object
attribute.  Options **table**, **integer1**, and **integer2**
interpolate from a reference mesh object.
The **constant** option assigns a constant value to all specified
nodes.
The **gaussian** option creates a very special gaussian distribution
around a line or point.  The bounding box (x1,y1,z1) to (x2,y2,z2)
specifies where the peak concentration will be, Note: y2 is ignored;
if z1=z2 then the distribution will be around a point.  All
coordinates are assumed to be given as Cartesian, **xyz** is
required.  The value assigned to the attribute is determined by the
Gaussian distribution:
value = concentration * exp(-(L/std\_dev) * *2)
where L is the effective distance and can be represented as:
L = sqrt( dy**2 + (1/lateral\_diffusion)*(dx**2 + dz**2) )
and where
dy = y-y1 (y2 ignored) \
dx = x-x1 if x &lt; x1 &lt; x2 \
= 0 if x1 &lt; x &lt; x2 \
= x-x2 if x1 &lt; x2 &lt; x \
dz similar to dx.
The **table** option interpolates an attribute from a reference mesh
object and reference attribute onto the current mesh object using
**linear**, **log** or **asinh** interpolation (the default is
linear).  In the case of 2D tabular interpolation, additional
arguments specify the planar correspondence for the interpolation:
geom\_out and geom\_ref refer to the output and reference
orientation of a 2D axial distribution and may take the values,
**xy, yz, xz**,  .
In all cases, field\_out specifies the name of the attribute,
ifirst, ilast, istride specify a point set restriction, and **set
add or subtract** indicate if the calculated or input-value is added
to, subtracted from or used to set the existing node attribute
value.
If the values to be doped (interpolated) are integers (options
**integer1** and **integer2**), doping works in two ways.  For
integer doping, only the **set** option is implemented.
If the second field is **integer1**, the new nodal attributes are
based on element material types. Set field\_out and attr\_ref to
**imt1** in this case. The **integer1** option is implemented only
for setting node material (**imt1**). The **imt1** values of the
active mesh object nodes will be set by determining which element in
the reference mesh object the node falls in. This element's material
(**itetclr**) value is then assigned to the node **imt1**.
The **integer2** option sets node based attributes in the active
mesh object by determining which voronoi cell in the reference mesh
object the node falls in. Then the value for the node corresponding
to this voronoi cell is copied to the active node.
If the second field is **integer2**, the new nodal attributes are
based on the table attribute types using the Voronoi cells around
the table nodes.
For integer doping, function can be **min** or **max** to choose
what happens if a cmo\_out node falls on a boundary between two
elements or Voronoi cells. For 3d, Voronoi cell based doping,
function can also be **minp** or **maxp** which makes any cmo\_out
nodes that fall outside the cmo\_table geometry set to the maximum
number of materials plus one. Mapset can be set to **create**,
**use**, or left blank. If **create** is used then an idop attribute
is formed that maps the cmo\_table nodes to the cmo\_out nodes. If
**use** is used, doping will read and use this previously formed and
saved mapping. Note that doping of integers should be done without
child/parent relationships. If parents exist, the doping results are
unpredictable at interface boundaries because the value of parent
nodes are unpredictable there.
## EXAMPLES
doping/constant/density/set/pset,get,mypset/9.73
For the current mesh object, the value of the attribute density will be set to 9.73
for all nodes in the point set mypset.
doping/gaussian/density/add/pset,mypset/xyz/0.0,0.5,0.1/0.5,0.5,0.4/0.5/5.0e+18/0.225
For the current mesh object, for nodes in mypset, the value of the
attribute density will be augmented by
the value of the distribution as defined above.
doping/table/my_field/set/1,0,0/cmo_ref/attr_ref/log
For the current mesh object, the value of the attribute my_field will be set by
interpolating from the reference mesh object and attribute.
doping/table/Saturation /set/1,0,0/cmo_course/saturation_course/linear/zx/yx/
In this case the yx plane from the reference cmo is interpolated onto the zx plane of the
current mesh object:
doping/integer1/imt1/set/1,0,0/cmo_old/imt1/min
See which element of cmo_old each node of the current mesh object falls in, and set the imt1 attribute value to the itetclr of the element in cmo_old. If the node falls in more than one element use the smallest itetclr.
doping/integer2/rad2/set/1,0,0/cmo_old/rad1/min/create
Create the voronoi cells around the nodes in cmo_old. See which voronoi cell the nodes in the current mesh object fall in and set the value of the attribute rad2 from the value of the attribute rad1 in the reference mesh object. If there is a conflict use the smallest value. Create a new attribute called idop as explained above.

503
docs/pages/docs/commands/DUMP2.md Executable file
View File

@@ -0,0 +1,503 @@
---
title: "DUMP"
tags: write output files
---
# DUMP
--------------------------------------------
This command produces an output file from a Mesh Object. Some of the standard graphics packages are supported including AVS, GMV, and TECPLOT. See alphabetic list below for descriptions and syntax.
## SYNTAX
<hr>
<pre>
<b>dump</b> / file_type / file_name /[cmo_name]/
<b>dump</b> / file<b>.inp .gmv .lagrit .lg .exo .ts</b> / [cmo_name]/
</pre>
The **`dump`** command is followed by a keyword `file_type` to indicate the type of file to write. 'cmo_name' is the mesh object to write.
<br>
The second line shows the short form where `file_type` is recognized by the file name extension as listed below.
### EXTENSIONS for SHORT SYNTAX
| | | | | |
| :------ | :---------- | :---------- | :---------- | :---------- |
|&nbsp;&nbsp; **AVS** [**.inp** or **.avs**](#avs) |&nbsp;&nbsp; **GMV** [**.gmv**](#gmv) |&nbsp;&nbsp; **Exodusii** [**.exo**](#exodus) |&nbsp;&nbsp; **GoCAD** [**.ts**](#gocad) |&nbsp;&nbsp; **LaGriT** [**.lagrit** or **.lg**](#lagrit) |
### ADDITIONAL FILE TYPES
| | | | |
| :------ | :---------- | :------ | :---------- |
|&nbsp;&nbsp; [**chad**](#chad) &nbsp;&nbsp; |&nbsp;&nbsp; [**coord**](#coord) &nbsp;&nbsp; |&nbsp;&nbsp; [**datex**](#datex) &nbsp;&nbsp; |&nbsp;&nbsp; [**elem_adj_node**](#elem_adj) &nbsp;&nbsp; |
|&nbsp;&nbsp; [**elem_adj_elem**](#elem_adj) &nbsp;&nbsp; |&nbsp;&nbsp; [**fehm**](#fehm) &nbsp;&nbsp; |&nbsp;&nbsp; [**geofest**](#geofest) &nbsp;&nbsp; |&nbsp;&nbsp; [**geom**](#geom) &nbsp;&nbsp; |
|&nbsp;&nbsp; [**pflotran**](#pflotran) &nbsp;&nbsp; |&nbsp;&nbsp; [**recolor**](#recolor) &nbsp;&nbsp; |&nbsp;&nbsp; [**stl**](#stl) &nbsp;&nbsp; |&nbsp;&nbsp; [**stor**](#stor) &nbsp;&nbsp; |
|&nbsp;&nbsp; [**tecplot**](#tecplot) &nbsp;&nbsp; |&nbsp;&nbsp; [**zone**](#zone) &nbsp;&nbsp; |&nbsp;&nbsp; [**zone_imt**](#zone) &nbsp;&nbsp; |&nbsp;&nbsp; [**zone_outside**](#zone) &nbsp;&nbsp; |
<hr>
### **`AVS`** <a name="avs"></a>
<pre>
<b>dump / avs</b> / file_name/ [cmo_name] / [iopt_points, iopt_elements, iopt_node_attributes, iopt_elem_attributes]
</pre>
Will write the AVS UCD (Unstructured Cell Data) file format.
**`avs`** = **`avs2`** writes data values as real or integer depending on type with spacing dependent on size of values.
**`avs1`** = old avs writes all data values as real with large spacing (larger file size).
`iopt values` indicate which data to write or skip, default is everything on with `iopt` values = 1 1 1 1.
For example,
<pre>
<b>dump</b> / avs / file.inp / cmo_name
<b>dump</b> / avs / file.inp / cmo_name / 1, 1, 0, 0
<b>dump</b>/ file_name<b>.inp</b> / cmo_name
</pre>
the first line will write node coordinates, element connectivity, and node and element attributes if they exist. The second line will write node coordinates and element connectivity, but not node attributes or element attributes.
If *`iopt_`* values = 2, or if *`iopt_points`* = 0, then the output will not be a valid AVS UCD format file.
These options are provided to enable a user the flexiblity of writing ASCII files with desired information, and are not intended to be used with **`read/avs`** or other Applications that read AVS UCD files. A WARNING message is given for non-standard AVS output. The following describe valid *`iopt_`* values.
*`iopt_points`* is the first section listing node id and their x y z coordinates.
* = 0 Do not output node coordinate section.
* = 1 Output node coordinate information (node_id x y z)
* = 2 Output node coordinates information without node number in first column ( x y z)
*`iopt_elements`* is the second section listing element id, material, type, node vertices.
* = 0 Do not output element connectivity information
* = 1 Output element connectivity information
* = 3 Output points as AVS pt type for VIS applications. This is only for nodes with 0 elements.
*`iopt_node_attributes`* are the node attributes listing name, type, node_id and values for each.
Note by default the AVS files include the mesh object node attributes imt1, itp1, icr1, and isn1
* = 0 Do not output node attribute information
* = 1 Output node attribute information
* = 2 Output node attribute information without node id in first column
*`iopt_elem_attributes`* are the node attributes listing name, type, element_id and values for each.
* iopt_values_elem = 0 Do not output element attribute information
* iopt_values_elem = 1 Output element attribute information
* iopt_values_elem = 2 Output element attribute information without element id in first column
Note LaGriT Versions V3.30 and older have the following keyword definitions:
<pre>
avs = All numbers written as reals.
att_node = Node Attributes are written as real and integer, header info lines start with #
att_elem = Element Attributes are written as real and integer, header info lines start with #
</pre>
For a description of the AVS file format see the [`read/avs` command](../read_avs.md).
<br>
### **`CHAD`** <a name="chad"></a>
<pre>
<b>dump / chad</b> / file_name /[cmo_name]/
</pre>
Will output a file nodes, faces, and connectivity for tet, hex, pyr, or pri in CHAD format. Writes attributes imt and itp.
<br>
### **`COORD`** <a name="coord"></a>
<pre>
<b>dump / coord</b> / file_name /[cmo_name]/
</pre>
See also **`dump/fehm`**
Will output a single file with node list x,y,z values and element connectivity list in FEHM format. Files are written in FEHM format and are described by [clicking here for details](dump/DUMP3.md).
The coord file is one of a set of files written when the fehm file type is called.
<br>
### **`DATEX`** <a name="datex"></a>
<pre>
<b>dump / datex</b> OR <b>simul</b> / file_name / [cmo_name]
</pre>
will output a file with Geometry, Element, Region, Location, and Dataset in DATEX format.
<br>
### **`ELEM_ADJ_ELEM`** or **`ELEM_ADJ_NODE`** <a name="elem_adj"></a>
<pre>
<b>dump / elem_adj_elem</b> / file_name* / mo_name / [ <b>delatt</b> OR <b>keepatt</b> OR <b>attonly</b> ]
</pre>
* Option: `delatt` - Write adjacency information to an ascii file. Write list of all elements adjacent to each element.
* File format: `elem_number ean_num e1 e2 ... en`
* Option: `keepatt` - write file and add node attribute `ean_num` (number of elements adjacent to each node)
* Option: `attonly` - do not write file, add node attribute `ean_num`, a dummy argument is still required in the file_name field
<pre>
<b>dump / elem_adj_node</b> / file_name / mo_name
</pre>
Write adjacency information to an ascii file. Write list of all elements adjacent to each node. (-99 is a boundary)
File format: `node_number number_of_adjacent_elem e1 e2 ... en`
<br>
### **`EXO`** or **`EXODUSII`** <a name="exodus"></a>
<pre>
<b>dump / exo</b> OR <b>exodusii</b> / file_name / mo_name [ psets ] / [ eltsets] / [ facesets file1 file2 ... filen ]
</pre>
Write a mesh object to a file in the Exodus II format. The keyword psets as token 5 will cause all psets (lists of vertex numbers) associated with the mesh object to be written to the ExodusII output file.
The keyword eltsets as token 6 will cause all eltsets (lists of cell numbers) associated with the mesh object to be written to the ExodusII output file.
If face set information is being provided from files (`file1 file2 ... filen`) the format of the file is written in AVS UCD cell attribute format. The first column is the global cell number, the second column is the local face number.
Click here for [more details on options and files that are written for ExodusII](EXODUS.md).
<br>
### **`FEHM`** <a name="fehm"></a>
<pre>
<b>dump/ fehm</b> / rootname / cmo_name / [ optional keywords ]
</pre>
Write out a series of files for the FEHM flow and transport code. The tokens after the cmo name are all optional.
The following keyword commands are optional and can occur in any order after the cmo name.
* `ascii` or `binary` indicate IO Mode Options for the stor file. Default is ascii.
* `scalar`, `vector`, `both`, `area_scalar`, `area_vector`, or `area_both` are Area Coefficient Options for writing stor file coefficient values. Default is scalar.
* `all`, `graph`, `coefs`, or `none` are Compression Options for the stor file. Default is all.
* `delatt` or `keepatt` deletes or keeps CMO Attributes created to find outside zone nodes. Default is delatt.
* `hybrid` or `nohybrid` Specify whether hybrid median-Voronoi control volumes should be used. Default is nohybrid.
The default options will delete the outside node attributes and will not add attributes for the outside voronoi or median areas.
The stor file will be written in ASCII format with scalar coefficient values with compression of area coefficient list and indices.
The `rootname` will be used to form full names for the files that are written:
```
rootname.fehmn rootname_interface.zone rootname_outside_vor.area
rootname_material.zone rootname_multi_mat.zone rootname_outside.zone rootname.stor
```
* `.fehm` - mesh coordinates and geometry ( see `dump/coord/...` command)
* `_material.zone` - node imt (material) zone lists ( see `dump/zone_imt/...` command)
* `_outside.zone` - node external boundary zone lists (see `dump/zone_outside/...` command)
* `_outside_vor.area` - node external boundary area lists (see `dump/zone_outside/...` command)
* `_interface.zone` - zone lists for nodes along material interfaces
* `_multi_mat.zone` - lists of node pairs connected across material interfaces
* `.stor` - FEHM format file giving the voronoi (control volume) associated with each node and the sparce matrix structure
Click here for [more details on the FEHM files and options.](dump/DUMP3.md)
Click here for the [FEHM style STOR file format.](../STOR_Form.md)
<br>
### **`GEOFEST`** <a name="geofest"></a>
<pre>
<b>dump/ geofest /</b> file_name
</pre>
Write a file to be read by the GeoFEST, Geophysical Finite Element Simulation Tool hosted by Open Channel Foundation. The output file is ascii.
<br>
### **`GEOM`** <a name="geom"></a>
<pre>
<b>dump / geom /</b> file_name
</pre>
will write an ascii file containing the geometry information for the current run. This information includes the region and mregion definitions and surface, names, types and definitions.
<br>
### **`GMV`** <a name="gmv"></a>
<pre>
<b>dump / gmv /</b> file_name / [mo_name] / [<u><b>binary</b></u> or <u><b>ascii</b></u> ]
<b>dump</b>/ file_name<b>.gmv</b> / [mo_name] /
</pre>
Write a file to be read by the graphics program GMV. The defaults are binary and current mesh object.
Use **cmo/setatt//ipolydat/no** to reduce file size. This command will keep the polygon data from being written to GMV files.
For more on GMV visit: http://www.generalmeshviewer.com
<br>
### **`GOCAD`** <a name="gocad"></a>
<pre>
<b>dump / gocad /</b> file_name
</pre>
Write a gocad TSURF file of triangle elements.
<br>
### **`LaGriT`** <a name="lagrit"></a>
<pre>
<b>dump / lagrit /</b> file_name / [cmo_name]/ [binary OR ascii]
</pre>
Write a LaGriT restart file that contains geometry and mesh object information. The geometry belongs to the `cmo_name` with which it was created. The `cmo_name` can be **-all-** in which case all mesh objects are written to the file or it can specify a list of mesh objects to be written. A subsequent read/lagrit command will restart the code at the state at which the **`dump`** command was issued. The default file type is binary.
<br>
### **`PFLOTRAN`** <a name="pflotran"></a>
<pre>
<b>dump / pflotran</b> / file_name_root / cmo_name /
<b>dump / pflotran</b> / file_name_root / cmo_name / nofilter_zero
</pre>
Write coefficient matrix (stor) style values in PFLOTRAN **.uge** format file. The default **`dump/pflotran`** command does not write zero coupling coefficients. Use the keyword nofilter_zero to include zero coupling coefficients in the file.
The following is the format used by PFLOTRAN for **.uge** (explicit unstructured grid) file.
The first block are the list of ids of cells and the coordinates of cell centroids and the volumes of the cells. The PFLOTRAN cells are Voronoi volumes, one for each node.
```
CELLS <integer> integer = # cells (N)
id_1 x_1 y_1 z_1 volume_1
d_2 x_2 y_2 z_2 volume_2
...
...
id_N x_N y_N z_N volume_N
```
The second block consists of a list of ids of the connecting cells (id_up, id_dn),
coordinates of the face centroid between the two connected cells and
areas of the faces.
```
CONNECTIONS <integer> integer = # connections (M)
id_up_1 id_dn_1 x_1 y_1 z_1 area_1
id_up_2 id_dn_2 x_2 y_2 z_2 area_2
...
...
id_up_M id_dn_M x_M y_M z_M area_M
```
<br>
### **`RECOLOR`** <a name="recolor"></a>
<pre>
<b>dump / recolor /</b> file_name
</pre>
This command writes the existing colormap to the specified file. [See colormap command](COLORMAP.md)
<br>
### **`STL`** <a name="stl"></a>
<pre>
<b>dump / stl /</b> file_name
</pre>
Output in STL, stereo lithography format. This is only supported for triangle mesh objects.
See more about the STL format at [dump examples](../demos/description_dump.md)
<br>
### **`STOR`** <a name="stor"></a>
<pre>
<b>dump / stor /</b> file_name_root / cmo_name /
[ascii OR binary ] /
[scalar OR vector OR both OR area_scalar OR area_vector OR area_both] \
[all OR graph OR coefs OR none] / [hybrid OR nohybrid ]
</pre>
Same syntax as **`dump/fehm`** except the only output is the FEHM sparse matrix coefficient STOR file `rootname.stor`.
File can be written in ascii or binary (fortran unformatted platform dependent). The area coefficient values can be written as scalar or vector.
The compression default is **all** which will compress both the list of area coefficients and the indices. The coefs compression, or none compression both use and older algorithm and will result in larger files and may take longer to run.
The stor file is one of a set of files written when the fehm file type is called.
[Click here for further explanation of syntax options.](dump/DUMP3.md)
[Click here for the FEHM style STOR file format.](../STOR_Form.md)
<br>
### **`TECPLOT`** <a name="tecplot"></a>
<pre>
<b>dump / tecplot /</b> file_name
</pre>
Write a file to be read by the Tecplot graphics package. The output file is ascii. Only node attributes are output, element attributes are ignored and not output. Tecplot does not support prism or pyramid element types so they are written as eight node, degenerate hex elements.
The ioflag parameter is used to control if the node attributes are output or not is the AVS ioflag. The expected suffix for the file name is **.plt**. If a name is given without the **.plt** suffix, a suffix ".plt" is added.
Output is ascii. This output format does not support output of a mesh with nodes but zero elements. If there are zero elements, a header is written but node coordinate information is not output.
<br>
### **`ZONE`** <a name="zone"></a>
<pre>
<b>dump / zone /</b> file_name/ [cmo_name] / [delatt OR keepatt] [keepatt_voronoi OR keepatt_median]
</pre>
Write out a set of fehm format zone files for the mesh object nodes. These include zones for mesh materials and the external faces of the mesh as described below. The keepatt option will keep node attributes that tag nodes on external mesh boundaries (see zone_outside).
The delatt option will delete the outside attributes if they exist (the are removed by default). The area attributes for outside nodes can be created with the keepatt_voronoi or keepatt_median options (see zone_outside).
Files are written in FEHM format and are described in the dump/fehm command by [clicking here for details.](dump/DUMP3.md)
---------------
The `file_name` is used to create names for the following 5 files:
* `file_name_material.zone` - node imt (material) zone lists (see `dump/zone_imt/...` command)
* `file_name_outside.zone` - node external boundary zone lists (see `dump/zone_outside/...` command)
* `file_name_outside_vor.area` or file_name_outside_med.area - node external boundary area lists (see `dump/zone_outside/...` command)
* `file_name_interface.zone` - zone lists for nodes along material interfaces, 0 length file if mesh is single material
* `file_name_multi_mat.zone` - lists of node pairs connected across material interfaces, 0 length file if mesh is single material
<pre>
<b>dump / zone_imt /</b> file_name / [cmo_name] / [ imt_value ]
</pre>
will output only one file with name file_name_material.zone.
It is written in FEHM zone format and are described by
[clicking here for details.](dump/DUMP3.md)
`file_name_material.zone` is node list for each integer material (imt) value.
If the optional fifth argument is specified as an integer, then a node list file is written only listing the nodes with the value specified by imt_value.
For options to output PSET's as ZONE/ZONN files see [PSET](PSET.md).
The `zone_imt` file is one of a set of files written when the fehm file type is called.
<pre>
<b>dump / zone_outside</b> OR <b>zone_outside_minmax /</b> file_name /[cmo_name] /
[delatt OR keepatt] [keepatt_voronoi OR keepatt_median]
</pre>
Write fehm zone format files that contain the outside node list and the associated outside area list.
There are two files written:
1. file_name_outside.zone is a node list for each of 6 possible external boundaries.
If keepatt is specified, then 6 node based attributes are added to the mesh object with the names **bottom**, **top**, **right_e**, **back_n**, **front_s**, and **left_w**. A node can occur in multiple zones. For instance, a node located on a top corner of the mesh can be found in zones for top, front_s, and left_w.
* 1 = top = top = positive z direction (0,0,1)
* 2 = bottom = bottom = negative z direction (0,0,-1)
* 3 = left_w = left or west = negative x direction (-1,0,0)
* 4 = front_s = front or south = negative y direction (0,-1,0)
* 5 = right_e = right or east = positive x direction (1,0,0)
* 6 = back_n = back or north = positive y direction (0,1,0)
2. `file_name_outside_vor.area` is a list of Voronoi area vectors `(Ax_i,Ay_i,Az_i)` associated with each external node.
It is written to match the node lists as written in the `outside.zone` file. Along with each outside zone tag (such as top), there is a sum of each vector for that zone. For applications such as infiltration, the z component (each 3rd value) would be used from the top zone list.
```
00001 top Sum VORONOI vectors: 0.5000000E+00 0.5000000E+00 0.5000000E+00
nnum
3
-2.500000000000E-01 -2.500000000000E-01 2.500000000000E-01 2.500000000000E-01 0.000000000000E+00 1.250000000000E-01
0.000000000000E+00 2.500000000000E-01 1.250000000000E-01
```
If the keyword keepatt_voronoi is specified, three node attributes `(xn_varea, yn_varea, zn_varea)` representing the voronoi area are added.
If the keyword keepatt_median is specified, three node attributes `(xn_marea, yn_marea, zn_marea)` representing the median area are added and the file name will be file_name_outside_med.area.
Note that the old version file name file_name_outside.area has area vectors computed with the median strategy.
The option `zone_outside_minmax` is used to find the min and max external node along each row and column of a regular structured grid where the index for i, j, and k can be detirmined. The node attributes `i_index, j_index, and k_index` are created.
<a href="https://lanl.github.io/LaGriT/assets/images/zone_outside.png" target="_blank"> Click here for an image </a> showing difference between the default and the minmax options for outside nodes.
These zone_outside files are part of a set of files written when the zone or fehm file type is called. The fehm zone format and descriptions are in the `dump/fehm` command details.
## EXAMPLES: ##
dump / gmv /file_name.gmv/cmo_name/
dump / gmv /file_name.gmv/cmo_name/ascii
dump / file_name.gmv / cmo_name
dump / tecplot /file_name.plt/cmo_name
dump / lagrit /file_name.lg/-all-/binary
dump/file_name.inp/cmo_name
dump / avs /file_name.inp/cmo_name
dump / avs /file_name.inp/cmo_name/1 0 0 0 (output only node coordinates)
dump / avs /file_name.inp/cmo_name/1 1 0 0 (output node coordinates and element connectivity)
dump / avs /file_name.inp/cmo_name/0 0 0 1 (output element attributes)
dump / avs /file_name.inp/cmo_name/0 0 2 2 (output node and element attributes without node numbers as first column of output)
dump / avs2 /file_name.inp/cmo_name/1 1 1 0 (output node coordinates, element connectivity and node attributes)
dump / fehm /file_root/cmo_name/ (write ascii compressed STOR file and full set of fehm input files)
dump / stor /file_root/cmo_name/ (write ascii compressed STOR file)
dump / stor /file_root/cmo_name/ binary (write unformatted compressed STOR file - platform dependent)
dump / stor /file_name/cmo_name/ascii/area_scalar
dump / zone_outside /file_root/cmo_name/keepatt (write outside node zones and voronoi areas, keep outside attributes)
dump / zone_outside /file_root/cmo_name/keepatt_voronoi (write outside node zones and keep Voronoi area attributes)
dump / zone_outside_minmax /file_root/cmo_name (write outside nodes at minmax extent of each column)
dump / zone /file_root/cmo_name/ delatt keepatt_voronoi (write all FEHM zone and area files, delete the outside attributes and keep the voronoi area attributes)
dump/ exo / file_name / cmo_name
Write generic exodus output without any sets.
dump/ exo / file_name / cmo_name / psets
Write exodus output with point sets only.
dump/ exo / file_name / cmo_name / / eltsets
Write exodus output with element sets only.
dump/ exo / file_name / cmo_name / / / facesets
Write exodus output with face sets only. The facesets are internally calculated and defined. Note that the algorithm is computationally expensive and can take a long time to finish.
dump/ exo / file_name / cmo_name / / / facesets file1,file2,...,filen
Write exodus output with face sets only. The face sets are imported from file1, file2, ..., filen.
dump/ exo / file_name / cmo_name / psets / eltsets / facesets file1,file2,...,filen
Write exodus output with all psets, element sets, and face sets. The face sets are imported from file1, file2, ..., filen.
[Click here for demos](../main_dump.md)

View File

@@ -0,0 +1,43 @@
---
title: DUMP_RECOLOR
tags: dump_recolor
---
# DUMP_RECOLOR
------------------
This command is similar to the regular [dump](DUMP2.md) command except
that the mesh object is recolored before being dumped.  There are two
options specific to this version.  If **restore** is specified  (the
default), the original itetclr and imt1 values are restored, leaving the
mesh object unaltered.  If **norestore** is specified the mesh object is
left recolored (and the original values of itetclr and imt1 lost).  If
**create** is specified (the default) then a new colormap is created and
used to recolor.  Otherwise if **existing** is specified, the existing
colormap is used to recolor the mesh object.  Three dump types are
available:  "**gmv**", "**LaGriT**" and "**avs**". iomode can be
**ascii** or **binary**; **binary** is the default.
## SYNTAX
<pre>
<b>dump_recolor/</b>type/file/mo/[<b>restore</b> or <b>norestore</b>/<b>create</b> or <b>existing</b> /imode
</pre>
## EXAMPLES
```
dump_recolor/gmv/mesh.gmv**/ascii
```
Writes an ascii gmv dump to the fine mesh.gmv.  The mesh object that
is dumped is the current mesh object recolored according to its own
material adjacency.
```
dump_recolor/gmv/mesh.gmv/norestore/existing
```
Recolors the current mesh object using the existing colormap and then
writes a binary gmv dump to the fine mesh.gmv.

View File

@@ -0,0 +1,47 @@
---
title: EDIT
tags: edit
---
# EDIT
-------------------
## SYNTAX
<pre>
<b>edit </b>/ iopt / ifirst,ilast,istride / material_# or name/
<b>edit/ angular </b>/ifirst,ilast,istride /material_# or name/xcen
<b>edit/radial </b>/ifirst,ilast,istride /material_# or name/xcen
<b>edit/ points </b> /ifirst,ilast,istride /material_# or name/array1,array3,array4/
</pre>
Prints an edit of various quantities based on the value of the
option argument, the point limits, and/or a material specification.
iopt specifies what to print as follows:
no value for iopt --edit of sums, averages, and extrema of
position coordinates (x,y,z), and of mesh object attribute fields
**cwo** gives same information as the default, but only for the
two points specified.
**parts** gives a list of materials types, their names, count and
sequence.
**points** lists up to 4 cell-center array values for a set of
points. Possible array values are: xic,yic,zic,or mesh object
attribute name
 
## EXAMPLES
```
edit/ parts/
edit/point /pset,get,mypoints/
```

View File

@@ -0,0 +1,133 @@
---
title: ELTSET
tags: element set eltset
---
# ELTSET (Element Set)
-------------
Associate a name with a element set based on various selection criteria and logical operators. Output element sets.
By convention, *`ifirst,ilast,istride`* syntax represents a set selection defined either by a set of elements from ifirst to ilast, with increments of istride (1 by default). A set selection can also be defined with **eltset,get,** *eset_name* where *eset_name* has been defined by the following **eltset** commands. Most commands with the syntax *ifirst,ilast,istride* can also use **eltset,get,** *elset_name*.
The following are the syntax and parameter definitions, click on options in table or scroll down the page.
| | | |
| :------ | :---------- | :------ |
| [`attribute_name`](#attributename) | [**`delete`**](#delete) | [**`list`**](#list) |
| [**`logicals`**](#logicals) | [**`pset`**](#pset) | [**`region`**](#region) |
| [quality **`volume`**](#volume) | [quality **`aspect`**](#volume) | [**`write`**](#write) |
<hr>
### `attribute_name` <a name="attributename"></a>
<pre>
<b>eltset</b>/eset_name/ attribute_name /<b>eq</b> or <b>ne</b> or <b>lt</b> or <b>gt</b> or <b>le</b> or <b>ge</b> /value/
</pre>
forms an eltset from elements in `attribute_name` that compare to `value`. The comparators are **eq** equal to, **gt** greater than, **lt** less than, **ge** greater than or equal, **le** less than or equal to, **ne** not equal.
### **`delete`** <a name="delete"></a>
<pre>
<b>eltset</b>/eset_name/ <b>delete</b>
</pre>
removes a previously define element set from current mesh object
### **`list`** <a name="list"></a>
<pre>
<b>eltset</b>/eset_name/ <b>list</b>
<b>eltset</b> / / <b>list</b>
</pre>
list all elements in `eset_name`. If the 2nd argument is empty, list all names all of eltsets for the mesh object
### **`logicals`** <a name="logicals"></a>
<pre>
<b>eltset</b>/eset_name/ <b>union</b> <b>inter</b> <b>not</b> / eset_list/
</pre>
logical operations **`union`**, **`inter`** and **`not`** act on previously defined eltsets. The definition of the unary operator **`not`** is extended such that **`not`**/e1/e2 means e1 and (not(e2)).
### **`pset`** <a name="pset"></a>
<pre>
<b>eltset</b>/eset_name/ <b>inclusive</b> or <b>exclusive</b> or <b>face</b> /<b>pset,get</b>, pset_name/
</pre>
forms an eltset from nodes in a pset with name `pset_name`. The following criteria are used to define which elements node set are included. The selection criteria is required.
- **inclusive** all elements any of whose nodes is in pset, if a node is on any element, include it. Generally the largest selection.
- **exclusive** all elements all of whose nodes are in pset, all nodes of an element must be in the set. Generally a smaller selection.
- **face** elements if all nodes of a face are in pset
### **`region`** **`mregion`** <a name="region"></a>
<pre>
<b>eltset</b>/eset_name/ <b>region</b> or <b>mregion</b> / region_name /
</pre>
will return all nodes that are in the specified geometry **region** or material **mregion** given by its `region_name`.
This command calculates the center of mass of the element and determine which **mregion** or **region** the center lies in. It is possible if the interface surfaces are curved that the center will not lie in the same material or geometry region as the vertices. Using values of **itetclr** may give the better result.
### **`volume`** **`aspect`** <a name="volume"></a>
<pre>
<b>eltset</b>/eset_name/ <b>volume</b>/ <b>eq</b> or <b>ne</b> or <b>lt</b> or <b>gt</b> or <b>le</b> or <b>ge</b> /value
<b>eltset</b>/eset_name/ <b>aspect</b>/ <b>eq</b> or <b>ne</b> or <b>lt</b> or <b>gt</b> or <b>le</b> or <b>ge</b> /value
</pre>
forms an eltset based on the quality criteria **volume** or **aspect** ratio. The `value` and comparator detirmines the set selection.
### **`write`** <a name="write"></a>
<pre>
<b>eltset</b>/eset_name or <b>-all-</b> / <b>write</b> /file_name[.cellset]/ <b>ascii</b> or <b>binary</b>
</pre>
write or dump an element list with name `eset_name` to a file, options are **ascii** or **binary**. The argument **-all-** will write all eltsets in the mesh object.
## EXAMPLES
```
eltset/element_set1/itetclr/eq/4
eltset/element_set2/face/pset/get/mypset
eltset/element_set3/inclusive/pset/get/mypset
eltset/element_set4/region/upper
eltset/element_set5/volume/lt/3.0
eltset/element_set5/delete
eltset / / list
```
These are various examples of the eltset command.
```
cmo / select / mo_hex
intersect_elements / mo_hex / mo_wells / if_inter
eltset / e_refine / if_inter / gt / 0
refine/ eltset / eltset,get,e_refine
cmo / setatt / mo_hex / if_inter / 1,0,0 / 0
eltset / e_refine / delete
```
This set of commands will intersect mesh object named mo_hex with mesh object named mo_wells. The attribute **if_inter** is created by **`intersect_elements`** and has a non-zero value for elements intersected by mo_wells. The selected set is refined. It is good practice to clean up if using names and attributes over again. Here we set **if_inter** values to 0 and remove the element set when we are done.

View File

@@ -0,0 +1,286 @@
---
title: dump exo
tags: dump, exo, exodus, sort
---
# DUMP / EXO
-------------------
Write a mesh object to a file in the ExodusII format.
This command can be used to define ExodusII blocks (itetclr), node sets (psets), element sets (eltsets), and side sets (facesets).
The facesets are commonly used to define faces on the external mesh to define boundary conditions.
The command [**`extract/surfmesh`**](dump/EXTRACT_SURFMESH.md) can be used to extract the mesh boundary surface and create the faceset attributes to define in an ExodusII mesh file.
NOTE: ExodusII requires that elements are ordered by their block ID (element itetclr value).
ExodusII routines will automatically sort by these values, so we pre-sort before calling **dump/exo**
so that element and node numbering is consistent with any set definitions.
Both Paraview (sets) and GMV (surfaces) can be used to view ExodusII mesh files with face sets.
See Examples below for more on writing ExodusII files with LaGriT.
## SYNTAX
<pre>
<b>dump/exo</b>/file_name/cmo_name
<b>dump/exodusii</b>/file_name/cmo_name
<b>dump/exo</b>/file_name/cmo_name [<b>psets</b>] / [<b>eltsets</b>] / [<b>facesets</b>] [file1 file2 ... filen ]
</pre>
`file_name` and `cmo_name` are the names of the ExodusII file and mesh object to write.
**`psets`** Dump ExodusII file with vertex sets.
The keyword psets as token 5 will cause all psets (lists of vertex numbers) associated with the mesh object to be written to the ExodusII output file.
**`eltsets`** Dump ExodusII file with element sets.
The keyword eltsets as token 6 will cause all eltsets (lists of cell numbers) associated with the mesh object to be written to the ExodusII output file.
**`facesets`** `file1 file2 ... filen`
If face set information is being provided from files (file1 file2 ... filen) the format of the file is written in AVS UCD cell
attribute format. The first column is the global cell number (**idelem1**), the second column is the local face number (**idface1**).
Listing file facesets avoids automatic facesets generated for all psets and eltsets. Only the facesets in the
files listed in the command will be used to define facesets.
See examples below.
LIMIT ON FILENAMES: If a command line maximum length is 16384 characters, and if the faceset file names have 12 characters (face0001.inp), you can run dump/exo with about 1300 faceset files before running out of command line space.
**`facesets`** `(no file list)` Dump ExodusII file with face sets (ExodusII side sets). If no files are listed, the face sets will be automatically generated. Note facesets will be created for all the nodes in each pset, and for all elements in each eltset. This can generate a large number of facesets.
## EXAMPLES
```
# sort based on cell itetclr id and cell centers
createpts / median
sort / MO_MESH / index / ascending / ikey / itetclr xmed ymed zmed
reorder / MO_MESH / ikey
dump/exo/hex.exo / MO_MESH
```
ExodusII will sort elements by their block ID (element itetclr value), do a pre-sort so element numbering is consistent with the written ExodusII file. This example calls the sort command using the element itetclr values and element median points (xmed, ymed, zmed). The **reorder** command will order the elements based on the **ikey** ordering.
No vertex set, element set or face sets are written for this mesh.
```
dump/exo/ prism_fs.exo / moprism / / / facesets &
fs_001.faceset, fs_002.faceset, fs_003.faceset, fs_004.faceset &
fs_005.faceset, fs_006.faceset, fs_007.faceset
```
Write an ExodusII file for a prism mesh with 7 facesets as defined in 7 AVS attribute files.
```
dump / exo / out_2D_tri_pset_eltset.exo / motri / psets / eltsets /
dump / exo / out_2D_tri_pset.exo / motri / psets / /
dump / exo / out_2D_tri_eltset.exo / motri / / eltsets /
```
This example mesh object has both psets and eltsets defined before the dump command.
The first line writes an ExodusII file with vertex set, element set and no face set.
The second line writes an ExodusII file with vertex set, and no element set and no face set.
The third line writes an ExodusII file with a element set, no vertex set, and no face set.
<hr>
### DEMO EXODUSII WITH FACESET FILES ON BOUNDARY
This Demo includes a full set of input files to create a stacked mesh, define boundary facesets, and write the ExodusII file.
<img src="https://meshing.lanl.gov/proj/examples/stack_fs_from_bndry/mesh_mat_fs5_and_fs8.png" width="250" alt="">
Demo Web Pages: <a href="https://meshing.lanl.gov/proj/examples/stack_fs_from_bndry/method.html">ExodusII face sets from Boundary Polygon </a>
<hr>
### DEMO EXODUSII FACESET FILES ON CUBE
The following creates a cube shaped hex mesh then writes an ExodusII file with top and bottom facesets.
<img src="https://lanl.github.io/LaGriT/pages/docs/demos/output/write_cube_exo_facesets.png" width="200" alt="">
Input LaGriT command file: [write_cube_exo_facesets.lgi](https://lanl.github.io/LaGriT/pages/docs/demos/input/write_cube_exo_facesets.lgi.txt)
The hex mesh is created with **createpts** and assigned 2 materials to the itetclr array. The mesh elements are sorted by the itetclr values and median xmed, ymed, zmed points. This will ensure that element and face numbers are consistent with ExodusII requirements.
After **sort** and **reorder** the mesh boundary faces are extracted into a mesh object using [**`extract/surfmesh`**](https://lanl.github.io/LaGriT/pages/docs/commands/dump/EXTRACT_SURFMESH.md) The surface mesh is subset into regions representing the top, bottom, and side boundaries defined by the 6 normal directions set by command **settets/normal** where **itetclr** is set to 1 (down), 2 (up), 3 (right), 4 (back), 5 (left), and 6 (front).
```
# Get top faces and write faceset file
cmo / copy / mo_tmp / mo_surf
cmo / select / mo_tmp
eltset / e_top / id_side / eq / 2
eltset / e_delete / not / e_top
rmpoint / element / eltset get e_delete
rmpoint / compress
cmo / DELATT / mo_tmp / id_side
dump / avs2 / output_2_top.faceset / mo_tmp / 0 0 0 2
cmo / printatt / mo_tmp / idelem1
cmo / printatt / mo_tmp / idface1
cmo / delete / mo_tmp
```
The **itetclr** values are saved into new attribute **id_side** and are used to select and subset the surface mesh to top faces with the value 2. The faceset file named "output_2_top.faceset" is written.
The format of the AVS faceset file includes the list of element-face relationships written in AVS UCD cell attribute format.
The first column is the global cell number, the second column is the local face number.
Subset the surface into sets such as top and bottom, write faceset files from each set.
```
File output_1_bottom.faceset: File output_2_top.faceset:
0 0 0 2 0 0 0 0 2 0
00002 1 1 00002 1 1
idelem1, integer idelem1, integer
idface1, integer idface1, integer
2 1 1 2
5 1 3 2
7 1 4 2
8 1 6 2
```
These are the first lines of each faceset file for top and bottom showing the AVS format and values written.
```
dump / exo / output_hex_final.exo / mohex / / / facesets &
output_1_bottom.faceset output_2_top.faceset
```
The faceset files can be listed in the **`dump/exo`** command.
Note the ExodusII ID for each set will be in the same order as the file names, ie first file will be given set ID=1, the second will have set ID=2.
The ExodusII file is written as a binary file and can be read by various
visualization software such as GMV and Paraview. For documentation on
the ExodusII API see http://gsjaardema.github.io/seacas/exodusII-new.pdf
The NetCDF utility **ncdump** can be used to convert the binary to ASCII file for checking that all mesh sections are written as expected.
The result is an ExodusII binary mesh with 2 block materials and 2 side sets as reported in the LaGriT output:
<pre class="lg-output">
dump/exo/output_hex_final.exo/mohex///facesets output_1_bottom.faceset output_2_top.faceset
got 1 output_1_bottom.faceset
got 2 output_2_top.faceset
ExodusII: Start writing to file: output_hex_final.exo using cmo: mohex
Exodus FACESETS imported from files. 2
Total read: 4
Current offset: 0
Set tag: 1 nfaces: 4
first: 2 1
last: 8 1
Set new offset: 4
Total read: 8
Current offset: 4
Set tag: 2 nfaces: 4
first: 1 2
last: 6 2
Set new offset: 8
Title: LAGRIT TO EXODUSII
number of dimension: 3
number of nodes: 27
number of elements: 8
number of edges: 0
number of edge blocks: 0
number of element blocks: 2
number of face blocks: 0
number of node sets: 0
number of edge sets: 0
number of element sets: 0
number of side sets: 2
number of face sets: 0
number of node maps: 0
number of edge maps: 0
number of face maps: 0
number of element maps: 0
------------------------------------------
EXPSS loop:
1 Side Set tag: 1 Faces: 4
2 Side Set tag: 2 Faces: 4
------------------------------------------
Done ExodusII Side Sets Total: 2
ExodusII: Done writing to ExodusII file: output_hex_final.exo using cmo: mohex
</pre>
<hr>
### DEMO USING PSETS AND ELTSETS
Input LaGriT command file [write_exo_pset_eltset.lgi](../demos/input/write_exo_pset_eltset.lgi.txt)
This command file is an example for writing **`psets/eltsets`**, both defined in the mesh object before writing the file.
Note all psets and eltsets defined in the mesh object will be written to the ExodusII file.
```
dump/exo/out_2D_tri_pset_eltset.exo/motri/psets/eltsets/
```
<pre class="lg-output">
ExodusII: Start writing to file: out_2D_tri_pset_eltset.exo using cmo: motri
Title: LAGRIT TO EXODUSII
number of dimension: 2
number of nodes: 16
number of elements: 18
number of edges: 0
number of edge blocks: 0
number of element blocks: 3
number of face blocks: 0
number of node sets: 3
number of edge sets: 0
number of element sets: 3
number of side sets: 0
number of face sets: 0
number of node maps: 0
number of edge maps: 0
number of face maps: 0
number of element maps: 0
WRITING EXODUS NODE SETS: 3 sets in total
Nodeset Names Set ID # nodes in set
p1 1 13
p2 2 7
p3 3 11
WRITING EXODUS ELEMENT SETS: 3 sets in total
Elemset Names Set ID # elements in set
e1 1 9
e2 2 3
e3 3 6
ExodusII: Done writing to ExodusII file: out_2D_tri_pset_eltset.exo using cmo: motri
</pre>
Using **ncdump** command, the binary ExodusII file can be converted for viewing the psets (node_ns) and eltsets (elem_els):
```
node_ns1 = 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ;
node_ns2 = 2, 3, 5, 6, 11, 12, 15 ;
node_ns3 = 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 14 ;
elem_els1 = 1, 2, 3, 4, 5, 6, 7, 8, 9 ;
elem_els2 = 10, 11, 12 ;
elem_els3 = 13, 14, 15, 16, 17, 18 ;
```

View File

@@ -0,0 +1,164 @@
---
title: EXTRACT
tags: extract
---
# EXTRACT
--------------
This command produces a 2D mesh object from a 3D mesh object. A
material interface, a plane , an isosurface or a network may be
extracted.
The output mesh object will be oriented such that the outward normal of the
plane that defines the surface will point in the same direction as
the normals for the triangles in the output MO. If the command
extracts on an isosurface, the output MO will be oriented such that
the normals for the triangles point in the direction of increasing
field. If the command extracts on an interface, the output MO
triangles will be oriented the same as the triangles extracted from
region1 of the input MO. In the case of a plane extracted along all
or a portion of a material interface, only those points that lie
inside the material (i.e.: away from the direction of the normal)
will be picked up. If the extraction is on a boundary, the normal to
the extraction plane must point out of the material in order for
points to be picked up.
## SYNTAX
<pre>
<b>extract/ plane /threepts </b>/ x1,y1,z1/x2,y2,z2/x3,y3,z3/1,0,0/cmoout/cmoin
<b>extract/plane/ ptnorm </b>/ x1,y1,z1/xn,yn,zn/1,0,0/cmoout/cmoin
<b>extract/plane/ axes </b>/ xv,yv,zv/1,0,0/cmoout/
<b>extract/plane/ abcd </b>/ a,b,c,d/ 1,0,0/cmoout/cmoin
<b>extract/isosurf </b>/ attribute/value/ 1,0,0/cmoout/cmoin
<b>extract/intrface </b>/ region1/1,0,0/cmoout/cmoin
<b>extract/intrfac2 </b>/ region1/region2/1,0,0/cmoout/cmoin
<b>extract/network </b>/ 1,0,0/cmoout/cmoin
<b>extract/surfmesh </b>/ 1,0,0/cmoout/[cmoin] [<b>external</b>]
</pre>
The following options are available:
- **`plane/threepts/`** plane may be defined by three points in the plane `x1,y1,z1/x2,y2,z2/x3,y3,z3`
- **`plane/ptnorm`**/ plane defined by vector normal to the plane `x1,y1,z1` and `xn,yn,zn`
- **`plane/axes`**/ three points on the axes of the space `xv,yv,zv`
- **`plane/abcd`**/ `a,b,c,d` are the coefficients of the plane equation ax+by+cz=d
- **`isosurf`**/ An isosurface is defined by the value of the surface and the `attribute` to test for this `value`.
- **`intrface`**/ An interface is defined by the material(s) bounding the interface `region1`
- **`intrfac2`**/ `region1` [`region2`] are the material numbers or the material region (mregion) names whose interface is to be extracted. Use `-all-` to extract from all interfaces.
- **`network`** A network is defined as the material interface network from the mesh object. Unlike the other extract forms, this extracts the "parent" interface and not the "child" interface, and ignores boundaries. The output cmo also contains a new attribute "map" which maps nodes in the output cmo to (parent) nodes in the input cmo. This is supposed to work for 2D meshes (tri, quad, or hybrid) in 2D or 3D and 3D meshes (tet, pyr, pri, hex or hybrid).
- **`surfmesh`** extracts the boundary and interface surfaces of a mesh. The keyword `external` will not extract interior interfaces. See full description at [**`extract/surfmesh`**](dump/EXTRACT_SURFMESH.md).
`cmoout` and `cmoin` are the new output mesh object name and source input mesh object name.
`1,0,0` is the range ifirst, ilast, istride selection to work on.
## EXAMPLES
```
extract/plane/threepts/0.,50.,0./1.,50.,0./1.,50.,1./1,0,0/2dmesh/mo_mesh
```
```
define / XVEC / 1.0
define / YVEC / 2.0
define / ZVEC / 3.0
extract /plane /ptnorm/ XP YP ZP / XVEC YVEC ZVEC / 1 0 0 / mo_extract / mo_hex
```
```
extract / isosurf / dfield_1 / 0.0 /1,0,0/ mo_iso1 / mohex
```
## DEMO
cmo/create/3dmesh/
* add an attribute to contain a field for refinement and extraction
cmo/addatt/3dmesh/boron
cmo/modatt/3dmesh/boron/ioflag/gx/
cmo/modatt/3dmesh/boron/interp/linear/
*  simple unit cube divided into 2 region by a horizontal plane
surface/cube/reflect/box/.0,.0,.0/1.,1.,1./
surface/mid/intrface/plane/0.,0.,.5/1.,0.,.5/1.,1.,.5/
region/r1/ le cube and le mid /
mregion/m1/ le cube and lt mid /
region/r2/ le cube and gt mid /
mregion/m2/ le cube and gt mid /
* start out with just a few nodes
createpts/xyz/3,3,3/0.,0.,0./1.,1.,1./1,1,1/
setpts
search
settets
* put some values on the field
doping/gaussian/boron/set/1,0,0/xyz/0.0,0.0,0.0/1.,0.,0./0.5/ &
3.23e+20/0.063/
* use refine to add more detail - note only linear interpolation
* between the few original nodes - one would never really do this
without
* recalculating the field on the finer mesh
refine/maxsize///edge/1,0,0/0.01,0.0,0.0/
recon
refine/constant/boron/linear/edge/1,0,0/1.3+20/
recon
* extract a plane
extract/plane/threepts/0.,0.,0./1.,0.,0./1.,0.,1./1,0,0/2dmesh/3dmesh
pset/p1/geom/xyz/0.,0.,0./.5,.5,.5/
* extract a plane - note pset is ignored!
extract/plane/threepts/0.,0.,0./1.,0.,0./1.,0.,1./pset,get,p1/2dm1/3dmesh
dump/gmv/gmv.3dm/3dmesh/
dump/gmv/gmv.2dm/2dmesh/
dump/gmv/gmv.2d1m/2dm1/
cmo/select/3dmesh
* refine some more
refine/constant/boron/linear/edge/1,0,0/1.3+20/
recon
* now get an isosurface
extract/isosurf/boron/1.0e+20/1,0,0/2dm2/3dmesh
dump/gmv/gmv.2dm2/2dm2
* get the boundary of one region
extract/intrface/m1/1,0,0/2dm3/3dmesh
dump/gmv/gmv.2dm3/2dm3
* get the interface between two regions
extract/intrfac2/m1/m2/1,0,0/2dm4/3dmesh
dump/gmv/gmv.2dm4/2dm4
* try the network option
extract/network/1,0,0/2dm5/3dmesh
dump/gmv/gmv.2dm5/2dm5
* get the surface mesh - note interface plane is included
extract/surfmesh/1,0,0/2dm6/3dmesh
dump/gmv/gmv.2dm6/2dm6
finish

View File

@@ -0,0 +1,84 @@
---
title: FIELD
tags: field
---
# FIELD
----------------------
The FIELD Command option manipulates one or more specified fields in the Current Mesh Object
## SYNTAX
<pre>
<b>field/compose</b>/composition function/ifirst,ilast,istride/field list/
<b>field/mfedraw</b>/root file name/x1,y1,z1/x2,y2,z2/field list/
<b>field/scale</b>/scale option/factor/ifirst,ilast,istride/ field list /
<b>field/volavg</b>/averaging option/iterations/ifirst,ilast,istride/filed list/
</pre>
**`compose`** the field value with the specified composition function for all points in the specified point set. The composition functions allowed are currently **asinh** and **log**. So, for example, if 'i' is in the point set and **asinh** is the composition function, we have the assignment:
```
field(i) = asinh(field(i))
```
**`mfedraw`** causes a binary dump of the
specified fields to two files in the **mfedraw** input format.
**mfedraw** is a graphics package for visualizing moving piecewise
linear functions of two variables, such as those originally
encountered in Moving Finite Elements. The files are named
'root1.bin' and 'root2.bin', where 'root' is the root file name
argument. Because the graphics data are a function of two variables,
you must supply two orthonormal vectors (x1,y1,z1) and (x2,y2,z2)
which specify the graphics coordinate axes. More precisely, given 3D
coordinates (x,y,z), the 2D graphic coordinates will then be
(x
*x1+y
*y1+z
*z1 , x
*x2+y
*y2+z
*z2). So, for example, the
choice:
/x1,y1,z1/x2,y2,z2/ = /1.,0.,0./0.,1.,0./
causes the 'z' coordinate to be discarded while the 'x' and 'y'
coordinates are unchanged.
**`scale`** option scales the field values of the
specified points. scale option can take on the values **normalize**,
**multiply**, and **divide**. If **normalize** is specified, we
multiply all the field values by **factor**/(fieldmax-fieldmin),
where 'fieldmax' and 'fieldmin' are the maximum and minimum values
taken over the point set. This has the effect of normalizing the
field so that the new difference between the maximum and minimum
values is equal to **factor**. If **multiply** is specified, we
multiply all the field values in the point set by **factor**. If
**divide** is specified, we divide all the field values in the point
set by **factor.**
**`volavg`** option, for all the members of the point
set and for all specified fields, replaces the point field values
with values that represent the average of the field(s) over the
control volumes associated with the points. The averaging option
specifies what kind of control volume is to be used; the choices are
**voronoi** and **median**. iterations is an integer that specifies
a repeat count for how many times this procedure is to be performed
on the field(s). The affect of this process is to broaden and smooth
the features of the field(s), similar to the effect of a diffusion
process. The **voronoi** choice, unlike the **median**. choice,
produces a diffusive effect independent of mesh connectivity.
However, again unlike the **median**. choice, it requires that the
mesh be Delaunay, or incorrect results will occur.
## EXAMPLES
```
field/compose/asinh/1,0,0/field/scale/normalize/4.field/volavg/voronoi/4/1
```

View File

@@ -0,0 +1,156 @@
---
title: FILTER
tags: filter, filterkd, filter element
---
# FILTERKD
# FILTER
# FILTER/ELEMENT
----------------------------
This command is used to filter (mark for deletion) a set of nodes
that are geometricly close, within the tolerance value. This command
changes the node type of the deleted nodes to type 'dudded' (itp=21)
but does not remove them from the point list. There must be least
one point must be specified in the point range in order for this
command to work properly.
Dudded nodes are not removed from the mesh object, but are ignored
by many routines because of their dudded status. Use the command [rmpoint/compress](RMPOINT.md) to
remove dudded nodes and update the mesh object.
If the mesh object has connected elements, the itet values in the
connectivity array are adjusted. This may change topology. To filter
duplicate elements or flat elements, see **filter/element** or
**filterkd** with the **zero\_element** option.
**FORMAT**:
**filterkd**/ ifirst,ilast,istride/ [tolerance] / [**nocheck** OR **zero\_element**]
**filter**/ ifirst,ilast,istride / [tolerance] / [ **min OR max** ] / attribute]
*This version of filter is being replaced with the kd-tree search
algorithm used in filterkd that more accurately identifies nodes
within the tolerance value.*
iirst,ilast,istride defines the node set where 1,0,0 are all nodes
in the mesh object.
[tolerance]
This is the epsilon value used to measure node
distances. If this value is not included, the mesh object epsilon
value is used.
**nocheck**
This is the default for **filterkd** and will skip the code
that removes zero elements. The behavior is similar to original
**filter** except a kdtree structure is used instead of a binning
method for finding nodes within epsilon value. This version has
been shown to be more accurate where precision matters.
**zero\_element**
This option is available with **filterkd** where
a mesh has connected elements. The algorithm removes flat elements
as using the tolerence value as mininum edge length. Duplicate
nodes not associated with these flat elements are not removed.
**minmax** / attribute
This option is available with the **filter**
command. Nodes for deletion are detected based on the standard
geometric criteria however, the choice about which node is
retained is determined based on comparison of the attribute values
and the node with either the ** min** or ** max** value is retained.
**filter**/[element]/[search\_range]/ [**nodelete** OR **delete**]
Search a mesh object for duplicate elements. A duplicate element
is defined as having the exact same set of nodes in the element
connectivity list (itet). The order of the nodes in the
connectivity does not matter. The element with the larger itetclr
value (master) wi ll be kept. The duplicate element will have its
material color (itetclr) changed to max(itetclr) + 1. Two new
element attributes (iclr1, iclr2) are added to the mesh object to
keep track of the correspondence of
master(retained)/duplicate(removed) elements and their original
material id (itetclr).  The option **nodelete**is the default and
elements are not removed. Use option **delete** to remove the
elements marked as duplicate. ]{style="font-family: times;"
The search\_range can be set by the user. This number limits the
number of elements above and below an element (in numerical order)
to search. The default is 10.
For more on **filter/element** see [filter/element
details.](FILTER_element.md)
 **EXAMPLES:**
**filterkd**/1,0,0
**filter**/1,0,0
Filter all nodes and delete duplicates with tolerance distance set
to mesh object epsilon value. Both filter and filterkd behave the
same but filterkd performs with better precision.
**filterkd** / 1 0 0 / 1.e-3
Filter all nodes and delete duplicates where epsilon tolerance is
set by user to 1.e-3.
**filterkd** / [pset] / get_point\_set
Filter a subset of the nodes and delete duplicates with epsilon
tolerance set automaticly.
**filterkd** / 1 0 0 / 1.e-3 / **zero\_element**
Identify and remove all flat elements with edge length less than
1.e-3 as defined by user.
**filter** / 1 0 0 / / min / imt
Filter all nodes and delete duplicates with epsilon tolerance set
automaticly. When duplicate nodes are detected the imt attribute is
examined and the node with minimum imt value is retained.
**filter** / [element]/ [nodelete]
Filter elements and set itetclr of duplicates to max(itetclr) + 1.
Assign values to iclr1 and iclr2 arrays.
**filter** / [element] / 1e20 / [delete]
Filter all elements (assuming there are less than 1e20)  with an
exhaustive search and delete duplicate elements. Assign values to
iclr1 and iclr2 arrays.

View File

@@ -0,0 +1,233 @@
---
title: FILTER/ELEMENT
tags: filter element
---
# FILTER/ELEMENT
--------------------
## SYNTAX
<pre>
<b>filter</b>/[ <b>element</b>]/[search_range]/[<b>nodelete</b>|[<b>delete</b>]
</pre>
Search a mesh object for duplicate elements. A duplicate element is
defined as having the exact same set of nodes in the element
connectivity list (itet). The order of the nodes in the connectivity
does not matter. The element with the larger itetclr value (master)
will be kept. The duplicate element will have its material color
(itetclr) changed to max(itetclr) + 1. Two new element attributes
(iclr1, iclr2) are added to the mesh object to keep track of the
correspondence of master(retained)/duplicate(removed) elements and
their original material id (itetclr). 
For all elements the values of iclr1 are set their original itetclr
values.
For any element that is neither master nor duplicate, the value of icr2
is set to its itetclr value.
For an element that is a master, icrl2 is set to the original itetclr
value of its duplicate.
For an element that is a duplicate, icrl2 is set to the original itetclr
value of its master.
For example, consider the 4 element mesh, where element 2 and 3 are:
Element 1,2 itetclr = 1
Element 3,4 itetclr = 2
then after:
[filter]{style="font-weight: bold;"/[element]/10/[nodelete]                              
Maximum material id max(itetclr)          =         
2                         
Duplicate Elements will be set to itetclr =         
3                         
search\_range                              =        
10                         
nelements searched                        =         
4                         
Number of duplicate element found         =         
1                         
cmo/printatt/cmohex1/itetclr/1 0
0                                             
Attribute:
itetclr                                                             
         1         
1                                                          
         2         
3                                                          
         3         
2                                                          
         4         
2                                                          
cmo/printatt/cmohex1/iclr1/1 0
0                                               
Attribute:
iclr1                                                               
         1         
1                                                          
         2         
1                                                          
         3         
2                                                          
         4         
2                                                          
cmo/printatt/cmohex1/iclr2/1 0
0                                               
Attribute:
iclr2                                                               
         1         
1                                                          
         2         
2                                                          
         3         
1                                                          
         4         
2                                                          
All elements are tested. The search for each element's duplicate
does not occur over the entire element list. The default for
search\_range is 10 and results in looking at the 10 elements in the
element list sequentially above and 10 elements sequentially below
the test element.  In the example given below the elements are
sorted so that elements that are physically close to each other will
be close to each other in the element list.
The [search\_range] can be set by
the user. Setting [search\_range]
to a number larger than the number of elements will cause all
elements to be searched.
The algorithm will only detect one duplicate element per element. If
there are more than two elements with the same connectivity, they
can be found by calling **filter/element** multiple times.
The default behavior is to not delete the duplicate elements. 
However the duplicate elements will be deleted from the mesh if the
parameter [delete] is specified.
In general if you are merging together two meshes and then want to
delete duplicate elements the commands might be:
* Merge two mesh objects
**addmesh **/ merge / cmohex / cmohex1 / cmohex2
* Create an attribute with the median x,y,z coordinate of each
element
[createpts] / [median]
* Sort and reorder the elements based
on the median points. This will insure that elements that occupy
the
* same location will have element numbers near one another.
[sort] / -def- /
[index] /
[ascending] / ikey / xmed ymed zmed
[reorder] / -def- /ikey
* Filter and remove duplicate nodes.
[filter] / 1 0 0
[rmpoint] / [compress]
* Filter and remove duplicate
elements.
[filter] /
[element] /
[delete]
 **EXAMPLES:**
**filter** / [element]
Filter all elements and set itetclr of duplicates to max(itetclr) + 1.
Assign values to iclr1 and iclr2 arrays.
**filter** / [element] / [nodelete]
Filter elements and set itetclr of duplicates to max(itetclr) + 1.
Assign values to iclr1 and iclr2 arrays.
**filter** / [element]/ [delete]
Filter elements and delete duplicate elements. Assign values to iclr1
and iclr2 arrays.
**filter** / [element] / 1e20 / [delete]
Filter all elements (assuming there are less than 1e20)  with an
exhaustive search and delete duplicate elements. Assign values to
iclr1 and iclr2 arrays.

View File

@@ -0,0 +1,16 @@
---
title: "FINISH"
tags: finish, exit
---
# FINISH
Terminate processing this command stream and return to the driver routine.
This is a requirement so LaGriT can exit gracefully.
## SYNTAX
```
finish
```

View File

@@ -0,0 +1,42 @@
---
title: FSET
tags: fset
---
# FSET
---------------
This command  is used to  define a  set  of element faces. Defining
face sets can be useful for either defining boundary conditions,
material interfaces, or surface subsets for further mesh processing.
## SYNTAX
<pre>
<b>fset</b> / name / pset, get, pointsetname
</pre>
`name` must be an integer or
character string. Currently, only 32 named face sets may exist.
However, any number of integer-numbered face sets (up to the total
number of faces in the problem) may be defined.
Face sets may be used in all of the usual ways that eltsets and psets may be used.
NOTE: Not all modules support use of **fset.**
## EXAMPLES
```
fset / fname / pset,get, psetname
```
```
cmo/setatt/3dmesh/fluid_structure /fset,get,blue/
```
where fluid_structure is the name of a face set attribute

View File

@@ -0,0 +1,138 @@
---
title: GENIEE
tags: geniee, connectivity
---
# GENIEE
-----------------
Generate the element the connectivity list (jtet array).
The **jtet** attribute contains for each facet of an element the
neighboring element and its local face.  For 3D grids the jtet
relationship is reflexsive; each element-face pair has exactly one
neighboring element-face pair.  For 2D grids the jtet relationship
can include cycles; a triangle or quad edge may have many edge
neighbors.  In this case the jtet is constructed as a closed cycle
where the jtet of one element-edge pair will be a neighboring
element-edge pair whose jtet wil be another neighboring element-edge
pair and so on until all neighbors are included in the cycle exactly
once.
The **jtet** is constructed by looking at matching node numbers and will
use the parent nodes if they exist.  Faces with matching node
coordinates but different node numbers will not be matched.
For hybrid grids that contain degenerate elements there are two
options.  If the mesh object attribute **jtet_reduce_nnd** exists and
is set to 1, then faces with repeated node numbers will be matched
to faces with the same numbers but not repeated.  For example if a
degenerate hex has a face 1 1 2 3 and there is an element (prism,
tet, pyramid) with face 1 2 3 and if **jtet_reduce_nnd** is 1, then
these faces will be matched.  Otherwise they will be marked as
external boundary faces.
## SYNTAX
<pre>
<b>geniee</b>
<b>geniee</b> / mo_name / <b>2dnormal</b> / reference_element_number / [ <b>addatt</b> ]
</pre>
**`geniee`** with no arguments will generate element the connectivity list (jtet) that gives neighbor
information. Element connectivity is maintained within LaGriT, but can also be generated by the user with this command.
`mo_name` is the mesh object to operate on. Can be / / or /-def-/
**`2dnormal`** Check or change the topological orientation (itet array) of a triangle, quad, or hybrid tri/quad mesh consistent so that shared edges are traversed in opposite directions. This is only possible in a mesh with **jtet_loop_max** = 2. For networks with **jtet_loop_max** &gt; 2 there may not be a configuration that meets the goal.
`reference_element_number` - Default value is 1. This is the element number that will be the reference element that
all other elements are compared to. If this parameter is a negative number, the orientation of element number
abs(`reference_element_number`) is reversed and then used as the reference. `reference_element_number` = 0 will check and report if orientation is consistent, but will not do any flipping.
For example this command will check and report orientation without making any changes:
geniee / -def- / 2dnormal / 0
This command can be used to flip the normals of a mesh that is already consistent. For example:
geniee / -def- / 2dnormal / -1
**addatt** is optional keyword that will create two new arrays ipath and ifflip to the mesh object.
ipath - The order in which elements are visited.
ifflip - 0 if the element orientation was NOT changed, 1 if the element orientation was changed.
Note the ifflip array will not make sense for jtet loops greater than 2 for which there is no single solution.
Note: For the case where a mesh is not completely edge connected,
this module will detect that all elements have not been tested and
will warn the user and suggest a command line syntax to test
elements not visited.
Note: Code not set up for a mesh with parent/child chains. When
check is made, it compares child points. When permutation of
elements is done, only itet and jtet arrays are updated.
## EXAMPLES
geniee / cmo / 2dnormal
Check orientation of tri/quad elements and if their orientation is
different than element 1, then flip their orientation.
geniee / cmo/2dnormal/-1
Flip the orientation of element one and then make the rest of the
mesh consistent with element 1. If the mesh object is already
consistent, then this command will reverse the orientation of all
the elements in a surface (tri, quad) mesh.
geniee / -def- / 2dnormal / 17
Check orientation of tri/quad elements and if their orientation is
different than element 17, then flip their orientation.
geniee / cmo / 2dnormal / 0
Check orientation of tri/quad elements and if their orientation is
different than element 1, report the difference but do not change
the mesh object orientation.
geniee / cmo / 2dnormal / 0 / addatt
Check orientation of tri/quad elements and if their orientation is
different than element 1, report the difference but do not change
the mesh object orientation. Create two new attributes:
ipath is the search path the algorithm followed through the mesh.
ifflip reports the orientation of each element as compared to element 1.
## Testing Topology or watertightness for Multi-Materials
For a single material watertight mesh, there will be no boundaries, that is **geniee** will report no more than 2 jtet loops. If you run **boundary_components** the result will show "0 different exterior boundary components". For a watertight mesh, each edge needs to appear in (at least) two facets, but can appear in more than two. For instance if a surface is extracted on a 2 material mesh, the material boundary faces will also be extracted. These boundary faces will share an edge with outside faces so that 3 faces share a single edge. **geniee** will report as shown in this example with 4 boundary edges and no more than 3 faces sharing an edge:
geniee: mesh has 4 jtet loops, max cycle length = 3
The basic test is to compute a face graph of the mesh. We visit all cells and look across the face and ask if I look across face i of cell J what is the cell m and face n on the other side. If the answer is, nothing is on the other side the face is labeled as 'boundary'. The tests are not geometric, they are topological. The test is on the cell connectivity list. That is if cell a has edge i,j then we are looking in the connectivity list for a cell with edge j,i (or i,j). In general in a 'good' mesh we expect the shared edge to be traversed in the opposite direction. However, in the multi-material models where 3 (or more) triangles share an edge, we cannot expect the edges to be traversed in opposite directions.

View File

@@ -0,0 +1,75 @@
---
title: GRID2GRID
tags: grid2grid, hextotet, amr
---
# GRID2GRID
-------------------
The **grid2grid** command converts a mesh with one element
type to a mesh with another. The conversion type is determined by the
second argument.
NOTE: Use of **grid2grid** to convert a 3D mesh to a tetrahedral mesh will in general result in a non-Delaunay tetrahedral mesh. If the target simulator is one that uses two-point flux approximation and Voronoi control volumes (FEHM, PFLOTRAN, TOUGH2) then using **hextotet** and then **dump/stor** to compute and output geometric coefficients, is not a good idea. If the ultimate goal is a a geometric coefficients file, one should use **connect** to connect vertices into a Delaunay mesh.
Note: Use of **grid2grid** to convert an octree refined hexahedral into to a tetrahedral mesh should not be done. You will get a result, however, no special algorithms are implemented to connect across interfaces where octree resolution changes and hanging nodes occur. One should instead copy the octree vertex set into a tet mesh object and use **connect** to create a tetrahedral mesh.
## SYNTAX
<pre>
<b>grid2grid</b> / ioption / [ cmo_sink ] / [ cmo_source ]
</pre>
## OPTIONS
`ioption`: is a character string that determines the element type of the
source and sink meshes. There is no 'default' option - this argument
must be specified.
* **quadtotri2**   quad to 2 triangles, no new points.
* **prismtotet3**   prism to 3 tets, no new points.
* **quattotri4**   quad to 4 triangles, with one new point.
* **pyrtotet4**   pyramid to 4 tets, with one new point.
* **hextotet5**   hex to 5 tets, no new points.
* **hextotet6**   hex to 6 tets, no new points.
* **prismtotet14**   prism to 14 tets, four new points (1 + 3 faces).
* **prismtotet18**   prism to 18 tets, six new points (1 + 5 faces).
* **hextotet24**   hex to 24 tets, seven new points (1 + 6 faces).
* **tree_to_fe**   quadtree or octree grid to grid with no parent-type elements to clean amr or octree structures.
`[ cmo_snk / cmo_src ]` are the mesh_object names for the new mesh to create and the source mesh object. `cmo_src` is the original grid. `cmo_snk` is the name for the new tet or triangle grid. These may be the same grid, if so desired. If both are left blank, the current mesh object will be used. If only one mesh name
is given, it will be used at the sink mesh, and the current mesh object will be used as the source.
## EXAMPLES
```
grid2grid / hextotet24 /  cmo_tet / cmo_hex
```
Convert each hex element in cmo_hex to 24 tets and name the new grid cmo_tet.
```
grid2grid / quadtotri4 /  new_mesh
```
No source mesh is given, so the current mesh object (which is a quad
mesh) will have every quad converted into 4 triangles, and saved as new_mesh.
```
grid2grid / tree_to_fe / new_mesh /  octree_mesh
```
Parent elements in octree_mesh will be removed, so only the leaf elements remain. The result will be stored in new_mesh.
This is often used to ensure a single valid mesh for other commands or for use outside of LaGriT.
The octree attributes itetpar, itetkid, and itetlev will be updated in the new_mesh.
A description of the octree mesh and attributes are described in the command
<a href="https://lanl.github.io/LaGriT/pages/docs/commands/REFINE.html">**`refine`**</a>

View File

@@ -0,0 +1,25 @@
---
title: help
tags: help
---
# HELP
------------
## SYNTAX
<pre>
<b>help</b>/ variable_name
</pre>
**`help`**/ `code_variable` will return the variable definition and the
correct value of the variable.
## EXAMPLES
```
help/ipointi
```

View File

@@ -0,0 +1,112 @@
---
title: HEXTOTET
tags: hex to tet connect
---
# HEXTOTET #
--------
This command, while still recognized, has a newer more readable syntax, see [grid2grid](GRID2GRID.md) instead.
The **`hextotet`** command creates a tetrahedral grid from 3D grids, and triangles from 2D.
The first parameter *ioption* determines how the conversion is performed.
NOTE: Use of **hextotet** (or **grid2grid**) to convert a 3D mesh to a tetrahedral mesh will in general result in a non-Delaunay tetrahedral mesh. If the target simulator is one that uses two-point flux approximation and Voronoi control volumes (FEHM, PFLOTRAN, TOUGH2) then using **hextotet** and then **dump/stor** to compute and output geometric coefficients, is not a good idea. If the ultimate goal is a a geometric coefficients file, one should use **connect** to connect vertices into a Delaunay mesh.
Note: Use of **hextotet** to convert an octree refined hexahedral into to a tetrahedral mesh should not be done. You will get a result, however, no special algorithms are implemented to connect across interfaces where octree resolution changes and hanging nodes occur. One should instead copy the octree vertex set into a tet mesh object and use **connect** to create a tetrahedral mesh.
## SYNTAX
<pre>
<b>hextotet</b> / [ ioption ] / cmo_snk / cmo_src / [ <b>rmvolume</b>]
</pre>
## OPTIONS
*`ioption`* is a numerical number indicating the number of tets or
triangles to break each element into. If this parameter is missing then
default settings are used. The defaults are underlined and will be
detirmined by reading the mesh_type of the mesh_object. If mesh_type
is quad, **2** is used. If mesh_type is prism, **3** is used. If
mesh_type is hex, **6** is used. Otherwise **24** is the default value
for ioption.
The selections include:
**2**   quad to 2 triangles, no new points.
**3**   prism to 3 tets, no new points.
**4**   quad to 4 triangles, with one new point.
**4**   pyramid to 4 tets, with one new point.
**5**   hex to 5 tets, no new points.
**6**   hex to 6 tets, no new points.
**14**   prism to 14 tets, four new points (1 + 3 faces).
**18**   prism to 18 tets, six new points (1 + 5 faces).
**24**   hex to 24 tets, seven new points (1 + 6 faces).
*`cmo_snk / cmo_src`* : are the mesh_object names. cmo_src is the
original grid. cmo_snk is the name for the new tet or triangle grid.
**`rmvolume`** : keyword is optional and will assign
hextotet_remove_volume and hextotet_remove_duplicates to 'yes'. This
will enable hextotet to use its own algorithm for removing elements with
zero volume and duplicate points. It may be prone to epsilon errors for
grids over large areas. By default, zero volumes and duplicate points
are not removed from the new mesh object cmo_snk.
## EXAMPLES
<pre>
hextotet / 24 / cmo_tet / cmo_hex
</pre>
Convert each hex element in cmo_hex to 24 tets and name the new grid cmo_tet.
<pre>
hextotet / / cmo_tri / cmo_quad
</pre>
No value is given for ioption, so the default settings are used. The
mesh_type of cmo_quad is quad, so each element is converted to two
triangles. The new mesh_object is named cmo_tri.
<pre>
hextotet / 3 / cmo_tet / cmo_pri / rmvolume
</pre>
Each prism element in cmo\_pri is converted to three tet elements.
Zero volume elements and duplicate points are removed. The new tet
mesh object is called cmo\_tet.
<pre>
cmo/addatt/mohex/imtsav/VINT/scalar/nnodes/linear/
cmo copyatt / mohex mohex / imtsav imt
cmo/addatt/mohex/itetsav/VINT/scalar/nelements/linear/
cmo copyatt / mohex mohex / itetsav itetclr
cmo setatt mohex imt 1
cmo setatt mohex itetclr 1
resetpts itp
hextotet / 5 / motet / mohex /
</pre>
*CAUTION If mesh is multi-material this can add signifigant time to the hextotet routine!* This example shows a good practice which will avoid this issue. The attributes *`imtsav`* and *`itetsav`* are created and values copied before setting the mesh materials in itetclr and imt to 1. The command **resetpts/itp** will reset boundary and interface accordingly. This mesh mohex has each hex element converted into 5 tets each. The number of nodes will not change.
LINKS:
[Click here for demos](../demos/main_hextet.md)

View File

@@ -0,0 +1,91 @@
---
title: INPUT INFILE
tags: infile input command
---
# INPUT or INFILE
These commands instruct LaGriT to begin processing commands from a file. The **`infile`** commands may be nested. Each file  set of commands MUST be terminated with a **finish** command.
This works well with the **`define`** commands for multiple calls to the same command file.
## SYNTAX
<pre>
<b>infile</b> / file_name
<b>input</b> / file_name
</pre>
## EXAMPLES
```
loop / do / NL 1 10 1 / loop_end &
infile lagrit.input_refine_smooth
```
Use **loop** command to run 10 iterations commands to smooth using file "lagrit.input_refine_smooth":
<pre class="lg-output">
pset / psmooth / geom / xyz / 1 0 0 / -3. -3. -3. / 3. 3. 3.
recon / 0
smooth / position / esug / pset get psmooth
finish
</pre>
```
* Well R-60
define NORDER 149
define WELLID 4600001
define SCREENID 4811
define MO_WELL mo
define XC 495828.64
define YC 539043.30
define RTOP 1797.76
define RBOT 1791.39
define WLEN 6.37
define R0 0.0
define R1 56.0
define NRAYS 8
define NRADIAL 4
define R_RATIO 2.0
define WELLAVS 149_4600001_cyl.inp
infile build_1well.mlgi
```
Set variables and build a cylinder well using commands in file "build_1well.mlgi":
<pre class="lg-output">
cmo / create / MO_WELL / / / tet
createpts/brick/rtz/NRADIAL,NRAYS,2/0. 0. 0. /R1,360.,WLEN/ &
1,1,1/1 0 0/ R_RATIO 1.0 1.0
cmo/addatt/MO_WELL/wellid/VINT/scalar/nnodes//permanent/agfx/0
cmo/addatt/MO_WELL/screen/VINT/scalar/nnodes//permanent/agfx/0
cmo/addatt/MO_WELL/topbot/VINT/scalar/nnodes//permanent/agfx/0
cmo/setatt/MO_WELL/wellid WELLID
cmo/setatt/MO_WELL/screen SCREENID
cmo/setatt/MO_WELL/imt1 NORDER
cmo/setatt/MO_WELL/itetclr 1
cmo select MO_WELL
filter / 1 0 0
rmpoint / compress
resetpts / itp
cmo select MO_WELL
pset/pbot/attribute zic/1,0,0/ eq 0.
cmo setatt MO_WELL topbot 1
cmo setatt MO_WELL topbot pset,get,pbot -1
trans/1,0,0/ 0. 0. 0./XC YC RBOT
dump avs WELLAVS MO_WELL
cmo printatt MO_WELL imt minmax
cmo printatt MO_WELL topbot minmax
cmo printatt MO_WELL -xyz- minmax
finish
</pre>

View File

@@ -0,0 +1,40 @@
---
title: INTERSECT
tags: intersect
---
# INTERSECT
-------------------
Creates a new Mesh Object from the intersection of two existing Mesh
Objects. The existing Mesh Objects have to be topologically 2D and
geometrically 3D. The created Mesh Object will be topologically 1D
and geometrically 3D.
## SYNTAX
<pre>
<b>intersect</b>/cmo_out/cmo_1_in/cmo_2_in
</pre>
`cmo_out` is the new mesh object.
Node quantities for the new Mesh Object will
be created by interpolation on the corresponding node quantities of
the first input Mesh Object `cmo_1_in` from the second mesh object `cmo_2_in`.
This command will also apply the **line_graph** option of the
**`sort`** command on the new Mesh Object. This will sort the elements
(which will be line segments) into a reasonable order based on their
connectivity, and will also create element attributes **ctype, cid, loop_id.
**`intersect`** will create a temporary sort key and use
that to reorder the elements, so there is no need to use your own
sort key. For more details on the sorting and on the created element
attributes, please see [sort](SORT.md).

25
docs/pages/docs/commands/LOG.md Executable file
View File

@@ -0,0 +1,25 @@
---
title: LOG
tags: log
---
# LOG
---------------------
Turn the batch output file and tty output file **off** and **on**.
The tty prints to and reads from the user's screen. The batch file
is the output file called outx3dgen. Default is **on** for both
files.
## SYNTAX
```
<b>log</b> / <b>ba</b> or <b>ty</b> / <b>on</b> or <b>off</b>
```
## EXAMPLES
```
log/ty/off
```

View File

@@ -0,0 +1,201 @@
---
title: MASSAGE
tags: massage, agd3d, sgd, recon, cel_chain
---
# MASSAGE
-----------------
**`MASSAGE`** creates, annihilates, and moves nodes and swaps
connections in a 2D or 3D mesh in order to improve element aspect
ratios and establish user-desired edge lengths.
Specifically, **`MASSAGE`** performs up to four iterations of a loop
which calls AGD3D (a routine for automated merging of nodes), RECON (a
routine for automated reconnection of edges), and SGD (a routine for
element aspect ratio improvement using smoothing). **`MASSAGE`** then
calls CEL_CHAIN which performs Rivara edge refinement and then
another call to RECON.  In the case of 2-D surface grids, this is then
followed by a call to CER_CHAIN which is another edge refinement
routine and then a final call to RECON if necessary.
AGD3D will attempt to merge edges that are shorter than `merge_length`. 
CEL_CHAIN will attempt to bisect edges that are longer than `bisection_length` . 
For 2D surfaces, CER_CHAIN will attempt to bisect edges that deviate from an
averaged surface normal ("have a roughness of") greater than
`tolroughness`.
RECON will attempt to create 'nice' elements by using face swapping. The LaGriT command **`MODE/RECON`**
can alter the meaning of 'nice'.  The default is to reconnect to restore the delaunay criterion. 
Calling **MODE** / **RECON/GEOM** prior to the **MASSAGE** call will create 'plumper' elements. 
SGD will attempt to improve element aspect ratios by moving nodes.
Note:  Since CEL_CHAIN is called only once at the end of **`MASSAGE`**,
it may be necessary to call **`MASSAGE`** twice for optimal results. 
This is because annihilation of nodes is done with an intent to
improve element aspect ratios, but cannot be effective if there are
too few nodes initially.
Note: The user may wish to call **`RMPOINT/COMPRESS`** after
**`MASSAGE`** operations that merge a significant number of nodes.
## SYNTAX
<pre>
<b>massage</b>/bisection_length/merge_length/toldamage/[[tolroughness]]/ &
[ifirst,ilast,istride]/ [<b>nosmooth</b>] / [<b>norecon</b>] &
[<b>strictmergelength</b>]/[<b>ignoremats</b>]/ &
[<b>lite</b>]/[<b>checkaxy</b>]/[<b>semiexclusive</b>]/[<b>exclusive</b>]
</pre>
### Primary Parameters
`bisection_length` edge length that will trigger bisection. can either be a scalar value or a
node attribute.
`merge_length` is the edge length value that will trigger merging.
`toldamage` is a parameter which controls how much the mesh interface and external boundaries will be deformed.    Roughly, it measures the depths of 'dents' that are invariably introduced when nodes are moved, annihilated, and faces are swapped.
`tolroughness` (for 2D surface grids only)  measure of grid roughness (deviation from average surface
normal) that triggers refinement.
The following are guidelines for using these primary parameters:
When setting the bisection parameter `bisection_length` as a scalar value, if the edge length is greater than scalar value, the edge will be refined.
If a node attribute is used, the edge length is compared to the minimum value of the two nodes, if edge length is greater, the edge will be refined. Thus, one should put a minimum floor value (probably equal to
twice the desired minimum edge lenth) for the field. Otherwise the
code will refine indefinitely. For an example of an appropriate field see [**`MASSAGE2`**](MASSAGE2.md).
The value of `bisection_length` should not be smaller than `merge_length`, or the action of
merging nodes together will be largely pointless because the newer,
longer edges created by merging will simply be bisected again. 
It is recommended that `bisection_length` be at least three times as large as `merge_length`.
If the damage parameter `toldamage` is set to an extremely small number, there will be few if any node movements, but annihilations, or face swaps will be allowed.  Conversely, if this parameter is set too large, boundaries may be significantly deformed. Setting `toldamage` equal to approximately .01 times the diameter of the mesh frequently gives acceptable results.
Merges of edges of length &lt;= `merge_length` are meant to coarsen the mesh, but are not meant to deform surfaces and material interfaces on this scale.  The amount of material/surface deformation set with `toldamage` is meant to be considerably less than `merge_length`. On the other hand, the maximum roughness tolerated in the graph
`tolroughness` should be considerably more than `toldamage`, or roughness refinement will be triggered by actions such as flipping or merging.
The following are guidelines for setting these parameters:
`bisection_length` &gt;= 3 times `merge_length` &gt;&gt; `toldamage`
`tolroughness` &gt;= 10 times `toldamage`  (for 2D surface grids)
For example, for a grid with diameter of order 3, these values are suggested:
`bisection_length`, `merge_length`, `toldamage`, `tolroughness` = .3, .1, .01, .1
If `bisection_length` **or** `merge_length` is omitted, the omitted parameter will be set so that `bisection_length` = 3 times `merge_length`.
If `bisection_length` **and** `merge_length` are omitted, both values will be taken to infinity.
If `toldamage` is omitted, no node annihilation will take place.
If `tolroughness` is omitted, no refinement on roughness will occur and thus the format is compatible
with old commands where refinement on roughness did not occur.
### Additional Parameters
- **nosmooth** will turn off the **`smooth`** step by skipping the call to SGD.
- **norecon** will turn off all **`recon`** steps.
- **lite** will specify only one iteration of the merging/reconnection/smoothing loop is executed,
and a reconnection after edge refinement is omitted.  This is
suitable for applications, such as Gradient Weighted Moving Finite
Elements, where **`MASSAGE`** is called repeatedly.
- **ignoremats** causes **`MASSAGE`** to process the multimaterial mesh in a single
material mode; it ignores multi-material interfaces. 
- **strictmergelength** forces strict interpretation of `merge_length` so that there is no merging along the edges of flat elements.  This is important if **ignoremats** is specified to avoid losing the interfaces.
- **checkaxy** for 2D meshes, ensures the output mesh will have positive xy-projected
triangle areas, provided that the input mesh had them in the first place. 
- **exclusive** applies to point sets, edge refinement operations will only be performed on edges whose
endpoints are both in the PSET that **`MASSAGE`** is working on.  (As usual, new nodes created by refinement are added to the PSET so that **`MASSAGE`** can refine edges recursively.)  The default
behavior is **inclusive**, where only ONE edge endpoint has to belong
to the PSET for the edge to be eligible for refinement.
- **semiexclusive** represents an intermediate case between **inclusive** and **exclusive**. Refinment is triggered only by edges with both endpoints in the PSET, but some edges with less than two endpoints in the PSET might be refined
as part of a 'Rivara chain' triggered by the refinement of an edge with both endpoints in the PSET. 
## EXAMPLES
```
massage/[0.3/0.1/0.01]
```
Mesh edges longer than 0.3 will be bisected; mesh edges shorter than
0.1 might be collapsed if that causes damage (normal surface motion)
to material interfaces or external boundaries less than 0.01 ;
smoothing of nodes causing damage less than 0.01 is allowed ; face
swapping causing damage less than 0.01 is allowed.
```
massage/[H_SCALE/0.1/0.01]/
```
Same as above, except that the **`bisection_length`** is a node field called H_SCALE in this case.
```
massage/[[0.3/0.1/0.01/0.1]
```
Same as above but for 2-D surface meshes, roughness greater than 0.1 will trigger refinement.
```
massage/0.3/0.1/0.01/pset,get,[pset1]
```
Mesh edges (containing at least one endpoint in pset1) longer than 0.3
will be bisected; mesh edges shorter than 0.1 might be collapsed if
that causes damage (normal surface motion) to material interfaces or
external boundaries less than 0.01 and if the annihilated node is in
pset1;  smoothing of nodes in pset1 causing damage less than 0.01 is
allowed; face swapping causing damage less than 0.01 is allowed
(unfortunately, LaGriT at this time does not restrict swapping to
pset1).
```
massage/0.3/0.1/0.01/pset,get,pset1,nosmooth
```
As above, but without smoothing.
```
massage/1.e+20/0.1/0.1/1,0,0/nosmooth
```
Because of the virtually infinite value of [bisection_length],no edges will be
bisected.  Since merge_length=toldamage=0.1, merging of edges  of
length less than 0.1 will be considered, and will not be rejected
because of excessive damage.  Hence we expect that all edges of length
less than 0.1 will be merged away (except in those cases where merging
would invert tetrahedra or change material topology).   Because
**nosmooth** is specified, no smoothing will take place.  Face
swapping causing damage less than [toldamage] is allowed
```
massage[/1.e+20/1.e-9/1.e-9/1,0,0]/nosmooth/strictmergelength /ignoremats
```
This set of arguments will remove degenerate elements from a mesh by
merging nodes that have the same coordinate values ( within 1.e-9).

View File

@@ -0,0 +1,77 @@
---
title: MASSAGE2
tags: massage2, refinement
---
# MASSAGE2
-----------------------
**`MASSAGE2`** iteratively calls [**`MASSAGE`**](MASSAGE.md) to refine adaptively according
to a gradient field. Thus, the `bisection_length` option must be a field.
## SYNTAX
<pre>
<b>massage2</b> / infile_name / min_scale / bisection_length / merge_length / toldamage / &
[tolroughness] /[ifirst,ilast,istride]/ [<b>nosmooth**]/[<b>norecon**] &
[<b>strictmergelength</b> ]/[<b>ignoremats</b> ]/[<b>lite]</b> /[<b>checkaxy</b>]/[<b>semiexclusive</b>]/[<b>exclusive</b>]
</pre>
   
`infile_name` is a file which contains a set of LaGriT [**`infile`**](INPUT.md) commands that
calculates the gradient field based on the distance field. In other words, the gradient field is a function of the distance field. It is necessary to have this file when using this routine, as the field must be updated after each refinement iteration. See sample infile below.
`min_scale` is the minimum length scale of the mesh (the minimum desired edge length).
See [**`MASSAGE`**](MASSAGE.md) for a full description of all command parameters.
## Creating user function infile for MASSAGE2
This file contains a set of LaGriT commands which calculate the gradient field for refinement based on the distance field.
A file could be written like this:
#user_function.mlgi
#An example of calculating the gradient field F
# as a linear function of the distance field D
#Define some coefficients for the function
define / COEF_A /
define / COEF_B /
#Formula F = COEF_A times D + COEF_B
#First remove any distance field that exists and recompute the distance field
cmo / DELATT / mo_sink / dfield
compute / distance_field / mo_sink / mo_src / dfield
#Calculate F
math / multiply / mo_sink / ref_field / 1,0,0 / mo_sink / dfield /COEF_A
math / add / mo_sink / ref_field / 1,0,0 / mo_sink / ref_field /COEF_B
finish
The user does not have to put a floor value for the gradient field in
this case (unlike in MASSAGE), as MASSAGE2 will calculate the floor
value automatically. However, the minimum length scale 'min_scale'
must be specified.
The user must also create a node-based attribute for the gradient
field before calling MASSAGE2. In the example above, attribute
'ref_field' must already exist in the mesh object. The name of the
field must also match the 'field_name' argument in the MASSAGE2
command.
## EXAMPLES
```
massage2 / user_function.mlgi / 0.1 / ref_field / 1.e-5 / 1.e-5 / strictmergelength
```
Call massage refinement with commands defined in the infile user_function.mlgi using attribute ref_field.

144
docs/pages/docs/commands/MATH.md Executable file
View File

@@ -0,0 +1,144 @@
---
title: MATH
tags: math
---
# MATH
-------------------
The **`math`** routine operates on attributes of a mesh object(s). It
performs arithmetic operations or evaluates mathematical functions on
the source mesh object or objects, and places the results in the sink
mesh object. The source and sink mesh objects can be the same, and
there can be either one or two source objects, depending on the
operation selected.
All attributes must have the same type, rank, and length.
Mathematical functions other than **`floor`**
and **`ceiling`** are not implemented for attributes whose values are
integers.
## SYNTAX
<pre>
<b>math</b>/operation/cmo_sink/attr_sink/1,0,0/cmo_src/attr_src / [value]
<b>math / integrate </b>/cmo_sink/attr_sink/1,0,0/ attr_src_field
</pre>
`operation` The first parameter a keyword that indicates the type of work to perform, see below.
`cmo_sink` `attr_sink` are the sink cmo and sink attribute for the math
results to be written to. These parameters are required for all math
operations.
`1 0 0` is the selected range istart,ilast,istride where 1,0,0 represents all. The selections can also be defined by `pset` or `eltset`.
`value` is required by some math operations and can be of type constant or can be a cmo attribute.
For the standard arithmetic operations, value can be either a constant
or an attribute. These arithmetic operations work for all types of
attributes. For the mathematical functions other than **`floor`** and **`ceiling`**,
value is omitted, and the function is performed on the `src_attr` and
stored in the `sink_attr`.
`cmo_src2/attr_src2/` where `cmo_src2` may be the same name as the source cmo, or the name of a second source cmo.
`attr_src2` assumes attribute is part of `cmo_src`
`constant` is a numerical value that is provided for some of the operations.
### OPERATIONS
**`plus add minus sub subtract times multiply mult divide min max modulo`** are arithmetic operators; the result is stored in
`sink_attr` where `sink_attr` = (`src_attr`) *operator* `value`. Where `value` can be a constant or mesh object attribute.
**`min max`** are not to be confused with the minimum or maximum value of an attribute; rather the the result is a
comparison of pairs of source values.
**`sin cos tan ln`** (natural log), and **`log10`** are mathematical
functions. The value parameter is omitted, and the function is
performed on the `src_attr` and stored in the `sink_attr`. These
functions are not implemented for integer attributes.
**`floor`** and **`ceiling`** are mathematical functions where value is
used as the lower or upper limit, the value(s) of `src_attr` are
checked against value, and the results are stored in the `sink_attr`.
These functions work for all types of attributes.
**`power`** function uses both value parameters. The first value or
`src_attr` is raised to the power of the second value or attribute. You
cannot use two constants. At least one of the sources must be an
attribute. The result is stored in the `sink_attr`.
**`exp`** and **`exp10`** functions raise the constant *e* or the constant
10 to the power specified by `src_attr` and stores the result in the
`sink_attr`.
**`sum`** adds all node or element values in attr_src, within the
selected range and writes the result to attr_sink. The sink attribute
must be of type 'REAL' or 'INT' (length='scalar') and will be created
if it does not exist.
**`integrate`** *for elements only*. It is a function that computes the product of 'field_value' times the 'element volume' at each element and either saves these products (or sums) to the sink attribute.
The 'field_value' for an element is either the value
of attr_src (if attr_src is an element attribute and has length
'nelements') or is the average of the values at the vertices of the
element (if attr_src is a node attribute).
If `sink_attr` does not exist or if it exists and has length
'nelements', the products are stored in `sink_attr`.
If `sink_attr` exists and has length 'scalar', then the
products are summed up and the result is stored in `sink_attr`.
If the user requires just the integrated sum this alternative avoids
having to use the pair of commands **integrate**, **sum** and also avoids creating the
'nelement' long sink attribute.
## EXAMPLES
```
math/multiply/ sink_mo/sink_attribute/50,60,3/src_mo/src_attribute/1.0
math/add/ mo/attribute/50,60,3/mo/attribute/100.0
math/modulo/ mo/attribute/1,0,0/mo/attribute/10
math/sub/ sink_mo/sink_attribute/50,60,3/src_mo1/src_attribute1/src_mo2/src_attribute2/
math/min/ sink_mo/sink_attribute/1,0,0/src_mo1/src_attribute1/src_mo2/src_attribute2/
math/ln/ sink_mo/sink_attribute/1,0,0/src_mo/src_attribute/
math/floor/ sink_mo/sink_attribute/1,0,0/src_mo/src_attribute/2.0/
math/power/ sink_mo/sink_attribute/1,0,0/src_mo/src_attribute/2.0/
math/power/ sink_mo/sink_attribute/1,0,0/2.0/src_mo/src_attribute/
math/power/ sink_mo/sink_attribute/1,0,0/base_mo/base_attribute/power_mo/power_attr
math/exp/ sink_mo/sink_attribute/1,0,0/src_mo/src_attribute/
math/exp10/ sink_mo/sink_attribute/1,0,0/src_mo/src_attribute/
math/integrate/ cmotri /Vf /1,0,0/ cmotri/ Fn
math/sum/cmotri / Vfsum /1,0,0/ cmotri / Vf
math/sum/cmotri / area_sum /1,0,0/ cmotri / darea
```

View File

@@ -0,0 +1,34 @@
---
title: MERGE
tags: merge
---
# MERGE
--------------------
Merge pairs of points together.
The command [massage](MASSAGE.md) may be used to merge nodes together based on the edge distance separating the nodes.
## SYNTAX
<pre>
<b>merge</b>/first_point/second_point
<b>merge</b>/1st_of_pair1/2nd_of_pair1/1st_of_pair2/2nd_of_pair2/../1st_of_pairn/2nd_of_pairn
</pre>
Parameters are pairs of points to merge.
On return, the first_point of a pair is the survivor unless `first_point` may not be removed ( a
corner point for example), then the command operates as if `first_point` and `second_point` have been interchanged. If there is no confirmation of the merge, one or both of the points may be inactive, or the merge may be illegal because the points are not neighbors or because this merge is disallowed by the merge tables.
Merging may trigger other merges by the reconnection step that follows the merge.
## EXAMPLES
```
merge/21,22/
```

View File

@@ -0,0 +1,77 @@
---
title: MODE
tags: mode
---
# MODE
----------------------
The MODE Command  sets up several optimization options.
# SYNTAX
<pre>
<b>mode/discrete</b>/surface_cmo/tolldamage
<b>mode/adaption_field</b>/field_name
<b>mode/recon/geom</b> <b>delaunay adaption</b>
</pre>
### Discrete optimization
**`discrete`**/surface_cmo/tolldamage
If this mode is set, **refine**, **smooth**, **merge** will
require any operation that involves nodes on the specified surface
to result in a mesh whose surface nodes are also members of the
`surface_cmo`.
A mesh object attribute associated with the 3d mesh named
discrete_optimize will be created and its value will be the name
of the surface mesh object.
### Error adaption
**`adaption_field`** / field_name
If this mode is set, optimization operations will be based on
reducing error.  A mesh object attribute associated with the 3d
mesh named 'adaption_field' will be created and it's value will
be the name of the field.
### Reconnection
**`recon/geom`**
**`recon/delaunay`**
**`recon/adaption`**
Setting this mode will determine the criterion used to
[reconnect](RECON.md) the mesh.  The default mode is
**delaunay** and setting mode to **delaunay** will cause recon to
attempt to create a [delaunay mesh](CONNECT1.md).  Setting mode
to **geom** will reconnect to increase inscribed radii of
elements.  Setting mode to adaption will reconnect to reduce
solution error.  The parameter `field_name` must be set with the
**`mode/adaption_field`** command.
## EXAMPLES
```
mode/adaption_field/solution
mode/recon/adaption
```

View File

@@ -0,0 +1,135 @@
---
title: MREGION
tags: mregion, region, surface
---
# MREGION
------------------
Define a material region from a set of surfaces by logically combining surface names and region names.
**`MREGION`** is used together with [**`SURFACE`**](SURFACE.md) and [**`REGION`**](REGION.md) to set mesh object geometry and materials.
<br>
See Examples below.
Defining a mregion will cause the information associated with this material region to be stored under the name of the [geometry](../geometries.md) of the current mesh object. Releasing the region will remove this information.
The defined mesh object geometry can be named with the [**`GEOMETRY`**](geometry.md) command.
## SYNTAX
<pre>
<b>mregion</b>/ material_region_name/ surface_and_region_operators
<b>mregion</b>/ mregion_name/ <b>release</b>
</pre>
Defining a material region will cause the information associated with
this material region to be stored under the name of the [geometry](../geometries.md) of the current mesh object.
Releasing the material region will remove this information.
<br>To define a material region, use operators with surfaces and regions according to the following rules.
<br> The operators **or, and**, and **not** mean union, intersection, and complement respectively and are applied to surfaces and regions.
<br> Parentheses are operators and are used for nesting.
<br> Spaces are required to separate operators and parentheses.
<br>
<br>
The operators **lt, le, gt**, and **ge** are applied to mesh object surfaces according to the following rules:
- **lt** if the surface following is a volume then **lt** means inside not including the surface of the volume. If the surface is a plane or a
sheet **lt** means the space on the side of the plane or sheet opposite to the normal not including the plane or sheet itself.
- **le** if the surface following is a volume then **le** means inside including the surface of the volume. If the surface is a plane or a
sheet **le** means the space on the side of the plane or sheet opposite to the normal including the plane or sheet itself.
- **gt** if the surface following is a volume then **gt** means outside not including the surface of the volume. If the surface is a plane or a
sheet **gt** means the space on the same side of the plane or sheet as the normal not including the plane or sheet itself.
- **ge** if the surface following is a volume then **ge** means outside including the surface of the volume. If the surface is a plane or a
sheet **ge** means the space on the same side of the plane or sheet as the normal including the plane or sheet itself.
Internal interfaces should be excluded when defining material regions, use **lt** and **gt**. External boundaries should be included, use **le** and **ge**.
## EXAMPLES
```
mregion/mat1/ le box1 and ( lt sphere1 and ( lt plane1 or gt plane2 ) )
```
Define a material mat1 that is inside or on a box shaped surface, and inside surface called sphere1, and relative to plane1 and plane2.
```
mregion/mat2/ regiona or regionb
```
Define a material region based on earlier defined regions such that material mat2 are all nodes found inside regiona or regionb.
```
cmo/create/cmo
surface/outside/reflect/box/0,0,0/3,2,1
region/all/le outside
mregion/all/le outside
createpts/xyz/3,3,3/0,0,0/3,2,1/1,1,1
setpts
connect
```
Very simple application of the region and mregion commands to create a single material box shaped mesh.
```
# Define geometry
cmo / select / CMO_IN
geometry / create / stack_geom
# define surfaces for CMO_IN
cmo / select / CMO_IN
surface / s0 /reflect / sheet / mo0
surface / s1 /reflect / sheet / mo1
surface / s2 /reflect / sheet / mo2
surface / s3 /reflect / sheet / mo3
surface / s4 /reflect / sheet / mo4
surface / s5 /reflect / sheet / mo5
surface / s6 /reflect / sheet / mo6
# define geometry regions
# all internal interfaces are defined
# and are included once only
region / r_below / le s0
region / r1 / ge s0 and lt s1
region / r2 / ge s1 and lt s2
region / r3 / ge s2 and lt s3
region / r4 / ge s3 and lt s4
region / r5 / ge s4 and lt s5
region / r6 / ge s5 and lt s6
region / r_above / ge s6
# define material regions
# internal interfaces not included
mregion / mr_below / lt s0
mregion / mr1 / gt s0 and lt s1
mregion / mr2 / gt s1 and lt s2
mregion / mr3 / gt s2 and lt s3
mregion / mr4 / gt s3 and lt s4
mregion / mr5 / gt s4 and lt s5
mregion / mr6 / gt s5 and lt s6
mregion / mr_above / gt s6
# Finished building geometry
```
Define geometry and material regions based on surface grids read into mesh objects named mo0, mo1, ... mo6.
The result are regions stacked in layers such that nodes found equal to surface s0 are the interface nodes between regions r1 and r2.
Nodes between surfaces s0 and s1 are in region r1 and have the material labeled mr1. And so on.
This mesh geometry has the name stack_geom.

View File

@@ -0,0 +1,77 @@
---
title: NEGATIVE_AIJ
tags: negative_aij, coefficients
---
# NEGATIVE_AIJ
---------------------
This command tests all edges of all boundary faces for negative coupling coefficients.
It adds three attributes to the mesh object:
**num_neg_coup_coeff** is the number of negative coupling coefficients
**neg_coup_coeff** is the value of coupling coefficients (type VDOUBLE length = num_neg_coup_coeff )
**ietet_aij** is a vector with length = num_neg_coup_coeff. for each negative coupling coefficient:
<br>
i: ietet_aij(1,i) contains the tetrahedron number which contributes the most negative portion to the coupling coefficient
<br>
ietet_aij(2,i) contains the local face number that contains the local edge
<br>
(ietet_aij(3,i)) which has the negative coupling coefficient.
<br>
## SYNTAX
<pre>
<b>negative_aij</b>
<b>negative_aij/refine</b>
<b>negative_aij/refine</b>/maxiter
<b>negative_aij/eltset</b>/eltset_name
<b>negative_aij/rivara</b>
</pre>
The attributes **num_neg_coup_coeff**, **neg_coup_coeff**, and **ietet_aij** can be used to generate a set of points to be added to
the mesh in an attempt to reduce the number of negative coupling coefficients by using the **`refine`** option. The points added are created by
projecting the fourth node of the tetrahedron onto the identified face and then projecting this projection onto the identified edge. If the
final projected point lies between the end points of the identified edge, this edge is refined. The identification and refinement steps may
be iterated up to `maxiter` times. Alternatively the attribute may be used to create an **`eltset`** of the identified elements.
The **`rivara`** option uses a rivara refinement method to add nodes on exterior boundary edges until all coupling coefficients are positive or until a maximum number of iterations has been exceeded.
## EXAMPLES
```
negative_aij
negative_aij/refine
```
for both examples, only one iteration will be performed
```
negative_aij/refine/ 5
```
a maximum of 5 iterations will be performed
```
negative_aij/eltset/ bad_tets
```
an element set called bad_tets will be created, no refinement will be performed
```
negative_aij/rivara
```
refinement method to add nodes on exterior boundary edges
[Click here for demo of the command above](../demos/main_rivara.md)

View File

@@ -0,0 +1,95 @@
---
title: OFFSETSURF
tags: offsetsurf
---
# OFFSETSURF
-----------------------
This command is used to offset a triangulated surface in the direction of the surface
outward normal, i.e., normal surface motion.
For each node a 'synthetic' unit outward normal **N** is computed based on the
weighted average angle of the normals of the triangles shared by that node.
To add the nodes in the new surface to the main mesh object use the
**`copypts`** command. To add the new surface to the main mesh object use a **`surface`** command with `new_cmo`
as the sheet name (e.g. **surface**/s2d/bndy_type)
## SYNTAX
<pre>
<b>offsetsurf</b>/ new_cmo / old_cmo / dist / [keywords]
</pre>
`new_cmo` is the name of the new surface.
`old_cmo` is the surface to be used in generating the offset surface.
`dist` is the distance to offset the surface. The new
node coordinates, R_new, are computed using the formula: R_new = R_old + dist times N_node
The following keywords are available:
**`keepatt, keep_angle`** Compute node angle weighted normals and keep the vector components in three scalar attributes **x_n_norm y_n_norm z_n_norm**
**`keep_area`** Compute node area weighted normals and keep the vector components in three scalar attributes **x_n_norm y_n_norm z_n_norm**
**`xzero`** Compute the full offset direction vector but set x component to zero
**`yzero`**  Compute the full offset direction vector but set y component to zero
**`zzero`**  Compute the full offset direction vector but set z component to zero
**`xy, xz, yx, yz, zx, zy`** - these keywords come after the 'dist' value. They constrain the offset to
be parallel to the specified plane. These arguments can be used with a line type mesh object to constrain the offset to a particular plane.
 
## EXAMPLES
```
offsetsurf/mo_out/cmo_in/d
```
offset a triangulated surface a distance d using angle weighted normals
```
offsetsurf/cmo_out / cmo_in / d / keep_area
```
offset using area weighted normals
```
offsetsurf/mo_out/cmo_in/d/[xy,xz,yx,yz,zx,zy]
```
offset a line cmo a distance d in a direction parallel to the specified plane
```
offsetsurf/mo_out/cmo_in/d/x y z
```
offset a line cmo a distance d in the direction specified by the vector (x,y,z)

View File

@@ -0,0 +1,94 @@
---
title: PERTURB
tags: perturb
---
# PERTURB
This command moves node coordinates in the following manner.
Three pairs of random numbers between 0 and 1 are generated. These pairs
refer to the x, y and z coordinates of the nodes respectively. The first
random number of each pair is multiplied by the factor given in the
command. The second random number is used to determine if the calculated
offset is to be added or subtracted from the coordinate.
WARNING: No checking is done to see if elements are inverted by this
perturbation. If one uses too large a value for the perturbation, one
can easily cause element inversions that will flip the normal vector of
triangles and cause 3D cells to have negative volumes.
Use the [**`QUALITY`**](QUALITY.md) command to report element volumes.
## SYNTAX
<pre>
<b>perturb</b>/ <b>pset,get</b>,psetname / xfactor,yfactor,zfactor
</pre>
`pset,get,psetname` is the range of nodes to offset, 1,0,0 means all nodes.
`xfactor,yfactor,zfactor` perturbation values
 
## EXAMPLES
```
perturb/1,0,0/0.5,0,0  
```
add offsets to only the xcoordinates of all nodes
```
perturb/pset,get,mypset/0.001,0.001,0.001 
```
add small offsets to all coordinates of the nodes in the pset named mypset
## DEMO using FACTOR parameters
```
# For a unit cell divided into PTS**3 sub-cells,
# delta-x = 0.01 = distance between sub-cell centers
# x_p = delta-x / 100 = 0.0001 = 1% perturbations
# eps_1 = sqrt(3*x_p) = 0.000173 = max dist. from origin
define/XP/0.0001
define/EPS1/0.00018
define/PTS/101
cmo/create/mo1
createpts/xyz/PTS,PTS,PTS/0.,0.,0./1.,1.,1./1,1,1/
pset/po1/seq/0,0,0/
cmo/setatt/mo1/imt/pset,get,po1/1
cmo/create/mo2
createpts/xyz/PTS,PTS,PTS/0.,0.,0./1.,1.,1./1,1,1/
pset/po2/seq/0,0,0/
cmo/setatt/mo2/imt/pset,get,po2/2
perturb/pset,get,po2/XP,XP,XP/
addmesh/merge/mfilter/mo1/mo2
cmo/copy/mfilterkd/mfilter
cmo/select/mfilter
filter/1 0 0/EPS1
cmo/printatt/mfilter/imt/minmax
cmo/printatt/mfilter/-xyz-/minmax
cmo/select/mfilter
rmpoint/compress
cmo/printatt/mfilter/imt/minmax
cmo/printatt/mfilter/-xyz-/minmax
finish
```

235
docs/pages/docs/commands/PSET.md Executable file
View File

@@ -0,0 +1,235 @@
---
title: "PSET"
tags: pset node selection
---
# PSET (Point Set)
-------------------
Associate a name with a point set based on various geometric and logical operators. Manipulate point sets. Output point sets.
By convention, `ifirst,ilast,istride` syntax represents a range selection defined either by a set of points from ifirst to ilast, with increments of istride (1 by default). A set selection can also be defined with **pset,get,** `pset_name` where `pset_name` has been defined by the following **`PSET`** commands. Most commands with the syntax `ifirst,ilast,istride` can also use **pset,get,** `pset_name`.
The following are the syntax and parameter definitions, click on options in table or scroll down the page.
| | | | |
| :------ | :---------- | :------ | :---------- |
| [**`attribute`**](#attribute) | [**`constraints`**](#constraints) | [**`delete`**](#delete) | [**`eltset`**](#eltset) |
| [**`geom`**](#geom) | [**`list`**](#list) | [**`logicals`**](#logicals) | [**`region`**](#region) |
| [**`seq`**](#geom) | [**`surface`**](#list) | [**`write`**](#write) | [**`zone`**](#zone) |
<hr>
### **`attribute`** <a name="attribute"></a>
<pre>
<b>pset</b>/pset_name/ <b>attribute</b> / attribute_name /ifirst,ilast,istride/[<b>eq</b> or <b>ne</b> or <b>lt</b> or <b>gt</b> ] / [value]
</pre>
forms a pset from points in selected range which have the specified value for a node based attribute.
If the optional comparator field is given; that operation is used to compare the attribute value to the requested value.
Note the comparator fields and the value can swap argument order.
*This option was previously named zq in old releases*.
### **`constraints`** <a name="constraints"></a>
<pre>
<b>pset</b>/pset_name/<b>constraints</b>/ num_constraints
</pre>
forms a pset of nodes having the specified number of constraints.  The node's **icr** value is used as an index to the **icontab** attribute which gives the number of constraints.  [See Mesh Object](../meshobject.md) for an explanation of the **icontab** entries.
### **`delete`** <a name="delete"></a>
<pre>
<b>pset</b>/pset_name/ <b>delete</b>
</pre>
removes a previously defined pset from current mesh object
### **`eltset`** <a name="eltset"></a>
<pre>
<b>pset</b>/pset_name/ <b>eltset</b> / element_set_name
</pre>
forms a pset of nodes in the element set with the name `element_set_name`.
### **`geom`** <a name="geom"></a>
<pre>
<b>pset</b>/pset_name/<b>geom / xyz</b> /ifirst,ilast,istride/ xl,yl,zl / xu,yu,zu/ xcen,ycen,zcen
<b>pset</b>/pset_name/<b>geom / rtz</b> /ifirst,ilast,istride/ r1,t1,z1 / r2,t2,z2/ xcen,ycen,zcen
<b>pset</b>/pset_name/<b>geom / rtp</b> /ifirst,ilast,istride/ r1,t1,p1 / r2/t2/p2/ xcen,ycen,zcen
</pre>
forms a pset from all points inside a geometric shape as defined in the following options:
- **xyz** forms a pset from all points inside a box whose corners are xl,yl,zl and xu,yu,zu relative to the geometry center at xc,yc,zc.
- **rtz** forms a pset of nodes within the cylinder or cylindrical shell given by radius r1 to r2, angle theta t1 to t2 and height z1 to z2.
- **rtp** forms a pset of nodes within the sphere, sperical shell or sperical section given by radius r1 to r2, and angles theta t1 to t2 and angles phi p1 to p2.  [See Conventions](../conventions.md) for an explanation of angles theta and phi.
### **`list`** <a name="list"></a>
<pre>
<b>pset</b>/pset_name/<b>list</b>
<b>pset</b> / / <b>list</b>
</pre>
list all nodes in `pset_name`. If the 2nd argument is empty, list all names all of psets for the mesh object
### **`logicals`** <a name="logicals"></a>
<pre>
<b>pset</b>/pset_name/ <b>union</b> <b>inter</b> <b>not</b> / pset1[ ,pset2, … psetn ]
</pre>
logical operations **`union`**, **`inter`** and **`not`** act on previously defined psets.  The definition of the unary operator **`not`** is extended such that **`not`**/p1/p2 means p1 and (not(p2)).
### **`region`** **`mregion`** <a name="region"></a>
<pre>
<b>pset</b>/pset_name/<b>region</b> or <b>mregion</b> / region_name / ifirst,ilast,istride
</pre>
will return all nodes that are in the specified region or mregion as given by its `region_name`.
### **`seq`** <a name="seq"></a>
<pre>
<b>pset</b>/pset_name/ <b>seq</b> /ifirst,ilast,istride
</pre>
forms a pset of the nodes defined by ifirst, ilast, istride;
the special syntax,: 1,0,0 refers to all nodes and 0,0,0 refers to the last set of nodes created.
### **`surface`** <a name="surface"></a>
<pre>
<b>pset</b>/pset_name/ <b>surface</b> / surface_name / [ifirst,ilast,istride]
</pre>
identifies nodes on the specified surface as indicated by defining surface_name.  The following keywords for surface_name can be used:
- **-all-** will identify nodes on all and any surfaces.
- **-interface-** will identify all nodes on interfaces.
- **-boundary-** will idendtify nodes on external boundary surfaces.
### **`write`** <a name="write"></a>
<pre>
<b>pset</b>/ pset_name or <b>-all-</b> / <b>write</b> / file_name[.vertexset] / [<b>ascii</b> or <b>binary</b>]
</pre>
write or dump a pset node list to a file, options are **ascii** or **binary**.
### **`zone`** **`zonn`** <a name="zone">
<pre>
<b>pset</b> / name or <b>-all-</b> / <b>zone</b> or <b>zonn</b> / file_name[.zone or .zonn] / [<b>ascii</b>] [zone_number]
</pre>
write pset node list to a file (FEHM Flow and Transport code zone file format). By default the zone_number is a number 1-n where n is the number of psets defined in the mesh object. Specify a number value for a single zone file with the zone_number option.
### zq (deprecrated)
<pre>
<b>pset</b>/pset_name / attribute_name/ ifirst,ilast,istride / [value] / [<b>eq</b> or <b>ne</b> or <b>lt</b> or <b>gt</b> ]
replaces:
<b>zq</b> / attribute_name / ifirst,ilast,istride / [value] / [<b>eq</b> or <b>ne</b> or <b>lt</b> or <b>gt</b> ]
</pre>
## EXAMPLES
pset/apset/seq/1,0,0/
associate the pset name apsetwith all points.
pset/apset/seq/0,0,0/
associate the pset name apset with the last set of nodes created.
pset/apset/ union /pset1,pset2,pset3
associate the pset name apset with the set of nodes which belong to at least one of pset1, pset2, pset3.
pset/apset/ inter / pset1,pset2,pset3
associate the pset name apset with the set of nodes which belong to pset1, and pset2, and pset3.
pset/apset/ not /pset1,pset2,pset3
associate the pset name apset with the set of nodes which belong to pset1, and do not belong to pset2, and do not belong to pset3 pset/apset/not/pset1 associate the pset name apset with the set of nodes which do not belong to pset1
pset/list/
list the names of all psets
pset/mypset/list
output the list the node numbers of the members of mypset to the screen and the log file outx3dgen
pset/mypset/write/file_name.vertexset/ascii
Write list of nodes in pset mypset to an ascii file named file_name.vertexset
pset/-all-/write/root_name/ascii
Write list of nodes in all psets. root_name is treated as a root name and each pset is written to a separate file beginning with that root. For example, if you have psets named pset1 and pset2, they will be written to files called root_name_pset1.vertexset and root_name_pset2.vertexset.
pset/mypset/zone/file_name.zone/ascii
Write list of nodes in pset mypset to an ascii file named file_name.zone in FEHM zone file format. The zone number will be 1 if this is the first pset for the mesh object.
pset/mypset/zone/file_name.zone/ascii 42
Write list of nodes in pset mypset to an ascii file named file_name.zone in FEHM zone file format. The zone number will be 42 as specified.
pset/apset/attribute/itp/1,0,0/10/ge
associate the name apset with the points whose type field(itp1) has value greater than or equal to 10 (these would be boundary nodes).
pset/apset/ inter / pset1,pset2,pset3
associate the pset name apset with the set of nodes which belong to pset1, and pset2, and pset3.
pset/p1/attribute/zic/1,0,0/gt 1.0
pset/p2/attribute/zic/1,0,0/lt 10.0
pset/pboth/ inter / p1 p2
pset/p1/attribute/zic/ 1,0,0 /gt 1.0
pset/pboth/attribute/zic/ pset,get,p1 / lt 10.0
associate the name pboth with all nodes that have zic values between 1.0 and 10.0, note both sets of commands have the same result.
pset/mypset/geom/rtz/pset,get,oldpset/0.,0.,0./10.,360.,10.
associate the name mypset with the nodes that are members of the pset oldpset and which fall inside the cylinder of radius 10 and height 10 and whose axis is the z-axis.
pset/spset/surface/s1/1,0,0
associate the name spset with the set of nodes that lie on the surface s1.
pset/spseta/surface/s2/pset,get,spset
associate the name spseta with the set of nodes that lie on the surface s2 and which are members of the pset spset This command and the previous command would identify the nodes that are on the intersection of surfaces s1 and s2 and give the name spseta to these nodes.
pset/mypset/constraints/3
associate the name mypset with the set of nodes that have 3 constraints ( normally the set of nodes that lie on 3 constrained surfaces -- surfaces of type reflect or intrcons)
[Click here for demos](../demos/main_pset.md)

View File

@@ -0,0 +1,44 @@
---
title: PSTATUS
tags: pstatus
---
# PSTATUS See also [PSET](PSET.md)
---------------------
Saves, removes, retrieves, or replaces a specified set of points,
usually the last set of points defined by a generator command or the
set of points defined by ifirst,ilast,istride. Note that point sets
must be specified in sequence in order for this command to work
properly.
## SYNTAX
<pre>
<b>pstatus</b>
</pre>
Returns current point status counters
<pre>
<b>pstatus</b> /<b>save</b>/name/ifirst,ilast,istride
</pre>
Saves the point status numbers, ifirst,ilast,istride under name
<pre>
<b>pstatus</b> /<b>store</b>/name/ifirst,ilast,istride
</pre>
Overwrites what was in name with ifirst,ilast,istride
<pre>
<b>pstatus/ delete</b>/name
</pre>
Deletes values from name
<pre>
<b>pstatus/get</b>/name
</pre>
Retrieves values from name

View File

@@ -0,0 +1,89 @@
---
title: QUADXY
tags: quadxy 2D point distribution
---
# QUADXY
----------------
Define an arbitrary, logical quad of points in 3D space with NDIM1 x NDIM2 number of nodes.
The four corners of the quad surface are defined in counter clockwise order ( the normal to the quad points is defined using the right hand rule and the order of the points).
The nodes can be connected using the **`createpts/brick/xyz`** command.
## SYNTAX
<pre>
<b>quadxy</b>/ndim1, ndim2 /x1,y1,z1/x2,y2,z2/x3,y3,z3/x4,y4,z4
</pre>
## EXAMPLES
```
# create quad sheet
define NX 3
define NY 5
cmo/create/moquad/ / / quad
quadxy/ NX NY /0. 0. 0./10. 0. 0./10. 20. 0./0. 20. 0.
createpts/brick/xyz/ NX NY 1 /1,0,0/connect
# read elevations from data file with x y z coordinates
# save z to attribute named elev and set to 0 same as template
cmo / create/ motmp
cmo readatt motmp /xic,yic,zic/1,0,0/ ev_points.dat
cmo/addatt/motmp/ elev/VDOUBLE/scalar/nnodes/linear/permanent/
cmo/copyatt/ motmp motmp/ elev zic
cmo/setatt/ motmp / zic 0.
# assign the z values from the point data to the template
interpolate/voronoi/moquad zic/1,0,0/ motmp elev
cmo/printatt/moquad/ zic minmax
dump/avs/ quad_surface.inp/ moquad
```
This is XY Flat, as shown in first image, a 3 x 5 quad grid on the XY plane where Z = 0.
Next, this example shows how point data can then be copied into this quad template.
It is important that the quadxy template and the point set have the same NX NY.
But node order does not matter as interpolate will assign elevation from nearest node.
```
define X1 2.0
define Y1 40.0
define Z1 4.0
define X2 2.0
define Y2 1.0
define Z2 1.0
define X3 50.
define Y3 20.
define Z3 40.
define X4 55.
define Y4 15.
define Z4 1.
define / NX / 6
define / NY / 1
define / NZ / 24
cmo/create/moquad/ / / quad
quadxy/NX NZ/ X1 Y1 Z1 / X2 Y2 Z2 /X3 Y3 Z3 / X4 Y4 Z4
createpts/brick/xyz/NX NY NZ/1,0,0/connect
```
This example shows XZ Twisted, as shown in last image. Create a 6 x 24 quad grid with a twist.
The quadxy command enables assignment to the 4 corners such that the surface is not planer.
Input LaGriT command file for 3 examples: [ex_quadxy.lgi](https://lanl.github.io/LaGriT/pages/docs/demos/input/ex_quadxy.lgi.txt)
<a href="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxy_example1.png"><img width="300" src="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxy_example1.png" alt="quadxy"> </a>
<a href="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxy_example2.png"><img width="300" src="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxy_example2.png" alt="quadxy"> </a>
<a href="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxy_example3.png"><img width="300" src="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxy_example3.png" alt="quadxy"> </a>

View File

@@ -0,0 +1,60 @@
---
title: QUADXYZ
tags: quadxyz point distribution
---
# QUADXYZ
-----------------------
Define arbitrary, logical set of points in 3D(xyz) space, no elements are created. <br>
The set of points can be connected into hexahedrals by using the command [**`createpts/brick`**](createpts/CRTPTBRICK.md) as shown in the example and image below.
This point distribution is defined by 8 points along the xyz axis. This differs from **createpts/brick/xyz/** which generates a logicially rectangular distribution defined by 2 points at the mininum and maximum corners of the domain and then generates connectivity for elements.
## SYNTAX
<pre>
<b>quadxyz</b>/ nx,ny,nz / &
x1,y1,z1/x2,y2,z2/x3,y3,z3/x4,y4,z4 / &
x5,y5,z5/x6,y6,z6/x7,y7,z7/x8,y8,z8
</pre>
`nx ny nz` specifies the number of points between the 1st and last point along each X, Y, Z axis. The number of points will be 1 more than the number of spaces.
`x1,y1,z1/x2,y2,z2/x3,y3,z3/x4,y4,z4` are the coordinates counter clockwise around the bottom quad face.
`x5,y5,z5/x6,y6,z6/x7,y7,z7/x8,y8,z8` are the coordinates counter clockwise around the top quad face.
## EXAMPLES
```
define NPTS 2
cmo/create/mohex
quadxyz/NPTS NPTS NPTS/ &
0. 0. 0./1. 0. 0.02 / 1. 1. 0. /0. 1. .1 / &
0. 0. 1./1. 0. 1./ 1. 1. 1. /0. 1. 1.1
createpts/brick/xyz/NPTS NPTS NPTS/1,0,0/connect
```
Create a 2x2x2 point distribution (mesh object with 0 elements). Then use createpts/brick to create connectivity. The result is a single hex with 8 points as shown in the image.
Click on image for full size.
<a href="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxyz_hex.png"> <img width="500" src="https://lanl.github.io/LaGriT/pages/docs/demos/output/quadxyz_hex.png" alt="quadxyz"> </a>

View File

@@ -0,0 +1,188 @@
---
title: QUALITY
tags: quality mesh metrics
---
# QUALITY #
------------------------
**`quality`** provides a collection of mesh quality measurements. Together with commands in **`cmo/addatt`** a good summary of mesh metrics can be reported or used for further mesh optimization. For quality measurments to characterize tet elements by various types, see [Quality Measures](https://lanl.github.io/LaGriT/pages/docs/QUALITY_sliver_cap_needle_wedge.html).
## SYNTAX ##
<pre>
<b>quality</b> / [quality_type] / [quality_type_options]
</pre>
## DESCRIPTIONS ##
The following are definitions for valid *`quality-type`* commands and their *`quality_type_options`*.
**`quality`**
with no arguments writes to screen and outx3dgen or lagrit.out logfile reports on the min, max, and counts of aspect ratios and volumes. The aspect ratios are displayed with 7 bins (log scale) with counts of values between .01 and 1. The element volumes are displayed with 5 bins with counts of values between the min and max volumes.
**`quality/aspect`** / [y]
computes the ratio of the radius of the circumsphere to the radius of the inscribed sphere of a tetrahedron. The ratio is multiplied by 3 so that a value of 1 indicates a regular tetrahedron. The display is a binned count of the number of elements whose aspect ratio falls in each of 7 bins (log scale between .01 and 1).
**y** option creates **aratio** mesh element attribute containing the value of the aspect ratio for each element. Valid element types are tet and tri, hex, and quad (where the length of the hex or quad diagonals are used).
**`quality/edge_ratio`** / [y]
computes the ratio (shortest element edge/longest element edge) and displays a binned count of the min/max edge ratio in each of 7 bins (log scale between .01 and 1). **y** option creates **eratio** mesh element attribute containing the value of the min/max edge ratio for each element.
**`quality/edge_min`** / [y]
displays a binned count of the minimum edge lengths displayed log scale between .01 and 1. The binned values are normalized by dividing with the max value. The min and max of the mininum edge length for each element are also reported.
**y** option creates **edgemin** mesh element attribute containing the value of the min edge length of each element.
**`quality/edge_max`** / [y]
displays a binned count of the maximum edge lengths displayed log scale between .01 and 1.
The binned values are normalized by dividing with the max value. The min and max of the maximum edge length for each element are also reported.
**y** option creates **edgemax** mesh element attribute containing the value of the max edge length of each element.
**`quality/angle`** / **gt** OR **lt** / value /
finds the max and min dihedral angles between adjacent faces (or 2D edges) of an element in radians. If the compare option is used, it displays a count of the number of elements with a dihedral angle that is greater than or less than the supplied value. See also **cmo/addatt/cmo/ang_** commands for dihedral angle and solid angle calculations.
**`quality/pcc`**
creates an element based attribute called **neg_coup_coeff** which is a "negative coupling coefficient" indicator. A value of 1 means the coupling coefficient is OK. Anything less than 1 means it is negative. This is useful when viewing a mesh to find where the negative coupling coefficients occur.
**`quality/quad`**
generates some quality measures for quads and displays them after binning them into seven bins. For details on the quad quality measures see [cmo/addatt/ quad_quality](https://lanl.github.io/LaGriT/pages/docs/commands/cmo/cmo_addatt.html).
**`quality/taylor`**/ fieldname / value /
creates and displays a count of the number of element-edge pairs with a taylor error estimate value whose absolute value is greater than the supplied value. This creates the attribute **quality_taylor** with length in attribute **quality_taylor_len**.
**`quality/volume`** allows any combination of the *`quality_type_options`* for example:
```
quality/volume/ number_of_bins / itetclr / lt | gt | eq | ne | xvalue / eltset,get,ename
```
**`quality/volume`** / [number_of_bins] / [ **itetclr** ]
number_of_bins is an integer value controlling the number of bins in which to distribute the volume values for display. if number_of_bins is 0, then binning of distributed volumes is skipped, and only min and max volumes are reported. number_of_bins must be the 2nd argument to quality if used.
itetclr is a keyword that will give volume information according to the values in the itetclr attribute. Number_of_bins applies to each tetclr value. For each itetclr value, the volume of elements will be totaled.
**`quality/volume`** / **gt** OR **lt** OR **eq** OR **ne** / value
will report volumes based on compare operator and given xvalue, for instance quality/volume/lt 0.0/ will report total number of elements with volumes less than 0.0 It may be used in combination of other volume options. if used with itetclr keyword, values will be reported by itetclr value
**`quality/volume`** / **eltset, get,** eset_name
eltset,get,ename will report volumes on elements in defined eltset can be used in combination with previous options with operations done only on the chosen eltset. itetclr will still report for each of the values in itetclr.
## EXAMPLES ##
```
quality/aspect
```
display summary of aspect ratio distribution in 7 bins
```
quality/aspect/ y
```
create attribute **aratio** and display summary of aspect the aratio distribution
```
quality/angle/gt/179/
```
return count of elements with a dihedral angle > 179
```
quality/taylor/boron/1.e-10/
```
run taylor error estimate and return count of element edge pairs with absolute error greater than 1.e-10
```
quality/volume
quality/volume/ 2
```
The first call will display summary of volumes with 5 bins, the second command will show summary with 2 bins
```
quality/volume/itetclr
quality/volume /itetclr/lt .03
quality/volume/itetclr/eltset,get,e2
```
All three commands will loop through itetclr (material values) and report a total volume for each itetclr value.
The second command will report element volumes lt .03 by the itetclr values.
The third command will report element volumes by itetclr values, but only for elements in the set e2
```
quality
quality/ aspect / y
quality/ edge_max / y
cmo/addatt /cmotri /area_normal/ xyz/ anorm
cmo/addatt /cmotri /scalar /xnorm ynorm znorm / anorm
cmo/printatt /cmotri / aratio minmax
cmo/printatt /cmotri / edgemax minmax
cmo/printatt /cmotri / znorm minmax
```
Example calls using **quality** and **cmo/addatt** commands to show mesh quality statistics.
```
quality
```
The default with no arguments will calculate and display element volumes and aspect ratios for the current mesh object.
Output for the quality command with no arguments:
<pre class="lg-output">
quality
epsilonl, epsilonaspect: 1.4360051E-10 2.9612012E-30
--------------------------------------------
elements with aspect ratio < .01: 0
elements with aspect ratio b/w .01 and .02: 0
elements with aspect ratio b/w .02 and .05: 0
elements with aspect ratio b/w .05 and .1 : 0
elements with aspect ratio b/w .1 and .2 : 12020
elements with aspect ratio b/w .2 and .5 : 625891
elements with aspect ratio b/w .5 and 1. : 157053
min aspect ratio = 0.1053E+00 max aspect ratio = 0.7229E+00
epsilonvol: 1.1335396E-05
---------------------------------------
element volumes b/w 0.1667E+02 and 0.3318E+02: 612924
element volumes b/w 0.3318E+02 and 0.6605E+02: 54612
element volumes b/w 0.6605E+02 and 0.1315E+03: 18204
element volumes b/w 0.1315E+03 and 0.2617E+03: 45510
element volumes b/w 0.2617E+03 and 0.5210E+03: 63714
element volumes b/w 0.2617E+03 and 0.5210E+03: 63714
min volume = 1.6666667E+01 max volume = 5.2100000E+02
-----------------------------------------------------------
794964 total elements evaluated.
</pre>
[Click Here For more Examples on Quality Measurements](https://lanl.github.io/LaGriT/pages/docs/QUALITY_sliver_cap_needle_wedge.html)

View File

@@ -0,0 +1,188 @@
---
title: "RADAPT"
tags: radapt, adaptive smoothing
---
# RADAPT
--------------------
The command radapt performs r-adaption smoothing on 2D or 3D mesh objects.
For a more general version of smoothing see command [**`SMOOTH`**](SMOOTH.md).
This command takes a 2D or 3D mesh object and moves nodes (specifically the nodes selected by
`ifirst,ilast,istride`), without changing the connectivity of the mesh, in order to adapt the mesh to best capture the behavior of a specified field or to an adaption function **fadpt** supplied by the user.
## SYNTAX
<pre>
<b>radapt</b> /[<b>position</b>] / <b>esug</b> or <b>mega</b>/ [ifirst,ilast,istride] / [field]/ [<b>refresh</b> or <b>stale</b>]
<b>radapt</b> / [<b>position</b>] / <b>esug</b> or <b>mega</b>/ [ifirst,ilast,istride] / [<b>user</b>]
</pre>
## SYNTAX for the adaption function
<pre>
subroutine <b>fadpt</b>(xvec,yvec,zvec, imtvec, nvec, time, fvec)
</pre>
xvec, yvec, zvec - Vectors of x, y, and z coordinates of the points where the function is to be evaluated.
imtvec - Vector of imt values for the case where function value depends on material type as well as position (ie. functions with discontinuities).
nvec - Vector length (= number of places where function is to be evaluated).
time - Time (scalar), for time-dependent functions.
fvec - Vector of adaption function values.
## DESCRIPTION
There are two adaptive smoothing algorithms available:
1. **`esug`** Elliptic Smoothing for Unstructured Grids. This can
only be used on triangular 2D mesh objects. If field is specified in
the command line, **esug** will attempt to adapt the grid to the
specified field. If the keyword **user** is specified in the command
line, **esug** will attempt to adapt the grid to an *adaption
function* defined by the user-supplied subroutine **`fadpt`**.
<br>
*Ref.: Ahmed Khamayseh and Andrew Kuprat, "Anisotropic Smoothing and Solution Adaption for Unstructured Grids", Int. J. Num. Meth. Eng., Vol. 39, pp. 3163-3174 (1996)*
2. **`mega`** Minimum Error Gradient Adaption. For adaptive
smoothing purposes, **mega** can only be used on 3D meshes, and only
in conjunction with a user-supplied subroutine **`fadpt`** or with a user specified attribute `field`. If adaption is to an attribute field,
then **radapt** may be instructed to use the interpolation mode associated with the attribute to **refresh** the attribute values.
The default is **stale** in which case the attribute value will not be updated to reflect the new node position. In either case, the
user is cautioned to carefully consider the validity of the data used for the adaption. **mega** can be used to adapt hybrid meshes
as well as tetrahedral meshes.
<br>
*Ref.: Randolph E. Bank and R. Kent Smith, “Mesh Smoothing Using A Posteriori Error Estimates”, SIAM J. Num. Anal. Vol. 34, Issue 3, pp. 979-997, 1997.*
If `field` adaption is used, the user has specified a valid `field`
from the current mesh object, and r-adaption is to be based upon
this field. Typically, if the field has large gradients or curvature
in a particular region, r-adaption using this field will cause nodes
to be attracted to the region of interest. (**esug** adapts
especially to large gradients, **mega** adapts especially to large
second derivatives---"curvature".)
If adaption is to an attribute field, then **`radapt`** may be instructed to use the interpolation
mode associated with the attribute field to **refresh** the
attribute values. The default is **stale** in which case the
attribute value will not be updated to reflect the new node position
adaption. In this case, the user should reduce the number of
adaption iterations to less than 4, since r-adaption with stale data
becomes meaningless.
If **`refresh`** is specified, the r-adaption routine will automatically
interpolate the new field values every iteration, using a call to
the **`doping`** command. In this case, the number of adaption
iterations need not be reduced from the default value of 25. In
either case, the user is cautioned to carefully consider the
validity of the data used for the adaption.
If **`user`** is specified, the mesh will r-adapt to the function returned
by the subroutine **`fadpt`** which must be supplied by the user.
If **`position`** is specified, it signifies that the x-y-z values of the nodes
in the current mesh object will be altered. (Other argument values allow for modification options that are not yet implemented.)
If **`esug`** is used (currently available in 2D only), the degree of
node adaption will depend on the scale of the specified field. In
this case, the results of adaption of the grid to the field can be
altered by using one or more `field` commands beforehand to modify the field. For example, by increasing the scale of a field using
**field** **/scale**, the **esug** algorithm will produce grids with
increased numbers of nodes in the regions where the field
experiences relatively large gradients. By volume averaging a field
using `field`**/volavg**, **esug** will cause a more gentle form
of adaption with a better grading of elements. By composing the
values of the field with **log** or **asinh** using **field**
/**compose**, one can cause **esug** to shift nodes to where the
logarithm (or hyperbolic arcsine) of the field has interesting
features, rather than where the field itself has interesting
features.
Note: Since the* **mega** adaptive smoothing algorithm is rigorously based on error minimization, it is in general of
little or no value to modify the adaption function for this algorithm. In particular, rescaling has no effect on the output.
The variable **MAXITER_SM** (Default: 25) can be set using the **`ASSIGN`** command before calling **`RADAPT`**.
This controls the maximum number of adaption iterations to be performed. If convergence is detected beforehand, less iterations will be
performed. If field data is allowed to become "stale" during the course of r-adaption, **MAXITER_SM** should be reduced (e.g. less than 5).
# EXAMPLES
```
radapt / / esug / 1,0,0 / density
```
Using **esug**, adapt all nodes in 2dmesh to the density field. Do not update data.
```
radapt / / / 1,0,0 / user
doping / user / density / set /1,0,0/
```
Assuming a default 3D cmo, use **mega** to adapt the mesh to the adaption function supplied by the user via subroutine fadpt.
Afterwards dope (interpolate) the density field with the fadpt function values.
```
assign / / / maxiter_sm / 50
```
This changes the maximum number of iterations to 50. If **radapt** detects a sufficient amount of convergence, it will terminate
smoothing in less than **maxiter_sm** iterations.
## DEMOS with SAMPLE FUNCTIONS
The following demonstrate adaptive smoothing using **mega**.
### 1. Boron density function
Load the file fadpt_boron.f ahead of the **LaGriT** libraries; this will cause the default fadpt
subroutine to be displaced by the one in this file. The result is that
now 3D adaptive smoothing will attempt to adapt 3D tetrahedral or hybrid
meshes to the boron density function devised by Kent Smith of Bell Labs.
This function has a maximum value of 1.1 x 1018, and drops rapidly to
zero; the function attains its largest values on a T-shaped region in
space and provides very challenging isosurfaces to capture. Two input
decks use this function:
input.boron.3dtet. This deck generates and adapts a tetrahedral mesh to the boron function. A snapshot of the adapted grid may be seen at <a href="https://lanl.github.io/LaGriT/assets/images/boron.png"> boron.png </a>.
input.boron.3dhex. This deck generates and adapts a hexahedral mesh to the boron function. A snapshot of the adapted grid may be seen <a href="https://lanl.github.io/LaGriT/assets/images/boron.hex.png"> boron_hex.png </a>
- Fortran subroutine [fadpt_boron.f](../../fadpt_boron.f)
- LaGriT command file [input.boron.3dtet](../../input.boron.3dtet)
- LaGriT command file [input.boron.3dhex](../../input.boron.3dhex)
### 2. Gyroscope function
This function fadpt_gyro.f, has large second derivatives near three rings of unit diameter which are aligned with
each of the three coordinate planes which pass through the origin. Adaption to this function results in the pulling of the grid towards the
rings when running the following two input decks:
input.gyro.3dtet. This deck generates and adapts a tetrahedral mesh to the "gyroscope" function. A snapshot of the adapted grid may be seen at <a href="https://lanl.github.io/LaGriT/assets/images/gyro.png"> gyro.png </a>
input.gyro.3dhex. This deck generates and adapts a hexahedral mesh to the "gyroscope" function. A snapshot of the adapted grid may be seen at <a href="https://lanl.github.io/LaGriT/assets/images/gyro.hex.png"> gyro.hex.png </a>
- Fortran subroutine [fadpt_gyro.f](../../fadpt_gyro.f)
- LaGriT command file [input.gyro.3dtet](../../input.gyro.3dtet)
- LaGriT command file [input.gyro.3dhex](../../input.gyro.3dhex)

View File

@@ -0,0 +1,51 @@
---
title: READ
---
# READ
This command reads data or a mesh into the active Mesh Object.
AVS, LaGriT, and GMV formats are supported.  The other formats may
be used, but no guarantees are made about their capabilities.
**[read/ avs](../read_avs.md)** read AVS UCD format files
**[read/ lagrit](../read_lagrit.md)** read lagrit restart file with mesh object defined
**[read/ gmv](../read_gmv.md)** read General Mesh Viewer GMV format files
**[read/ gmvfreeformat](../read_freeformat.md)** ascii gmv files to be read with read(*)
**[read/ sheetij](../read_sheetij.md)** read elevations into quad surface
**[cmo / readatt/...](cmo/cmo_readatt.md)** read tabular data spreadsheet style into node attributes
**[read/ zone or zonn or zone_element](../read_fehm_zone.md)** read node numbers from zone or zonn file
**[read/ gocad](../read_gocad.md)** read GOCAD file, single instance of mesh only
**[read/ iges_grid](../read_iges_grid.md)** IGES file with surfaces, curves, points in NURBS format
**[read/ ngp](../read_ngp.md)**
**[read/ vrml](../read_vrml.md)**
**[read/ datex](../read_datex.md)**
## EXAMPLES
```
read / avs / myfile / mesh_object_name
read / myfile.inp / mesh_object_name
read / mesh.gmv / mesh_object_name
```
Short form syntax does not require file type as the second token. This is supported for the suffixes **`avs inp gmv lg lagrit`**
See links to various formats for more detailed explanations and examples.

View File

@@ -0,0 +1,78 @@
---
title: RECON
tags: recon, Delaunay
---
# RECON
----------------------
This command flips connections in the mesh to get restore the Delaunay criterion or to improve element shapes.
The standard method used by **`recon`** is to flip connections based on the in-sphere test (the circumsphere of a tetrahedral element should contain no other nodes). Additional flipping criteria are available.
## SYNTAX
<pre>
<b>recon</b> / [<b>1</b> or <b>0</b>] / [damage] / [<b>checkaxy</b>]
</pre>
**`0`** or no arguments is the default and specifies that no points are to be added on the boundaries.
**`1`** adds points on the boundaries if needed to make Delaunay (recommended for 2D meshes only).
If `damage` is specified then flips on exterior boundaries are checked to verify that the maximum depth of deformation of the external boundary does not exceed the value of `damage`. The default value of damage is 1% of the problem size. This setting prevents connecting across corners if the external boundary is a reflective box.
If **`checkaxy`** is provided, then 2D flips are suppressed if the new triangles would have xy-projected areas less than EPSILONA.
### Additional Settings
<pre>cmo/setatt//ivoronoi/-2</pre>
The Minimum Error Gradient Adaption (mega) can be invoked by changing the value of the mesh object variable **ivoronoi** to -2. The effect of this option is to generate well shaped elements; however the grid will not be Delaunay.
<pre>cmo/setatt//ivoronoi/ 2</pre>
If the user has a function to used for adaptive reconnection this option is available by setting the code variable **ivoronoi** to 2. The user will have to supply an external function.
<pre>cmo/setatt//ivoronoi/ 5</pre>
**`recon`** is called by other LaGriT commands such as **`massage`**. To disable **recon** set **ivoronoi** to 5.
<pre>cmo/setatt//iopt2to2/ 0</pre>
**recon** will by default reconnect across interface edges. To restrict reconnection to interior faces and exterior boundary faces, set **iopt2to2** to 0.
## EXAMPLES
```
recon
```
attempt to restore Delaunay
```
recon / 1
```
for 2d meshes add nodes on boundaries to guarantee Delaunay
```
recon / / .001
```
reconnect limit interface and boundary damage to a maximum of .001
```
recon/0/ .001 / checkaxy
```
for 2d meshes reconnect, limiting damage to a maximum of .001 and preventing creation of any negatively oriented or small triangles (with respect to the xy-plane).

View File

@@ -0,0 +1,354 @@
---
title: REFINE
tags: refine, junction, addpts, rivara, interface
---
# REFINE
---------
The refine command is used to create more elements. The method in which these new elements are formed is based on the `refine_method`
chosen. The refine criteria used in these methods are defined at [Grid Refinement](../REFINE1.md) Section.
## SYNTAX
<pre>
<b>refine</b>/refine_method/ [field]/ [interpolation]/refine_type /ifirst,ilast,istride/xvalue/xvalue2/xvalue3/inclusive_flag/
<b>refine/roughness</b> ///<b>edge</b>/ifirst,ilast,istride/distance/surface_name/<b>exclusive</b> or <b>inclusive</b>
<b>refine/edge_list</b> ///<b>edge</b>/ end_points
<b>refine/interface</b> /// <b>edge</b>/pset,get,psetname
<b>refine</b> / <b>eltset</b> or <b>element_set</b> / eltset,get,esetname
</pre>
### Refine Methods
**`junction`** will refine object where `field` crosses `xvalue`
**`constant`** will refine object where `field` &gt; `xvalue`
**`delta`** will refine object where delta(`field`) &gt; `xvalue`
**`lambda`** will refine object where lambda(`field`) &lt; `xvalue`
**`maxsize`** will refine object where object &gt; `xvalue`. Size refers to volume for tets, area for face, and length for edges.
**`aspect`** will refine where aspect ratio &lt; `xvalue`
**`addpts`** will refine explicitly by adding a set of nodes defined in pset,get,psetsname
**`rivara`** edges longer than `xvalue` will be refined according to the principle that a refined edge candidate is the longest edge in
any element that contains it. This results in a recursive refinement procedure that adds neighboring edges to the refinement
candidate list until no neighbor edge is longer then the candidate. `refine_type` must be **edge**. Arguments `field` and
**interpolation** are ignored. This method of refinement, when used with a **pset**, produces a nicely graded mesh.
**`rivara_boundary`** applies the rivara algorithm, but will only bisect edges on external boundaries.
**`rivera_truncated`** applies the rivara algorithm, but restricts the neighborhood search to the edges in the selected **pset**. If the
**pset** is the entire mesh, this method has the same behavior as rivara.
**`roughness`** will refine based on the distance of the endpoint of an edge to the plane determined by the synthetic normal with
respect to a specified surface at the other endpoint of the edge. This is intended to increase refinement on surfaces near corners
or around sharp bends in surfaces. `xvalue` is the distance, the `surface_name` must follow the `xvalue` distance argument.
**`edge_list`** will bisect a set of edges specified by the node numbers of the endpoints of the edges. refine_type must be
**edge** followed by a list of `end_points` making up the edge_list.
**`element_set`** or **`eltset`** will refine all elements in a specified element set. The mesh object may be tri, quad, tet or
hex. Internally a node set will be created from the chosen elements. Because of the conversion from element set to point
set, it is possible that some element not in the original element set will have all of its nodes as members of the internally
constructed points set and hence will be refined. The default refine_method is **`constant`**; refine_type is element;
inclusion_flag is **`exclusive.`** Their are no other arguments after the element set name.
**`interface`** will bisect a set of non-interface edges of tets all of whose vertices are interface nodes. Valid only for 3D
tetrahedral grids and is useful to 'unlock' tetrahedra that are stuck because all of their vertices lie on interface surfaces. 
After the refine operation these tetrahedral will be replaced by tetrahedra containing a vertex that is not on the surface - thus
allowing later smooth or massage operations more freedom to improve the grid.
The following are unavailable or untested:
**`spawn`** spawns new nodes at the locations given. It finds the existing edge that is closest to the
desired node It then refines that edge and moves the resulting node to the desired location provided that the move does not invert any elements.
**`cel`** calls CEL (create on edge length). Takes a mesh object and bisects edges that
(i) have both endpoints in the list of selected mass points, and (ii) have length greater than TOLLENGTH.
The process is recursive in that new nodes are added to the list of mass points, meaning that newly created edges can
be refined until all the edges in the mesh have length less than TOLLENGTH.
This leads to recursive refinement with nondegrading element aspect ratios.
**`minsize`**, **`lambdade`**, and **`rmelements`** are no longer supported.
### Refine Type
refine_type specifies what object will be refined and how that object will be refined:
- **element** or **tet** in 3D will refine elements by placing a point in the center of the element.
- **element** in 2D (triangle) will refine element by refining all edges of the triangle.
- **face** in 3D will refine facets by placing a point in the center of the facet.
- **face** in 2D (triangle) will refine face by refining all edges of the face.
- **edge** will refine edges by placing a point on the midpoint of the edge.
- **faceedge** will refine facets by refining all edges of the facet.
- **tetedge** will refine elements by refining all edges of the element.
### Refine Options
`field` must refer to a previously defined attribute of the current Mesh Object.
`interpolation` specifies how to interpolate the `field` to give `field`
values to the new nodes created. The valid types are **linear, log**, and **sinh**.
`range` is the selection of points designated by node numbers for ifirst,ilast,istride or **pset**,get,pname. 1,0,0 will select all
nodes in the Mesh object.
`xvalue` [/`xvalue2/xvalue3`/] is the real number usually indicating a size for the different refine methods. Most of the refine methods do not
use the second and third values so their argument positions will be empty ///.
`inclusion_flag` is an optional flag specifing if refinement is an inclusive or an exclusive operation. By default, all operations are
exclusive. For inclusive, if an edge refinement is specified restricted to a **pset**, then an edge is eligible for refinement if either
or both of the end points belong to the **pset** selected. If the `inclusion_flag` is exclusive then both end points must be in the
**pset**. The implemented values are **inclusive** and **exclusive**.
## QUADTREE and OCTREE REFINEMENT
Quad and hexahedral elements may be refined creating quad tree and octree meshes. Three new Mesh object attributes are added during this
operation. The refine_type must be element. The refine_method must be constant, junction or maxsize.
The values for /`xvalue/xvalue2/xvalue3`/ should be /-1.,0.,0./. For an element set, use
the shortened syntax refine/element_set/eltset,get,esetname.
The element attributes added to the Mesh object are:
**itetlev** is an integer attribute with the level of refinement. An unrefined mesh element has itetlev(ie)=0, one level of refinement itetlev(ie)=1, etc.
**itetkid** is a pointer to a child element number. If nothing has been done to change element numbering, it is element number of the
first child element created and the rest of the children are in sequence after the first child. If itetkid(ie)=0 , the element has
not been refined further.
**itetpar** is a pointer to the parent element at refinement level. itetlev(ie)-1.
Quad meshes will have 4 children for each refined element. Hex meshes will have 8 children. The children are generated sequentially; The
first child will contain the first local node of the parent element, the other elements are created in the order shown in this diagram.
For example in the picture below, element e1 is refined to create 8 children, c1, c2, c3, c4, c5, c6, c7, c8.
The table gives the octree attribute values for each of the elements.
<img width="400" src="https://lanl.github.io/LaGriT/assets/images/dsquare.gif">
| Element # | itetlev | itetkid | itetpar |
| :-------: | :------ | :------ | :------ |
| c1|1|0|2|0 |
| c1|2|1|0|1 |
| c2|3|1|0|1 |
| c3|4|1|0|1 |
| c4|5|1|0|1 |
| c5|6|1|0|1 |
| c6|7|1|0|1 |
| c7|8|1|0|1 |
| c8|9|1|0|1 |
One can control refinement so that a hex is broken into either 8, 4 or 2 elements and a quad is broken into either 4 or 2 elements. This is
controlled with the principal refine direction choice `prd_choice` parameter. This syntax works assuming imt values are greater or equal
to zero with principal refine direction chosen through a combination of "123" `prd_choice` indicators as defined below. The command line
used is:
```
refine/constant/itetclr/linear/element/1,0,0/-1.,0.,0./exclusive/amr prd_choice
```
or with element selection (based on pset and inclusive/exclusive options):
```
refine/constant/imt1/linear/element/pset,get,pname/-1.,0.,0./inclusive/ amr prd_choice
```
The parameter `prd_choice` indicates the chosen principal refinement direction based on the local hex element topology as defined by edge numbers,
for instance, quad edge 1 is in the x direction relative to the local topology.
- **1** refine along x direction, 1 hex-&gt;2 hex, 1 quad-&gt;2 quad (quad edges 1 and 4)
- **2** refine along y direction, 1 hex-&gt;2 hex, 1 quad-&gt;2 quad (quad edges 2 and 3)
- **3** refine along z direction, 1 hex-&gt;2 hex, 1 quad-&gt;4 quad
- **12** refine along x and y direction, 1 hex-&gt;4 hex, 1 quad-&gt;4 quad
- **13** refine along x and z direction, 1 hex-&gt;4 hex, 1 quad-&gt;4 quad
- **23** refine along y and z direction, 1 hex-&gt;4 hex, 1 quad-&gt;4 quad
- **123** refine xyz with prd amr routines, 1 hex-&gt;8 hex, 1 quad-&gt;4 quad
- **0** refine xyz with default amr refinement, 1 hex-&gt;8 hex, 1 quad-&gt;4 quad
## EXAMPLES
```
pset / prefine / union / prefine1 prefine2 prefine3
eltset / erefine / inclusive / pset get prefine
refine/ eltset / eltset,get,erefine
```
will octree refine hex elements belonging to the set of points named prefine
```
refine / maxsize ///edge /pset,get,something / .25
```
will refine element where edge is longer than .25
```
refine/constant/concentration/log /edge/1,0,0/25.0 /// inclusive
```
will refine where concentration is greater than 25.
```
refine /addpts///tet /pset,get,newpoints/
```
refine explicitly by adding the new nodes defined in the set newpoints
```
refine /rivara///edge/pset,get,p1/.5///inclusive
```
refine all edges containing at least one node in pset p1 that are longer than .5.
Using the 'rivera' algorithm may result in edges not containing nodes in the pset to be refined.
```
refine/rivara_truncated///edge/pset,get,p1/.5///exclusive
```
rivera_truncated, exclusive will refine only edges both of whose endpoints are in the selected pset named p1
```
refine/rivara_boundary///edge/1,0,0/.25
```
rivara_boundary will only refine boundary edges.
```
refine/roughness///edge/1,0,0/.28/ptop/inclusive
```
will refine based on .28 distance to the surface named ptop.
```
refine/edge_list///edge/1 2 23 47
```
will refine the edge with end points 1 and 2 AND the edge with end points 23 and 47.
```
eltset / elem3 / id_elem1 / eq / 3
refine/eltset / eltset,get, elem3
```
will create a node set from the element set named elem3 and refine using the constant option.
```
refine/constant/imt1/linear/element/pset,get,pbox/-1.,0.,0./inclusive
```
create a quadtree refined quad mesh
```
eltset / elm2 / itetclr / eq / 2
pset/ pelm2 / eltset elm2
refine/constant/imt1/linear/element/pset,get,pelm2/-1.,0.,0./inclusive/amr 12
```
refine the material 2 elements of a hex mesh , do not refine in the Z vertical direction
```
refine/constant/imt1/linear/element/pset,get,pelm2/-1.,0.,0./inclusive/amr 3
```
refine the material 2 elements of a hex mesh , refine only in the Z vertical direction
## Octree Example with loop
Use a loop to refine up to itetlev = 3 but not 4. This will select elements with itetlev < 3 to refine.
```
* Refine to octree itetlev= 3 elements that are intersected by cmo_3
*
define / CMO_OBJ / cmo_3
define / LEVEL / 3
define / LOOP_MAX / 4
*
loop / do / LOOP_VAR 1 LOOP_MAX 1 / loop_end infile refine_object.mlgi
```
The loop uses this infile refine_object.mlgi
<pre>
****************************************
*
* Refine based on intersection with object
*
****************************************
* External definitions
*
* CMO_HEX - Mesh object to be intersected
* CMO_OBJ - Mesh object that intersects CMO_HEX
* LEVEL - refine level 0, 1, 2, 3, ...
*
****************************************
*
cmo / printatt / CMO_HEX / -xyz- / minmax
cmo / printatt / CMO_OBJ / -xyz- / minmax
*
*
* Refine elements that are intersected by CMO_OBJ
*
cmo / setatt / CMO_HEX / xsect / 1 0 0 / 0
intersect_elements / CMO_HEX / CMO_OBJ / xsect
cmo / select / CMO_HEX
eltset / e_obj / xsect / gt / 0
*
* Add this just in case. If it already exists, nothing
* will happen. If it does not exist, it gets added and set to zero
*
cmo/addatt/CMO_HEX/itetlev/vint/scalar/nelements
*
eltset / elev / itetlev / le / LEVEL
eltset / e_refine / inter / elev e_obj
*
refine/eltset / eltset,get, e_refine
rmpoint / compress
eltset / e_obj / delete
eltset / e_refine / delete
****************************************
cmo / select / CMO_HEX
cmo / printatt / CMO_HEX / itetlev / minmax
*
finish
</pre>

View File

@@ -0,0 +1,130 @@
---
title: REGION
tags: region, mregion, surface
---
# REGION
------------------
Define a geometric region from a set of surfaces by logically combining surfaces names.
**`REGION`** is used together with [**`SURFACE`**](SURFACE.md) and [**`MREGION`**](MREGION.md) to set mesh object geometry and materials.
<br>
See Examples below.
Defining a  region will cause the information associated with this geometry region to be stored under the name of the [geometry](../geometries.md) of the current mesh object.  Releasing the region will remove this information.
The defined mesh object geometry can be named with the [**`GEOMETRY`**](geometry.md) command.
## SYNTAX
<pre>
<b>region</b>/ region_name/ region_operators
<b>region</b>/ region_name/ <b>release</b>
</pre>
<br>To define a geometry region, use operators with surfaces according to the following rules.
<br> The operators **or, and**, and **not** mean union, intersection, and complement respectively and are applied to surfaces.
<br> Parentheses are operators and are used for nesting.
<br> Spaces are required to separate operators and parentheses.
<br>
<br>
The operators **lt, le, gt**, and **ge** are applied to mesh object surfaces according to the following rules:
- **lt** if the surface following is a volume then **lt** means inside not including the surface of the volume. If the surface is a plane or a
sheet **lt** means the space on the side of the plane or sheet opposite to the normal not including the plane or sheet itself.
- **le** if the surface following is a volume then **le** means inside including the surface of the volume. If the surface is a plane or a
sheet **le** means the space on the side of the plane or sheet opposite to the normal including the plane or sheet itself.
- **gt** if the surface following is a volume then **gt** means outside not including the surface of the volume. If the surface is a plane or a
sheet **gt** means the space on the same side of the plane or sheet as the normal not including the plane or sheet itself.
- **ge** if the surface following is a volume then **ge** means outside including the surface of the volume. If the surface is a plane or a
sheet **ge** means the space on the same side of the plane or sheet as the normal including the plane or sheet itself.
Internal interfaces should be included in exactly one region (using **le** and **ge**).
<br>
In the event of conflicting region commands, the one occurring last in the input stream takes precedence.
## EXAMPLES
```
region/reg1/ le sphere1 and ( lt plane1 or gt plane2 )
region/reg2/ le sphere1 and ( ge plane1 and le plane2 )
region/reg1/release
```
Define regions named reg1 and reg2 inside sphere1 and relative to plane1 and plane2. Release the regions named reg1.
```
cmo/create/cmo
surface/outside/reflect/box/0,0,0/3,2,1
region/all/le outside
mregion/all/le outside
createpts/xyz/3,3,3/0,0,0/3,2,1/1,1,1
setpts
connect
```
Very simple application of the region and mregion commands to create a single material box shaped mesh.
```
# Define geometry
cmo / select / CMO_IN
geometry / create / stack_geom
# define surfaces for CMO_IN
cmo / select / CMO_IN
surface / s0 /reflect / sheet / mo0
surface / s1 /reflect / sheet / mo1
surface / s2 /reflect / sheet / mo2
surface / s3 /reflect / sheet / mo3
surface / s4 /reflect / sheet / mo4
surface / s5 /reflect / sheet / mo5
surface / s6 /reflect / sheet / mo6
# define geometry regions
# all internal interfaces are defined
# and are included once only
region / r_below / le s0
region / r1 / ge s0 and lt s1
region / r2 / ge s1 and lt s2
region / r3 / ge s2 and lt s3
region / r4 / ge s3 and lt s4
region / r5 / ge s4 and lt s5
region / r6 / ge s5 and lt s6
region / r_above / ge s6
# define material regions
# internal interfaces not included
mregion / mr_below / lt s0
mregion / mr1 / gt s0 and lt s1
mregion / mr2 / gt s1 and lt s2
mregion / mr3 / gt s2 and lt s3
mregion / mr4 / gt s3 and lt s4
mregion / mr5 / gt s4 and lt s5
mregion / mr6 / gt s5 and lt s6
mregion / mr_above / gt s6
# Finished building geometry
```
Define geometry and material regions based on surface grids read into mesh objects named mo0, mo1, ... mo6.
The result are regions stacked in layers such that nodes found equal to surface s0 are the interface nodes between regions r1 and r2.
Nodes between surfaces s0 and s1 are in region r1 and have the material labeled mr1. And so on.
This mesh geometry has the name stack_geom.

View File

@@ -0,0 +1,135 @@
---
title: "REGNPTS"
tags: regnpts, create points, ray shooting
---
# REGNPTS
-----------------------
Generates points in a region previously defined by the region command. The points are generated by shooting rays through a user specified set of points from an origin point, line, or plane and finding the intersection of each ray with the surfaces that define the region.
The region must exist for the current mesh object and defined with surfaces using [**`SURFACE`**](SURFACE.md) and [**`REGION`**](REGION.md) commands.
Points are distributed on boundaries if the region was defined using **ge** or **le** to define the interface or boundary.
Only surface intersection points are created if `ptdist` is a keyword as defined below.
If another region intrudes upon the regnpts region so that the regpts region is divided into more than one piece, points that fall inside the intruding region are not distributed.
## SYNTAX
<pre>
<b>regnpts</b>/region_name/ptdist/ifirst,ilast,istride/geom/ray_points /irratio,rrz,maxpenetr
<b>regnpts</b>/region_name/ptdist/ifirst,ilast,istride/<b>xyz</b>/x1,y1,z1/x2,y2,z2/x3,y3,z3/irratio,rrz/maxpenetr
<b>regnpts</b>/region_name/ptdist/ifirst,ilast,istride/<b>rtz</b>/x1,y1,z1/x2,y2,z2/irratio,rrz/
<b>regnpts</b>/region_name/ptdist/ifirst,ilast,istride/<b>rtp</b>/xcen,ycen,zcen/irratio,rrz,maxpenetr
<b>regnpts</b>/region_name/ptdist/ifirst,ilast,istride/<b>points</b>ifirst2,ilast2,istride2/irratio,rrz/ maxpenetr
</pre>
`region_name` must exist for the current mesh object as described above.
`ifirst,ilast,istride` are the points to shoot rays through. The range 1,0,0 means all points, a named set may also be used with **pset**,**get**,psetname.
### Actions Based on `pdist` Type
If `ptdist` is a one of the keywords **inside**, **in**, **out**, **outside**, or **both** surface points are created regardless of region ownership of the interface or boundary surface -- if a ray encounters a region more than once, the appropriate surface intersection point(s) is generated for each encounter.
If `ptdist` if a real value, then points are distributed at that distance along the ray, up to a maximum of `maxpenetr` points along the ray (in addition to any interface points that may be created). If the ray encounters a region more than once, multiple sets of points are generated.
`irratio` / `rrz` is ignored when `ptdist` is a real value.
If `ptdist` is an integer, then that many points are evenly distributed along the ray in the region.
`irratio` / `rrz` defines the ratio zoning used to distribute the points.
- `irratio` = 1: the point distribution is adjusted so that the ratio between successive pairs of points is rrz.
- `irratio` = 2: points are distributed by equal volumes depending on the geometry type.
- `irratio` = 3: ratio zoning is calculated on the longest ray; then this length is applied to all the rays.
### Ray Start Based on `geom`
**`xyz`** shoot rays from normal of plane defined by cartesian coordinate points 1, 2, and 3.
**`rtz`** shoot rays perpendicular from the cylinder line defined at point 1 to point 2.
**`rtp`** shoot rays from spherical center from the given point.
## EXAMPLES
```
region/top/ ge pbot and le ptop and ge plft and le prgt &
and ge pbck and le pfrt and gt cutplane /
regnpts/top/3/pset,get,rayend/xyz/0.,0.,-.1/0.,1.,-.1/1.,1.,-.1/0,0/
```
Create rays between points in rayend and the plane. Distribute 3 points along these rays in the region top
add one point at the upper external boundary for each ray.
Then add one point at the upper external boundary for each ray.
```
regnpts/InWF_SOIL_REGION/10/pset,get,InWF_SOIL_RAYEND/rtz/-0.5000000,42.42380,2 &
9.98730/-0.5000000,82.67780,29.98730/-0.5000000,82.67780,100.0000/0,0/ `
```
Create cylindrical points in region defined as InWF_SOIL.
```
# define surfaces
surface/lay1/intrface/plane/ 0 0 119 / 10 0 119 / 10 100 119
# create regions
region/reg1/ le box1 and le lay1
# create ray end points
createpts/xyz/ 1 3 14 / -5 0 0 / -5 100 119 / 1 1 1
pset/rayend/seq/1 0 0
# remove duplicate points if they exist
filter/1,0,0 ; rmpoint/compress
# shoot points into volume in region reg1
regnpts/reg1/100/pset get rayend/xyz/ 300 0 0/ 300 10 0/ 300 10 1/ 1 1.
# remove ray end points
rmpoint/pset get rayend
filter/1,0,0
rmpoint/compress
# color point imt and connect
setpts
connect
```
Typical set of commands using regions and ray shooting to create a mesh.
Click here for [Examples](../demos/main_regnpts.md)
Click here for [Tutorial](https://lanl.github.io/LaGriT/pages/tutorial/tutorials/regions_points_to_tet.html) using ray shooting methods

View File

@@ -0,0 +1,37 @@
---
title: REORDER
tags: reorder, sort
---
# REORDER
-------
This command will reorder a mesh object according to a designated permutation vector. This can be used after the [**`SORT`**](SORT.md) command to reorder a mesh based on a sort key.
The command will decide to reorder nodes or elements based on the length of the permutaion vector. When elements are reordered all
element attributes are also reordered. Mesh object arrays **itet** and **jtet** are updated. When nodes are reordered, all node based attributes are
also reordered. Permanent mesh object attribute arrays such as **isn** are also updated.
## SYNTAX
<pre>
<b>reorder</b>/mo_name/sort_key/
<b>reorder / -def- </b> /sort_key/
</pre>
`sort_key` is the permutation vector - i.e. an integer node/element based mesh object attribute.
The permutation attribute can be any integer vector nnodes or nelements long with min value = 1, max value = nnodes/nelements and no repeated entries.
## EXAMPLES
```
createpts / median
sort/ mo_pri /index/ascending/ ikey /itetclr xmed ymed zmed
reorder / mo_pri / ikey
```
sort and reorder the mesh mo_pri based on itetclr values and cell center location xmed, ymed, zmed. This will arrange into columns (after itetclr sort).

View File

@@ -0,0 +1,84 @@
---
title: RESETPTS
tags: resetpts, itp
---
# RESETPTS
-----------------------
Reset values for node **imt** material color, **itp** type, or **isn** parent-child for doubly defined nodes.
## SYNTAX
<pre>
<b>resetpts</b>
<b>resetpts/parent</b>
<b>resetpts/itp</b>
<b>resetpts/cell_color</b>/ [1,0,0 or integer_node_color]
</pre>
**`resetpts`** or **`resetpts/parent`** remove child points. the parent child flags are reset. All child points are eliminated and the connectivity list **isn** is corrected to reference only the parent points.
This parent-child relationship is established by the **`settets`** command.
**`resetpts/itp`** set node type **itp** from connectivity of the mesh object.
The node **itp** (also known as **itp1**) array is reset to indicate whether
each node is in the interior (0), on an interior interface (2), on a
reflected boundary (10), or on a reflected interface boundary (12) .
It is good practice to update this array anytime the mesh object is changed, or to be certain that boundary and interfaces are correctly set for a command that depends on it.
**`resetpts/cell_color/`** set node **imt** values from element colors **itetclr**.
- If no arguments are given, then, loop through all itetclr values in ascending order, and reset node **imt** to associated element **itetclr** value. Note that if parent-child nodes do not exist, then an interface node will have its **imt** value set to the largest value of **itetclr** of all elements that contain this node.
- `1,0,0` is the range of element **itetclr** values itetclr_min, itetclr_max, itetclr_stride where 1,0,0 means all. This will loop through and reset node **imt** values. Node colors are reset only for nodes in elements that fall in the range selected.
- `integer_node_color` reset node **imt** for nodes with **imt** equal to integer_node_color, use the itetclr of the element containing the node. Only nodes with node color **imt** equal to this value will be set to its element **itetclr** value.
This will introduce a bias since the nodes are modified in the order of the element numbering. To give some
control over the bias the user can specify a negative value for `integer_node_color`. In that case, the element loop is reversed and goes from largest to smallest element number.
## EXAMPLES:
```
resetpts/itp
```
Set node type array **itp** from connectivity of mesh includes outside boundary and interior interface nodes based on **itetclr** values.
```
resetpts/cell_color/ 1
```
Replace node color for nodes that currently have imt value of 1 by the cell color of an element containing the node; this is done by looping through all the elements in cell color order, so that the value of imt will be the largest itetclr of the set of elements containing this node.
```
resetpts/cell_color/
resetpts/cell_color/ -1
resetpts/cell_color/1,3,1
```
Thi first command will loop through all element colors and reset all node imt values and replace node color for nodes that currently have imt value of 1 by the cell color of an element containing the node; this is done by looping through all the elements in desending cell color order, so that the value of imt will be the smallest itetclr of the set of elements containing this node.
The second command does the same thing as the first, in reversed order.
The third command loops through colors from itetclr=1 to itetclr=3.
```
cmo/select/cmotet
resetpts/parent
rmpoint compress
filter/1,0,0
```
These commands will reset double defined nodes in a mesh to be singly defined. This is used when writing mesh files for applications that can not handle duplicate nodes. This will reset the parent-child arrays, then remove duplicate nodes from the mesh object records so they are not written to files.

64
docs/pages/docs/commands/RM.md Executable file
View File

@@ -0,0 +1,64 @@
---
title: RM
tags: rm, remove
---
# RM
------------------
Removes any points that are within the specified point range and specified volume of space.
This command is seldom used but included here for backward compatibility.
A more typical set of commands for removing points is the combination of [**`PSET`**](PSET.md) with [**`RMPOINT`**](RMPOINT.md)/pset,get,pname.
Note that the points that are removed become dudded out (point **itp** set to 21) and are not removed from the mesh object data arrays.
## SYNTAX
<pre>
<b>rm</b> / <b>xyz</b> /ifirst,ilast,istride/xmin,ymin,zmin/xmax,ymax,zmax/ [xcen,ycen,zcen]
<b>rm</b> / <b>rtp</b> /ifirst,ilast,istride/ r1,t1,p1 / r2/t2/p2/ [xcen,ycen,zcen]
<b>rm</b> / <b>rtz</b> /ifirst,ilast,istride/ r1,t1,z1 / r2,t2,z2/ [xcen,ycen,zcen]
</pre>
### Geometry Options
**`xyz`** Cartesian coordinates defined by minimum and maximum of the coordinates.
**`rtp`** Spherical coordinates defined by the center point.
The sperical shell or sperical section given by radius r1 to r2, and angles theta t1 to t2 and angles phi p1 to p2.
The value of theta is the angle with respect to the Z-axis and phi is the angle in the XY-plane with respect to the X-axis.
**`rtz`** Cylindrical coordinates defined by the center line points.
The cylinder or cylindrical shell given by radius r1 to r2, angle theta t1 to t2 and height z1 to z2.
The value of theta is the angle in the XY- plane with respect to the x-axis.
In cylindrical coordinates the cylinder always lines up along the z axis; use the **coordsys** command before issuing the **rm** command if the points
to be removed are not aligned with the z-axis; then issue a final **coordsys** command to return to normal.
`ifirst,ilast,istride` is the selected point set range where 1,0,0 means all. The **pset,get**, pname convention can be used.
## EXAMPLES
```
rm/ xyz /1,0,0/ 2.,2.,2./4.,4.,4./ 0.,0.,0.
rm/ rtz /1,0,0/ 0.,0.,0./1.,360.,10./ 0.,0.,0.
```

View File

@@ -0,0 +1,55 @@
---
title: RMMAT
tags: rmmat, remove material
---
# RMMAT
-----------------
This routine is used to remove points that are of a specified material value (**itetclr** for elements or **imt** for nodes). Elements with the specified material value are
flagged by setting the element material type negative. They are not removed from the mesh object.
Remove the dudded elements and update the mesh object arrays with the command [**`RMPOINT/compress`**](RMPOINT.md).
## SYNTAX
<pre>
<b>rmmat</b>/material_number/
<b>rmmat</b>/material_number/[<b>all</b> or <b>node</b> or <b>element</b>]/ [<b>exclusive</b>]
</pre>
`material_number` is the **itetclr** integer value to remove from the mesh object. Elements with the itetclr=material number are flagged by setting the element material value negative.
**`no arguments`** or **`all`** removes nodes with imt = material number and removes elements with itetclr= material number.
**`node`** removes nodes with imt = material number.
**`element`** removes elements with itetclr= material number.
**`exclusive`** removes everything except nodes with imt =material and removes everything except elements with itetclr= material number.
## EXAMPLES
```
rmmat/ 2
rmpoint/compress
```
Tag elements in mesh object with material values of 2 then remove elements and update the mesh object.
Click here for [Examples](../demos/main_rmmat.md)

View File

@@ -0,0 +1,89 @@
---
title: RMPOINT
tags: rmpoint
---
# RMPOINT
---------------------
Tag or remove nodes and elements from a mesh.  
Dudded nodes, or nodes marked for removal have their  itp array mareked with **ifitpdud** (21).
Dudded elements have a negative value for the first entry in the **itet** vertex list. 
The tagged mesh object nodes and elements are treated as invisible until they are removed from the mesh object. 
## SYNTAX
<pre>
<b>rmpoint</b>/ifirst,ilast,istride/[<b>exclusive</b> or <b>inclusive</b> ]
<b>rmpoint</b>/<b>compress</b>/
<b>rmpoint/zero_volume</b>/threshold
<b>rmpoint/element</b> [tet_list or <b>eltset,get</b>,esetname]
<b>rmpoint/womesh</b>
<b>rmpoint/sparse</b>
</pre>
`/ifirst,ilast,istride` / [**exclusive** or **inclusive** ] does not remove but marks the selected nodes and elements for removal.
If **exclusive** (default), an element is marked only if all of its nodes are in the selection. If **inclusive**, any element with a node from the selected set will be marked.  
**`compress`** remove and update all tagged nodes and elements. This will update arrays and material-wise resequences all remaining nodes. This will change the node ordering and numbers of the mesh.
**`zero_volume`** will remove elements whose volumes are less than or equal to the specified `threshold`. 
**`element`** will remove all marked (negative **itet**) elements from the mesh. Elements can be specified by a `tet_list` or **eltset,get**,esetname.
**`womesh`** will delete stray nodes that are not connected to any element and that are not parent nodes.
**`sparse`** is to be used with caution and requires reconnection when done.
## EXAMPLES
```
rmpoint/ pset,get,pset1
rmpoint/compress
```
Mark all the nodes in pset1 for removal.  Remove elements all of whose vertices are members of pset1.
Remove all marked nodes and update the mesh object arrays.
```
rmpoint/zero_volume/1.e-16
rmpoint/compress
```
Remove all elements with volumes less than 1.e-16
```
rmpoint/element/27 259 1009
rmpoint/compress
```
Remove the three specified elements
```
rmpoint/element/eltset,get,e_mat1
rmpoint/compress
```
Remove the elements in the element set named e_mat1

View File

@@ -0,0 +1,33 @@
---
title: RMREGION
tags: rmregion
---
# RMREGION
---------------
Removes points that lie within the specified region. See [**`REGION`**](REGION.md).
## SYNTAX
<pre>
<b>rmregion</b> / region_name /
</pre>
`region_name` is the name of the previously defined geometry region.
## EXAMPLES
```
surface/insurf/intrface/sphere/0.,0.,0./.1/
region/sph_inside/ le insurf /
rmregion/sph_inside
rmpoint/compress
resetpts/itp
```
Remove nodes and elements defined by the sphere shaped region sph_inside.
First the region nodes are marked for removal, rmpoint/compress removes the marked nodes. The command resetpts/itp updates the itp boundary array.

View File

@@ -0,0 +1,35 @@
---
title: RMSPHERE
tags: rmsphere
---
# RMSPHERE
---------------
Removes a sphere of points from a point distribution.
## SYNTAX
<pre>
<b>rmsphere</b> / inner_radius/ outer_radius/ xcen,ycen,zcen/
</pre>
`inner_radius` and `outer_radius` are the distances from sphere center point.
`xcen,ycen,zcen` is the sphere center point.
## EXAMPLES
```
rmsphere / 0. .1 / 0. 0. 0.
rmpoint/compress
resetpts/itp
```
Remove nodes and elements defined by the sphere at zero coordinates and within a distance of .1.
First the nodes are marked for removal, rmpoint/compress removes the marked nodes. The command resetpts/itp updates the itp boundary array.

View File

@@ -0,0 +1,36 @@
---
title: RMSURF
tags: rmsurf
---
# RMSURF
---------------
Removes points that lie in, on or in and on the specified surface.
The surface must be defined for the current mesh object, see [**`SURFACE`**](SURFACE.md).
## SYNTAX
<pre>
<b>rmsurf</b> / surface_name / operation
</pre>
`surface_name` is the name of the previously define surface.
`operation` can be one of the following:
- **lt** only points inside the surface are removed
- **eq** only points on the surface are removed
- **le** all points inside or on the surface are removed

View File

@@ -0,0 +1,77 @@
---
title: ROTATELN
tags: rotateln, rotate line
---
# ROTATELN
----------------------
Rotates a point distribution about a line.
## SYNTAX
<pre>
<b>rotateln</b>/ifirst,ilast,istride/[<b>no</b>]<b>copy</b> / x1,y1,z1/x2,y2,z2/ theta/xcen,ycen,zcen/
</pre>
`ifirst,ilast,istride` is the node range selected by node numbers or pset,get,pname.
**`nocopy`** keeps only the rotated points, the node count does not change.
**`copy`** keeps a copy of the original unrotated points, as well as the rotated points.
The new points will have the rotated coordinate values but no other mesh attributes will be set for these points.
`x1,y1,z1 / x2,y2,z2` are the end points of the rotation line and must extend beyond the boundaries of the selected point set.
`theta` in degrees is the angle of rotation whose positive direction is determined by the right-hand-rule, that is, if the thumb of your right hand points in the direction of the line (1 to 2), then your fingers will curl in the direction of rotation.
`xcen,ycen,zcen` is the point where the line can be shifted to before rotation takes place.
## EXAMPLES
```
define / SIZE / 10.0
cmo / create / mo01 / / / hex
createpts / xyz / 2, 2, 10 / 0, 0, 0 / SIZE, SIZE, SIZE / 1 1 1
rotateln / 1 0 0 / nocopy / 0 0 0 / 0 0 5 / 90 / 0, 0, 0
```
Create a cube of points and rotate it 90 degrees about the z-axis.
```
createpts/brick/xyz/NX NY NZ /X0 Y0 Z0 / X1 Y1 Z1 /1,1,1
cmo/setatt/mohex imt 1
# Define Degree of rotation around line along y axis
# Color each set after it is rotated
define ROTDEG 20.
rotateln/1,0,0/copy/ 0. 500. 0./ 0. -1. 0. / ROTDEG
pset/ prot1 / seq /0,0,0/
cmo/setatt/mohex/imt/pset,get,prot1 2
define ROTDEG 110.
rotateln/1,0,0/copy/ 0. 500. 0./ 0. -1. 0. / ROTDEG
pset/ prot2 / seq /0,0,0/
cmo/setatt/mohex/imt/pset,get,prot2 3
```
Rotate points using copy to keep each rotation. Blue is the original set of points laying flat along the X axis.
Green is the second rotation of 20 degress.
Red is the third rotation of 110 degrees which includes both the original and second rotations.
<a href="../demos/output/test_rotateln_example.png"> <img width="400" src="../demos/output/test_rotateln_example.png"></a>
## DEMOS
Demo of rotated cylinder in a box: [ROTATELN](../demos/main_rotateln.md)

View File

@@ -0,0 +1,66 @@
---
title: ROTATEPT
tags: rotatept
---
# ROTATEPT
---------
Rotates a point distribution about a point.
<pre>
<b>rotatept</b>/ifirst,ilast,istride/[<b>no</b>]<b>copy</b> /xcen,ycen,zcen/theta/phi
</pre>
`ifirst,ilast,istride` is the node range selected by node numbers or pset,get,pname.
**`nocopy`** keeps only the rotated points, the node count does not change.
**`copy`** keeps a copy of the original unrotated points, as well as the rotated points.
The new points will have the rotated coordinate values but no other mesh attributes will be set for these points.
`xcen,ycen,zcen` is the point center of rotation.
`theta` in degrees is the angle of rotation toward the negative z-axis.
`phi` in degrees is the angle of rotation of the XY plane around the Z-axis, where positive phi is measured from the positive x-axis toward the positive y-axis.
## EXAMPLES
```
define x1 38.
define x2 170.
define y1 17.
define y2 81.
cmo/create/cmosink/ / /quad
quadxy/ 133 65 / x1 y1 0./ x2 y1 0./ x2 y2 0. / x1 y2 0.
rotatept/1,0,0/nocopy/ x2 y1 0./0. -16.5
```
rotate from right lower corner xmax and ymin
```
define XTRANS 55.
define YTRANS 30.
define ROT 30.
trans/1,0,0/0. 0. 0./ XTRANS YTRANS 0./
rotatept/1,0,0/nocopy/0. 0. 0./0. ROT
```
translate then rotate a grid
<hr>
[Click here for demos](../demos/description_rotatept.md)

78
docs/pages/docs/commands/RZ.md Executable file
View File

@@ -0,0 +1,78 @@
---
title: RZ
tags: rz, create points
---
# RZ (deprecated, see [CREATEPTS](createpts.md) )
----------------------
This command adds points to the mesh. It can distribute points
evenly or according to a ratio zoning method.
## SYNTAX
<pre>
<b>rz /xyz rtz rtp</b>/ni,nj,nk/xmin,ymin,zmin/xmax,ymax,zmax/ iiz,ijz,ikz/[iirat,ijrat,ikrat/xrz,yrz,zrz/]
<b>rz/line</b>/np///xmin,ymin,zmin,xmax,ymax,zmax/iiz,ijz,ikz/
</pre>
**xyz** specifies Cartesian coordinates.
**rtz** specifies cylindrical coordinates.
**rtp** specifies spherical coordinates.
**line** this option implies xyz and will distribute n1 nodes from
(xmin,ymin,zmin) to (xmax,ymax,zmaz)
When using the rtz or rtp coordinate systems the center is at
(0,0,0). Use a **trans** command to move the center. For the
**rtz** command, minimum and maximum coordinates are the triplets:
radius from the cylinder's axis, angle in the xy-plane measured from
the x-axis and height along the z-axis. For the **rtp** command
minimum and maximum coordinates are the triplets: radius from the
center of the sphere axis, angle in the zy-plane measured from the
positive z-axis and the angle in the xy-plane measured from the
positive x-axis (see II.a.11). Note that the **rtz** always results
in a (partial) cylinder of points centered around the z axis. Use
the **rotateln** command to orient the cylinder. For example, to
center the cylinder around the y axis, specify the x axis as the
line of rotation in the **rotateln** command.
ni,nj,nk number of points to be created in each direction.
`xmin,ymin,zmin` minimums for coordinates.
`xmax,ymax,zmax` maximums for coordinates.
`iiz,ijz,ikz` if =0 then mins and maxs are used as cell centers, if =1 then mins and maxs are used as cell vertices
`iirat,ijrat,ikrat` ratio zoning switches (0=off,1=on)
`xrz,yrz,zrz` ratio zoning value - distance is multiplied by this value for each subsequent point.
## EXAMPLES
rz /xyz /5,3,10 /0.,2.,0. /5.,6.,2. /1,1,1/
This results in a set of 150 points, five across from x=0. to x=5., 3
deep from y=2. to y=6. and 10 high from z=0. to z=2.
rz/rtz/4,6,11 /0.,0.,0. /3.,360.,10. /1,0,1/
This results in 264 points arranged around the z- axis. There are 3
rings of points at distances r=1., r=2. and r=3. from the z-axis.
There are 11 sets of these three rings of points and heights z=0.,
z=1., z=2.,...,z=10. In each ring there are 6 points where each pair
of points is separated by 60°; note that ijz=0 requests that points be
placed at cell centers, hence the first point will be at 30° not at
0°. Corresponding to r=0, there will be 6 identical points at 11
intervals along the z-axis at heights z=0., z=1., z=2.,...z=10.
**Filter** should be used to remove these duplicate points.

112
docs/pages/docs/commands/RZAMR.md Executable file
View File

@@ -0,0 +1,112 @@
---
title: RZAMR
tags: rzamr, create points
---
# RZAMR (deprecated, see [CREATEPTS/AMR](createpts/CREATEPTSAMR.md) )
----------------------
**RZAMR** uses an octree type refinement applied to an existing hexahedral mesh to all nodes in a specified region.  No additional
elements are kept,  the intention is that the resulting node distribution will be passed to connect to generate a tetrahedra mesh.
## SYNTAX
<pre>
<b>rzamr</b>/region_name/number_of_levels
</pre>
`region_name` is the    name of region to refine.  If blank,  all regions will be refined.  An element will be refined if any node of
the element is in the specified region.
`number_of_levels`    is the number of times the refinement will be performed.  After each level, the code will determine which of
the new nodes are in the specified region and will refine the associated elements.  Default is 1.
 
## EXAMPLES
```
rzamr   
```
refine the entire mesh
```
rzamr /r1/3   
```
refine elements with nodes in the region r1 three times
## DEMO TET MESH
Create a hex mesh, refine with rzamr, connect into a tet mesh.
```
cmo/create/cmo///hex
* define geometry
surface/inside/reflect/box/0,0,0/1,1,1
surface/diag/intrface/plane/0,0,0/1,0,1/1,1,1
region/lin/ le inside and ge diag /
region/rin/ le inside and lt diag /
mregion/mlin/ le in=side and gt diag /
mregion/mrin/ le inside and lt diag /
* distribute nodes
quadxyz/2,2,2/0.,0.,0./1.,0.,0./1.,1.,0./0.,1.,0./ &
0.,0.,1./1.,0.,1./1.,1.,1./0.,1.,1./
* set node types and materials
setpts
* connect up the hex mesh
rzbrick/xyz/2,2,2/1,0,0/connect
* refine the hex mesh
rzamr/lin/1
rzamr/rin/3
* create the tet mesh
cmo/create/cmot///tet
* define geometry again for tet mesh
surface/inside/reflect/box/0,0,0/1,1,1
surface/diag/intrface/plane/0,0,0/1,0,1/1,1,1
region/lin/ le inside and ge diag /
region/rin/ le inside and lt diag /
mregion/mlin/ le inside and gt diag /
mregion/mrin/ le inside and lt diag /
* copy in the nodes from the hex mesh to the tet mesh
copypts/cmot/cmo
cmo/select/cmot
cmo/release/cmo
* reset node types and materials so that setpts will use
* geometry to figure out the correct values
cmo/setatt/cmot/itp/1,0,0/0
cmo/setatt/cmot/imt/1,0,0/0
* set node types and materials
setpts
* connect up the tet mesh
connect
* set element materials
* and create parent/child nodes on interfaces
settets
dump/gmv/gmvtet
finish
```
 

View File

@@ -0,0 +1,91 @@
---
title: RZBRICK
tags: rzbrick
---
# RZBRICK
-------------------
This command is deprecrated, see [CREATEPTS](createpts.md).
Builds a brick mesh and generates a nearest neighbor connectivity matrix. This command is similar to the rz command format except here we
have symmetry flags to input. A second format specifies that a mesh be created and connected.
Use the connect option with **quadxyz** to connect logically rectangular grids.
## SYNTAX
<pre>
<b>rzbrick /xyz rtz rtp</b>/ni,nj,nk/xmin,ymin,zmin/xmax,ymax,zmax/ &
iiz,ijz,ikz/[iirat,ijrat,ikrat/xrz,yrz,zrz/isym,jsym,ksym]
<b>rzbrick /xyz rtz rtp</b>/ni,nj,nk/pset,get,pset_name/<b>connect</b>/
</pre>
### Geometry Options:
**xyz** specifies Cartesian coordinates (default).
**rtz** specifies cylindrical coordinates.
**rtp** specifies spherical coordinates.
### Distribution Options:
`ni,nj,nk` are the number of points to be created in each direction.
`xmin,ymin,zmin` are the minimums for coordinates.
`xmax,ymax,zmax` are the maximums for coordinates.
`iiz,ijz,ikz` 0 or 1 switches:
* if = 0 then mins and maxs are used as cell centers
* if = 1 then mins and maxs are used as cell vertices
`iirat,ijrat,ikrat` ratio zoning switches 0=off (default), 1=on
`xrz,yrz,zrz` ratio zoning value - distance is multiplied by this value for each subsequent point.
`pset,get,pset_name` point set selection given by name
`isym,jsym,ksym` symmetry flags - not documented
<hr>
**Warning: This command does not create a 2D grid, it has memory errors:**
``
rzbrick/xyz/5,10,1/0. 0. 0./10. 20. 0. /1,1,1
``
for 2D this will work:
```
cmo create cmo1///quad
quadxy/ 5 5/ 0. 0. 0. / 20. 0. 0./20. 20. 0. / 0. 20. 0.
rzbrick/xyz/5,5,1/1,0,0/connect
```
## EXAMPLES
rzbrick/xyz/3,2,3/0.,0.,0./1.,1.,1./1,1,1
creates a hex grid 2x1x2 cells in the unit cube
quadxyz/5,7,5/0.,0.,0./1.,0.,0./1.5,0.5,2.0/.5,.2,2.5/-1.,1.5,0./2.0,0.,0.0/2.1,1.9,2.4/-0.2,1.8,2.3/setpts
rzbrick/xyz/5,7,5/1,0,0/connect
creates a hex grid inside the hexahedral specified by the 8 corners passed to quadxyz

101
docs/pages/docs/commands/RZRAN.md Executable file
View File

@@ -0,0 +1,101 @@
---
title: RZRAN
tags: rzran
---
# RZRAN
----------------
This command is deprecrated, see [CREATEPTS](createpts.md).
This routine is used to add random points with a given target spacing to the region of space defined by the input minimum and
maximum coordinate values using the specified geometry (xyz, rtz, or rtp), and the given local origin (specified in xyz coordinates).
Within the bounding geometry, the points are distributed uniformly in space, with the average separation targeted at the input value of
the spacing.  Near the boundaries of the geometry, the uniform distribution is modified slightly in order to create a well defined
outer boundary.  Points are added separately on the corners, edges, and surfaces of the bounding geometry, uniformly randomly
distributed with the same target spacing on each of these boundary objects. Points in the interior are offset by the sepcified edge
protection distance from the exterior.  This separation helps LaGriT's connect algorithm avoid creating artificial "pits" in the
interface surfaces.
## SYNTAX
<pre>
<b>rzran</b> /geom/spacing/ rmin1,rmin2,rmin3 / rmax1,rmax2,rmax3
<b>rzran</b> /geom/spacing/rmin1,rmin2,rmin3 /rmax1,rmax2,rmax3 / &
[ xoff,yoff,zoff / edgedist / ranseed1,ranseed2 ]
</pre>
### Geometry Options for `geom`:
**xyz** specifies Cartesian coordinates (default).
**rtz** specifies cylindrical coordinates.
**rtp** specifies spherical coordinates.
### Options:
`spacing` is the target separation between the random points, values must be &gt; 0 (default is 1).
`rmin1,rmin2,rmin3` / `rmax1,rmax2,rmax3` are the minimum and maximum coordinate values (defaults: rmin=0, rmax=rmin).
For **rtz** rmax2-rmin2 must be &lt;= 360. For **rtp** the values should be rmax2 &lt;= 180, and rmax3-rmin3 &lt;= 360.
All min values must be &gt;= 0.
`xoff,yoff,zoff` is the local origin shift specified in xyz coordinate system (default is 0).
`edgedist` is the edge protection distance (default and recommended: spacing/2).
Note: if the spacing is larger with respect to the dimension of the geometry, the default setting may result in few or no interior
nodes.  In this case decrease the value of edgedist.
`ranseed1, ranseed2` are seeds for the random number generator, the default is -1 (do not re-seed, recommended). If either seed is .le. zero, the seeds are ignored. Recommended values if reseed:
<br>
large-ish integers, ranseed1 > ranseed2 > 0, ranseed2 odd.
<br>
No initial seeds are needed, and repeating the command with the identical parameters and seeds should result
in the identical point distribution. Repeating the command with no seeds specified should result in
different point locations with the same distribution.
<hr>
 
## EXAMPLES
rzran / xyz / .1 / 0 0 0 / 1 1 1 /
random points with target spacing 0.1 in a 1x1x1 box
rzran/ rtz / .1 /  0,0,0 / 1,,360 / 2,3,4 / 0.2
random points with target spacing 0.1 in a cylinder of radius 1 centered at xyz=(2,3,4) and with an edge protection distance of 0.2
rzran/ rtp / .5 /  5,0,0 / 5,,360 /  , ,  /  / 98765 4321/
random points with target spacing 0.5 on the surface of a sphere of radius 5 centered at the origin with new random seeds
**CAVEATS**
Filter should be used afterwards to remove possibly duplicate
points. The algorithm to insure the points are uniformly distributed
in space is not clever about handling values outside the allowed
range for **rtz** and **rtp** geometries and so it simply truncates
them to the allowed range if possible or aborts. Most importantly,
angles are in degrees and theta for the rtp geometry runs from 0 to
degrees, with 0 degrees being the +z axis. It does know about
the angular periodicity and there should be only the "corner" point
artifacts of, eg, the +x axis being the origin of phi (rtp) or theta
(rtz) if a full 360 degrees for these two variables in their
respective coordinate systems is used.

71
docs/pages/docs/commands/RZS.md Executable file
View File

@@ -0,0 +1,71 @@
---
title: RZS
tags: rzs
---
# RZS
This command is deprecrated, see [CREATEPTS](createpts.md).
Builds a sphere by generating coordinates of points and also modifies zoning by ratio-zoning point distributions. See the **rz** command for
more details. The itype flag defines what type of sphere will be generated.
Use **`connect`** to generate tet or triangle connectivity from the point distribution.
## SYNTAX
<pre>
<b>rzs</b> / itype / nr,npt,xirad,xorad / xcen,ycen,zcen / iz / irat,rz
</pre>
### Types for sphere `itype`:
* **`1`** generates a sphere by gridding the faces of a cube and then projecting the vertices onto a sphere. The number of nodes per shell is of the form `6*i**2`.
* **`2`** generates a sphere by subdividing an icosahedron placed on the surface of a sphere. Icosahedral gridding is made up of 10 diamonds per shell. Each diamond is made up of `n**2` nodes (where n must be of the form `2**i+1`). There are 2 nodes (the poles of the sphere) at which 5 diamonds meet and 10 nodes where 3 diamonds meet; hence there are a minimum of 12 nodes per shell. The number of nodes per shell can be 12, 42, 162, 642,...etc.
* **`8`** generates a hexahedral icosahedron grid. This option distributes points and generates the grid connectivity data structures. This option does not require a connect command.
* **`diamond`** generates the points for one diamond of the icosahedron.
### Options:
*`nr`* is the number of radial shells
*`npt`* is the upper limit of the number of points in a shell, the number of points generated will be less than or equal to this number.
*`xirad`* , *`xorad`* are the inner and outer radii of the sphere. For `itype` =8 reverse inner and outer radii.
*`xcen`*, *`ycen`*, *`zcen`* are the coordinates of the center of the sphere
*`iz`*  if =0 then mins and maxs are used as cell centers, if =1 then mins and maxs are used as cell vertices
*`irat`* is ratio zoning switch (0=off,1=on)
*`rz`* is ratio zoning value - distance is multiplied by the value for each subsequent point.
<hr>
## EXAMPLES
```
rzs/8/5/162/1.0,0.5/0.,0.,0./1,0,0.0/
rzs/2/5/162/0.5,1.0/0.,0.,0./1,0,0.0/
rzs/diamond/5/162/1,.5/0,0,0/1,0,0/
```

View File

@@ -0,0 +1,144 @@
---
title: RZS
tags: rzs
---
# RZV
-------------------
This command is deprecrated, see [CREATEPTS](createpts.md).
This routine is used to ratio zone the region of space spanned by the input number n(i) of copies of the input vector v(ij) away from
the initial point v(0j) using the desired coordinate system. The j-th component of the i-th vector V(ij) is reduced by r(ij) at each
step in the i-th direction away from the initial point. No attempt is made to insure that the 3 vectors are independent.
## SYNTAX
<pre>
<b>rzv</b>/[<b> xyz rtz rtp </b> / &
[ n1,n2,n3 &
/v11,v12,v13/v21,v22,v23/v31,v32,v33 &
/v01,v02,v03 &
/r11,r12,r13/r21,r22,r23/r31,r32,r33 ] &
/ <b>component</b> or <b>vector</b> &
/ [f1,f2,f3]
</pre>
For `ratio_method` = **component** (default), the j-th component of the
i-th vector vij is reduced by  rij after the ki-th
step in the i-th direction away from the initial point.  For this
ratio_method the ratio flags `f1,f2,f3` are not used.  In this case an
initial step of 1 for the j-th component of the i-th direction would
become, for rij  =  1/2, a step of the j-th component of the i-th
direction of 1/2 at ki =  1, 1/4 at  ki =  2, 1/8 at  ki =  3, 1/16 at ki =  4,etc.
For `ratio_method` = **vector** and `fj` =1 (the default), the j-th vecor
is reduced by rij  after the ki -th step in the i-th direction. 
In this case an initial step of 1 in the j-th direction would
become, for  rij  =  1/2, a setp in the j-th direction of 1/2 at
ki =  1, 1/4 at  ki =  2, 1/8 at  ki =  3, 1/16 at ki =  4,etc.
For `ratio_method` = **vector** and `fj` =0, the j-th vecor is reduced by
[1 - (1-rij  ) *2/(ki +  1)] after the ki -th step in the i-th direction.  In this case an initial step of 1 in the j-th
direction would become, for  rij  =  1/2, a step in the j-th direction of 1/2 at ki =  1, 1/3 at  ki =  2, 1/4 at  ki =  3, 1/5 at ki =  4,etc.
default = **xyz**
default = 0:      ni, vi, v0j
default = 1:      rij
default = component
<hr>
## EXAMPLES
```
rzv/rtz/n1,0,0/.1,10.,1/ , , / , , / , , /1.1,1,.9
```
spiral of points
```
rzv/xyz/n1,n2,n3/1,0,0/0,1,0/0,0,1
rz/xyz/n1+1,n2+1,n3+1/0,0,0/n1,n2,n3/1,1,1
```
simple cubic point distribution, both lines have the same result
```
rzv/xyz/n1,n2,n3/.5,.5,.5/.5,.5,-.5/.5,-.5,-.5/
rz/xyz/n1+1,n2+1,n3+1/0,0,0/n1,n2,n3/1,1,1
rz/xyz/n1 ,n2 ,n3 /0,0,0/n1,n2,n3/0,0,0
```
body centered cubic point distribution, compare with the **rz** two command sequence with different bounding box.
```
rzv/xyz/n1,n2,n3/.5,.5,0/0,.5,.5/.5,0,.5/
rz/xyz/n1+1,n2+1,n3+1/0,0,0/n1,n2,n3/1,1,1
rz/xyz/n1?| ,n2?| ,n3+1/0,0,0/n1,n2,n3/0,0,1
rz/xyz/n1?| ,n2+1,n3?| /0,0,0/n1,n2,n3/0,1,0
rz/xyz/n1+1,n2?| ,n3?| /0,0,0/n1,n2,n3/1,0,0
```
face centered cubic point distribution compare with the four **rz** command sequence (different bounding box).
```
rzv/xyz/n1,n2,n3/1,0,0/.5,0.866,0/0,0,1
```
hexagonal lattice of points in x,y plane, repeated in z direction
```
rzv/xyz/n1,n2,n3/.5,.5,0/0,.5,.5/.5,0,.5
rzv/xyz/n1,n2,n3/.5,.5,0/0,.5,.5/.5,0,.5/.25,.25,.25
rz/xyz/n1+1,n2+1,n3+1/0,0,0/n1,n2,n3/1,1,1
rz/xyz/n1?| ,n2?| ,n3+1/0,0,0/n1,n2,n3/0,0,1
rz/xyz/n1?| ,n2+1,n3?| /0,0,0/n1,n2,n3/0,1,0
rz/xyz/n1+1,n2?| ,n3?| /0,0,0/n1,n2,n3/1,0,0
rz/xyz/n1+1,n2+1,n3+1/0.25,0.25,0.25/n1+.25,n2+.25,n3+.25/1,1,1
rz/xyz/n1?| ,n2?| ,n3+1/0.25,0.25,0.25/n1+.25,n2+.25,n3+.25/0,0,1
rz/xyz/n1?| ,n2+1,n3?| /0.25,0.25,0.25/n1+.25,n2+.25,n3+.25/0,1,0
rz/xyz/n1+1,n2?| ,n3?| /0.25,0.25,0.25/n1+.25,n2+.25,n3+.25/1,0,0
```
diamond point distribution (two command sequence) compare the eight **rz** command sequence (different bounding box).
```
rzv/xyz/n1,n2,n3/1,0,0/.5,0.866,0/0,0,1/
rzv/xyz/n1,n2,n3/1,0,0/.5,0.866,0/0,0,1/.5,0.2,.5
```
hexagonal close pack point distribution?| (two command sequence)
```
rzv/xyz/10,60,0/0.1,0,0/0,60,0/0,0,1/0,0,0/1,0.5,1/1,1,1/1,1,1/vector/0,0,0
```
nice 2-d distribution of points in a circle of radius 1
**CAVEATS:**:
     
* filter should be used afterwards to remove possibly duplicate
points
* this can create some really bizzare point distributions
* mistyped input after "rzv/[cgeom]" always returns successful
point addition, but may be very different than desired
* ratio\_flag might better be a scalar or a matix, and its use might want to be extended to ratio\_method=component.

View File

@@ -0,0 +1,56 @@
---
title: SCALE
tags: scale
---
# SCALE
-------------------------------------
Scale a point distribution according to the scale factors.
## SYNTAX
<pre>
<b>scale</b>/range/ <b>relative</b> /<b>xyz rtz rtp</b>/iscale,jscale,kscale/xcen,ycen,zcen
<b>scale</b>/range/ <b>absolute</b> /<b>xyz rtz rtp</b>/iscale,jscale,kscale/
</pre>
`range` is the selection of points designated by node numbers for ifirst,ilast,istride or **pset**,get,pname. 1,0,0 will select all.
**`absolute`** scaling factors are constants added on to the existing coordinates.  That is, absolute is really a translation rather than a rescale.
**`relative`** scaling factors are unitless multipliers with reference to geometric center `xcen,ycen,zcen`.
`iscale,jscale,kscale` are the scale factors according to `geometry` type:
- **`xyz`** Cartesian coordinates. iscale,jscale,kscale = x, y, z
- **`rtz`** Cylindrical coordinates. iscale,jscale,kscale = radial, theta, z
- **`rtp`** Spherical coordinates. iscale,jscale,kscale = radial, theta, phi
## EXAMPLES
```
scale/1,0, 0/ relative / xyz / 0.3048 0.3048 0.3048
```
Convert coordinates from feet to meters.
```
scale / 1 0 0 / relative / xyz / 10. 10. 1.
math/sin/CMO_OBJ/zic/1,0,0/CMO_OBJ/yic
scale / 1 0 0 / relative / xyz / 0.1 0.1 0.1
trans / 1 0 0 / 0. 0. 0. / 0. 0. 0.5
cmo / printatt / -def- / -xyz- / minmax
```
Use the math math and scale commands to set the z coordinates to make the shape of a sin() wave.
First use scale to make x and y coordinates to 0-10 so the sin(y) goes through complete 2pi cycles.
Set z(i)=sin(y(i)). A final scale factor is applied and the surface is translated up so all z values are above 0.

View File

@@ -0,0 +1,124 @@
---
title: SETPTS
tags: setpts, imt
---
# SETPTS
-----------------
Set point types and **imt** material by calling **surfset** and **regset** routines.
Assumes mesh object has geometry [REGION](REGION.md) and material [MREGION](MREGION.md) defined by [SURFACE](SURFACE.md) commands.
The node material **imt** attribute is set based on the previously defined **mregion** commands.
Interior and external boundary nodes should be assigned to exactly one **mregion**;
these nodes will be assigned an **imt** value that corresponds to the **mregion.**
Node types are assigned based on whether a node is on a surface and what type the surface(s) is.
A constraint table is generated and **icr** updated if constraint type surfaces are defined.
## SYNTAX
<pre>
<b>setpts</b>
<b>setpts/no_interface</b>
<b>setpts/closed_surfaces/reflect</b>
</pre>
**`setpts`**
With no arguments, this command sets point types and **imt** materials by previously defined regions.
Nodes will be assigned an **imt** value that corresponds to the **mregion.** A node which is on an interface will be assigned to any
**mregion** and will be given an **imt** value of "**interface**" (an integer equal to one more than the number of material regions.)
Node types are assigned based on whether a node is on a surface and what type the surface(s) is.
This command must be executed before **connect.**
**`setpts`** / **`no_interface`**
This allows one to set the **imt** values of nodes without getting any nodes labeled **interface**.
This is useful if you do not want **settets** to create parent child chains at interface points.
The actual **imt** value given may be determined by roundoff error so should not be used in cases
where there are a large number of interface points.
This is useful for setting **imt** values of an rzbrick mesh in which interface points only occur due to the coincidental point very near the geometry defining surface.
**`setpts`** / **`closed_surfaces/reflect`**
This option works with geometries in which all **regions** and **mregions** are defined by closed surfaces.
The nodes that fall on more than one surface are labeled as interface nodes.
Nodes which fall on exactly one surface are labeled external reflective boundary nodes.
The **resetpts/itp** must be called to correct the point types for external boundaries.
<hr>
## EXAMPLES
```
# define surfaces and regions
cmo/create/mo_tet
surface/s1/reflect/box/0,0,0/1,1,1
surface/p1/intrface/plane/0,0,.5/1,0,.5/1,1,.5
surface/p2/intrface/plane/.5,0,0/.5,1,0/.5,1,1
surface/p3/intrface/plane/.75,0,0/.75,1,0/.75,1,1
region/r0/ le s1 and ge p1 and gt p3 /
mregion/m0/ le s1 and gt p1 and gt p3 /
region/r1/ le s1 and ge p1 and le p3 /
mregion/m1/ le s1 and gt p1 and lt p3 /
region/r2/ le s1 and le p1 and ge p2 /
mregion/m2/ le s1 and lt p1 and gt p2 /
region/r3/ le s1 and le p1 and lt p2 /
mregion/m4/ le s1 and lt p1 and lt p2 /
# create point distribution
createpts/xyz/17,17,17/0,0,0/1,1,1/1,1,1
# set point types and materials
setpts
# connect into tet mesh
connect
# set element types and materials
settets
resetpts/itp
```
In general, it is good practice to use filter to remove duplicate points, setpts to set point attributes, settets to set elements, and a final resetpts/itp to set boundary.
```
cmo/create/s1///tri
read/avs/surfaces
cmo/create/3dmesh
surface/surface1/intrcons/sheet/s1
copyts/3dmesh/s1/
cmo/release/s1/
cmo/create/s2///tri/
read/avs/surf2.avs
surface/surface2/intrcons/sheet/s2
copypts/3dmesh/s2
cmo/release/s2/
region/r1/le surface1
region/r2/le surface2
mregion/mr1/lt surface1
mregion/mr2/lt surface2
setpts/closed_surfaces/reflect
connect
settets
resetpts/itp
```
example using the closed_surfaces command

View File

@@ -0,0 +1,133 @@
---
title: setsize
tags: setsize
---
# SETSIZE
-------------------
**setsize** will set the mesh object attributes xmin,xmax,ymin,ymax,zmin,zmax from the xic,yic,zic values of all
'real' points (dudded and merged points will be ignored).
The variables **epsilonl**, **epsilona** and **epsilonv** are mesh object attributes; hence they may be different for all meshes in a given run. 
**epsilona**, **epsilonv** and **epsilonl** may be set by the user with the **[cmo/setatt](cmo/cmo_setatt.md)** command. 
setsize is called internally by some of LaGriT commands, especially those that add nodes to the mesh; **[copypts](COPYPTS.md)**, **[createpts](createpts.md)**, **[regpnts](REGNPTS.md)**, **[recon](RECON.md)**, **[scale](SCALE.md)**, and **[translate](TRANS.md)**
Many LaGriT algorithms use **epsilonl**; for example, if a node falls on a interface or boundary surface. It uses **epsilonv** to determine if a node
can be connected. Errors from **setpts** and **connect** may result if inconsistant or wrong values of epsilons are used.
## SYNTAX
<pre>
<b>setsize</b>
</pre>
If **epsilonv** is very small, it is set to **epsilona**
**epsilonl** is set by a call to set_epsilon
**epsilonl** is set to the square root of **epsilona** unless this number would be too small in which case **epsilonl** is to
```
(( xmax-xmin) + (ymax-ymin) + (zmax-zmin)) * 1.e=8/3
```
**epsilonv** =
```
abs(xmax-xmin) * abs(ymax-ymin) * abs(zmax-zmin) * epsilonr * 1000
```
**epsilona** =
```
((xmax-xmin)**2 + (ymax-ymin)**2 + (zmax-zmin)**2) epsilonr * 1000
```
**epsilonr** is set at initialization time by:
```
x2=one
do i=1,1000
x2=x2/two
x1=one+x2
if(x1.le.one) go to 11
enddo
11 epsilonr = x2*2.
```
where the values of 'one' and 'two' are obtained from the include file 'consts.h'.
The command [cmo/printatt](cmo/cmo_printatt.md) can be used to view any of these cmo attributes.
e.g. cmo/printatt/xmax
## EXAMPLES
```
read/avs/box.inp/ mo
setsize
cmo/printatt/mo/-all-/minmax
```
setsize will set the min and max attributes for coordinates and set the epsilon values. The report from the **printatt** command will look like:
<pre class="lg-output">
ATTRIBUTE NAME MIN MAX DIFFERENCE LENGTH
-def- 0.000000000E+00 0.000000000E+00 0.000000000E+00 132651
scalar 1 1 0 1
vector 3 3 0 1
nnodes 132651 132651 0 1
nedges 0 0 0 1
nfaces 0 0 0 1
nelements 0 0 0 1
mbndry 16000000 16000000 0 1
ndimensions_topo 3 3 0 1
ndimensions_geom 3 3 0 1
nodes_per_element 4 4 0 1
edges_per_element 6 6 0 1
faces_per_element 4 4 0 1
isetwd 0 0 0 132651
ialias 0 0 0 132651
imt1 2 2 0 132651
itp1 0 0 0 132651
icr1 0 0 0 132651
isn1 0 0 0 132651
xic 0.000000000E+00 1.000000000E+00 1.000000000E+00 132651
yic 0.000000000E+00 1.000000000E+00 1.000000000E+00 132651
zic 0.000000000E+00 1.000000000E+00 1.000000000E+00 132651
0 length attribute: xtetwd
0 length attribute: itetclr
0 length attribute: itettyp
0 length attribute: itetoff
0 length attribute: jtetoff
0 length attribute: itet
0 length attribute: jtet
epsilon 1.000000004E-15 1.000000004E-15 0.000000000E+00 1
epsilonl 3.845925373E-13 3.845925373E-13 0.000000000E+00 1
epsilona 6.661338148E-13 6.661338148E-13 0.000000000E+00 1
epsilonv 2.220446049E-13 2.220446049E-13 0.000000000E+00 1
ipointi 1 1 0 1
ipointj 132651 132651 0 1
idebug 0 0 0 1
itypconv_sm 1 1 0 1
maxiter_sm 25 25 0 1
tolconv_sm 1.000000000E+00 1.000000000E+00 0.000000000E+00 1
nnfreq 1 1 0 1
ivoronoi 1 1 0 1
iopt2to2 2 2 0 1
xmin 0.000000000E+00 0.000000000E+00 0.000000000E+00 1
ymin 0.000000000E+00 0.000000000E+00 0.000000000E+00 1
zmin 0.000000000E+00 0.000000000E+00 0.000000000E+00 1
xmax 1.000000000E+00 1.000000000E+00 0.000000000E+00 1
ymax 1.000000000E+00 1.000000000E+00 0.000000000E+00 1
zmax 1.000000000E+00 1.000000000E+00 0.000000000E+00 1
kdtree_level 0 0 0 1
max_number_sets 64 64 0 1
number_of_psets 0 0 0 1
number_of_eltsets 0 0 0 1
number_of_fsets 0 0 0 1
</pre>
Note this mesh object does not have elements, therefore some element based attributes are 0 length.

View File

@@ -0,0 +1,122 @@
---
title: SETTETS
tags: settets
---
# SETTETS
-----------------------------
Set mesh object element color (itetclr) and create child points at interior
interfaces. This command can also be used to set the node color from the
element color. Note color values must be an integer number greater than 0.
## SYNTAX
<pre>
<b>settets</b>
<b>settets</b> / <b>color_tets</b>
<b>settets</b> / <b>parents</b>
<b>settets</b> / <b>geometry</b>
<b>settets</b>/ <b>color_points</b>
<b>settets</b>/ <b>new_tets</b>
<b>settets / normal</b>
</pre>
**`settets`** and
**`settets/color_tets`** detirmines the color of all elements using the following tests;
If the element contains a non-interface point, the element color is set to this value. If the
element is comprised entirely of interface points, the centroid of the element is calculated and the material region containing this point is determined; the element color is set to this material. If the centroid of the element is not in any material region, the centroid must be on an interface surface. In this case all vertices of the element are examined
and the material common to all vertices is selected as the element color.
**`settets`** / **`parents`** has exactly the same behavior as **`settets`** except that existing values of **itetclr** are used for elements containing non-interface nodes.
**`geometry`** sets the element **itetclr** based on the material region containing the centroid of the element for all elements; existing values
of **itetclr** are ignored and overwritten.
**`color_points`** sets the node material **imt** from the element color **itetclr**; existing values of **itetclr** are not changed.
**`settets/newtets`** has the same behavior as **`settets`** except that existing positive values of **itetclr** are not changed.
**`settets/normal`** assigns the element **itetclr** array of a triangle mesh to an integer value depending on the normal vector direction. There are 26
possible direction that correspond to the 6 faces, 12 edges and 8
corners of a cube.  In general most triangles will be assigned one of 6
values which correspond to the 6 sectors which are within degrees of
the 6 unit vectors: 1 0 0 , 0 1 0 , 0 0 1, -1 0 0, 0 -1 0, 0 0 -1. See image and table below.
NOTE: Valid for a quadrilateral or triangle mesh.
<hr>
## EXAMPLES
<pre>
# Projected cube onto a sphere to capture all 26 directions
cmo / create / motet_sph
createpts/sphere/1/5/162/1.0,0.5/0.,0.,0./1,0,0.0/
cmo / setatt / motet_sph / imt / 1 0 0 / 1
filter / 1 0 0
rmpoint / compress
connect
cmo / setatt / motet_sph / itetclr / 1 0 0 / 1
resetpts / itp
extract / surfmesh / 1 0 0 / motri_sph / motet_sph
cmo/select/motri_sph
settets/normal
cmo/printatt/motri_sph/ itetclr / minmax
dump / sphere_colors.inp / motri_sph
</pre>
Creates a sphere shaped triangulated surface with colors 1-26 based on normal directions with the view set so the min x,y,z coordinate is left,front,bottom. Direction numbering starts at bottom then top then right, back, left, front as shown in table and image.
<pre>
1 bottom (blue)
2 top (red)
3 right = east (green)
4 back = north (orange)
5 left = west (aqua)
6 front = south (yellow)
7 bottom right edge (dark gray)
8 bottom front edge (dark gray)
9 front right side edge (black)
10 bottom back edge (dark gray)
11 back right side edge (black)
12 bottom left edge (dark gray)
13 left back side edge (black)
14 front left side edge (black)
15 top right edge (light gray)
16 top front edge (light gray)
17 top back edge (light gray)
18 top left edge (light gray)
19 bottom front right corner (magenta)
20 bottom back right corner (magenta)
21 bottom back left corner (magenta)
22 bottom front left corner (magenta)
23 top front right corner (magenta)
24 top back right corner (magenta)
25 top back left corner (magenta)
26 top front left corner (magenta)
</pre>
Image shows triangle elements colored by 26 normal values. Image materials are expanded to show all.
<img width="500" src="https://lanl.github.io/LaGriT/assets/images/sphere_cube_colors26_expand.png">

View File

@@ -0,0 +1,162 @@
---
title: SMOOTH
tags: smooth
---
# SMOOTH
----------------------
Smooth a 2D or 3D mesh object.
For adaptive smoothing see the **[radapt](RADAPT.md)** command. **smooth** takes a 2D or 3D mesh object
and moves nodes, without changing the connectivity of the grid, in order to improve the aspect ratios and distribution of
elements in the mesh.
There are nine smoothing algorithms available:
| &nbsp;[2D](#2d)&nbsp; | [2D and 3D](#2d3d) | &nbsp;[3D](#3d)&nbsp; |
| :--------: | :--------: | :--------: |
| [esug](#esug) | [laplace](#laplace) | [mega](#mega) |
| [elliptic](#elliptic) | [aspect](#aspect) | [network](#network) |
[random](#random) | [lpfilter](#lpfilter) | [geometry](#geometry) |
## SYNTAX
For all commands:
**`position`** results in the positions of nodes being changed. Other options have not been implemented.
`ifirst,ilast,istride` is the selection of points designated by node numbers or **pset**,get,pname. 1,0,0 will select all.
The internal variable **maxiter_sm** (default=25) controls the maximum number of iterations
and can be changed using the **[assign](ASSIGN.md)** command. e.g. (assign /// maxiter_sm/10).
## SYNTAX 2D <a name="2d"></a>
<pre>
<b>smooth/position</b>/<b>esug elliptic random</b>/ [ifirst,ilast,istride ]/[control]
</pre>
**`esug`** <a name="esug"></a>
Elliptic Smoothing for Unstructured Grids with guards against folding. This is the default for 2D mesh objects. It can only be used on triangular 2D mesh objects.
*Ref.: Randolph E. Bank and R. Kent Smith, “Mesh Smoothing Using A Posteriori Error Estimates”, SIAM J. Num. Anal. Vol. 34, Issue 3, pp. 979-997, 1997.*
**`elliptic`** <a name="elliptic"></a>
similar to **esug** except the 'guards' which prevent a grid from folding are turned off. (Thus esug is preferred.)
**`random`** <a name="random"></a>
a node's position is set to a randomly weighted average position of its neighbors. 'Guards' keep the elements from inverting.
`control` (default 0 ) from standard smoothing scheme to 1 which causes the scheme to be progressively more controlled, at 1 there is no mesh movement.
## SYNTAX 2D and 3D <a name="2d3d"></a>
<pre>
<b>smooth/position/aspect</b> // [ifirst,ilast,istride]/ [toldamage]
<b>smooth/position/lpfilter</b> // [ifirst,ilast,istride] /[filtdeg]/[k_pb]/<b>network</b>
<b>smooth/position/laplace</b> / [ifisrt,ilast,istride]/[rlxwt]/[ntimes]/[nwtty]/[useisn]/[extrnbr]
</pre>
**`aspect`** <a name="aspect"></a>
Adjusts node positions such that the aspect ratio of the elements is improved.
- `toldamge` (default is infinity) is the damage tolerance, so it can be used as a general smooth which has the effect of improving worst aspect ratio.
**`lpfilter`** <a name="lpfilter"></a>
This smooths surface networks by a low-pass filtering of the coordinate data.
- `fltdeg` (default 30)
- `k_pb` (default 0.1)
- **network** applies to a network of curves in 2D or 3D, or to a network of surfaces in 3D. The cell materials are ignored.
**`laplace`** <a name="laplace"></a>
On a 3D tetahedral mesh moves a node to the average position of its neighbors where neighbor is defined as the set of nodes connected to the candidate node by an edge where the node types (itp1) and node constraints (icr1) are a 'subset' of the candidate node type and constraints. A node will not be moved if the result is an inverted element. The following controls may be supplied:
- `rlxwt` (default 0.5 ) weight for underrelaxed Laplacian smothing
- `ntimes` (default 5 ) number of smoothing iterations
- `nwttry` (default 3 ) number of attempts to not tangle the mesh by halving the smoothing weight.
- `useisn` (default 1 ) means interface nodes are smoothed based along an edge with the same materials as the candidate node.
0 means interface nodes are smoothed based on all interface neighbors.
- `extrnbr` (default **inclusive**) means do not restrict neighbors. **exclusive** means restrict neighbors to pset nodes.
## SYNTAX 3D <a name="3d"></a>
<pre>
<b>smooth/position</b>/<b>mega geometry</b>/ [ifirst,ilast,istride ]/[control]
<b>smooth/position/network</b>/[ifisrt,ilast,istride]/[niter]/[weight]/[<b>check nocheck</b>]
</pre>
`control` (default 0 ) from standard smoothing scheme to 1 which causes the scheme to be progressively more controlled, at 1 there is no mesh movement.
**`mega`** <a name="mega"></a>
Minimum Error Gradient Adaption. This option creates a smoothed grid which is adapted to the standard function with constant
Hessian f(x,y,z)=x2+y2+z2. Can be used on hybrid 3D meshes and guards against mesh folding.
Adaption to this function creates a uniform isotropic mesh.
*Ref.: Randolph E. Bank and R. Kent Smith, "Mesh Smoothing Using A Posteriori Error Estimates", SIAM J. Num. Anal. tol. 34, Issue 3, pp. 9-9 (19)*
**`geometry`** <a name="geometry"></a>
Geometry ("plump element") adaption. Default for 3D.
Can be used on hybrid 3D meshes It uses the **mega** algorithm but retains only the leading geometry term;
the term containing the Hessian has been dropped. This algorithm guards against mesh folding.
**`network`** <a name="network"></a>
This option smooths the surface network of a 3D tetrahedral grid.  Volume nodes are not moved. 
The material volumes are conserved. Combining this type of smooth with volume smoothing will help to avoid element inversions.
- `niter` (default 10 ) number of iterations
- `weight` (default 1. ) controls the amount of movement (from 0. to 1.).
- **check** (default) By default a check is performed to verify that no elements are inverted.
- **nocheck** turns off check for inverted elements. This option will not work correctly (will not conserve volume)
on grids which have two areas of a material connected at a single node or edge; each material region must have face connectivity. 
<hr>
## EXAMPLES
```
smooth
```
Smooth all nodes in the mesh using esug in 2D or geometry in 3D.
```
smooth / / / 1,0,0 / 0.5
```
Smooth all nodes in the mesh, using controlled smoothing with control=0.5.
```
pset/p2/attribute/itp1/1,0,0/0/eq
smooth /position /network/1,0,0/3/1./check
smooth/position/geometry/pset,get,p2
smooth /position /network/1,0,0/3/1./check
smooth/position/geometry/pset,get,p2
```
Smooth a 3D grid by combining network and volume smooths.
```
compute/distance_field/CMO_SINK mobj_sm dfield
pset/pin/attribute dfield/1,0,0/ le 120.
assign///maxiter_sm/6
smooth/position/esug/pset,get,pin
```
Smooth a 2D grid within 120 distance from mobj_sm and control the number of iterations by using the **assign** command.

230
docs/pages/docs/commands/SORT.md Executable file
View File

@@ -0,0 +1,230 @@
---
title: "sort"
categories: sort
---
# SORT
----------------
The **sort** command creates a sort key for chosen node or element attributes.
Sort can be in ascending or descending order and will not alter current mesh object values.
The mesh object is not re-ordered but a sort key is created. Use [**`REORDER`**](REORDER.md) to change the node or element ordering of the mesh object.
## SYNTAX
<pre>
<b>sort</b>/mo_name/<b>bins</b> /[<b> ascending</b> or <b>descending</b>]/key_name/ sort_attribute / [epsilon_user]
<b>sort</b>/mo_name/<b>index</b> or <b>rank</b>/[<b>ascending</b> or <b>descending</b>]/key_name/ in_att1, in_att2, in_att3 ...
<b>sort</b>/mo_name/<b>line_graph</b> /[<b>ascending</b> or <b> descending</b>]/key_name/[<b>elements</b> or <b>nodes</b>]
</pre>
For all commands:
`mo_name` is the name of a valid mesh object or **-def-** which selects the currently active mesh object.
`sort_type` sorting methods include **`bins`**, **`index`**, **`rank`** and **`line_graph`** See below.
**`ascending`** or **`descending`** detirmines the ordering direction. Note this parameter is ignored by the **line_graph** method but must be present for consistency with other sort variations.
`key_name` is the name of the sort key attribute created. The **reorder** command uses this to reorder the mesh.
This is an integer vector (VINT) which will hold the output sort key values. If no name is given for `key_name`, a name will be created which will be **ikey_** and the first attribute name in sort_attributes. For the **`line_graph`** option, the default `key_name` will be called **ikey_line_graph**.
*`sort_attributes`* The name of one or more existing attribute names. Each attribute will be used as a node of element based array upon which the sorting routine will sort. Multi-key sorts can have an arbitrary number
of input attributes. Attribute in_att1(n) has priority over in_att2(n) in breaking ties. Note: all attributes are put into a type real work array before being sent to the sort routine.
Note the **line_graph** does not use attributes as it sorts line elements based on connectivity (see method below).
### Single-Key sort:
**`bins`** is a single-key sort which assigns each in_att1 value a bin
number. If in_att1 is an integer then bins each have a unique integer
value associated with them. If in_att1 is a real number, bins are
created with values which are within +-epsilon of each other, where
epsilon=1.e-10 x abs(real_bin_value). If all array values are unique,
then the maximum value of the index array will equal the number of
entries in the sorted list. Otherwise, the maximum value of the index
array will be less than the number of entries in the sorted list but
will equal the number of unique entries in the list. With the **`bins`** method, an optional user specified epsilon
multiplier, *epsilon_user*, will override the default value of 1.e-10.
### Multi-Key sort:
**`index`** is a single or multi-key sort that constructs an index table such that
in_att1(ikey(1)) is the first entry in the sorted array, in_att1(ikey(2)) is the second, etc.
**`rank`** is a single or multi-key sort that constructs a rank table such that the tables ith entry give the rank of the ith entry of the sorted arrays. The rank table is derived from the index table by:
<pre>
foreach j = 1,N
rank(index(j)) = j
end
</pre>
### Line Graph sort:
**`line_graph`** is a sort for connected line segments for arranging into a reasonable order. The sorted order for components which are not polylines or polygons is unspecified, but it will usually be reasonable because the underlying
algorithm visits the edges via depth first search. In particular, it makes the following guarantees:
- Each connected component will be arranged together.
- Polylines (chains of line segments with no branching or loops)
will be in order from one end to the other.
- Polygons will be in order starting from one segment and looping
back around to the same place.
**`line_graph`** with **`elements`** generates the following three integer element attributes:
- cid: A component id for distinguishing separate connected
components. Each connected component receives a unique positive
integer starting from one. This allows you to identify all the
edges in a particular component by selecting all elements with a
particular component id.
- ctype: The component type, represented as an integer from 1 to 5.
1 (Polyline)
: A connected chain of segments with no branches or loops.
2 (Tree)
: A connected acyclic component.
3 (Polygon)
: A component consisting solely of a single loop.
4 (Shared Edges)
: A component which has a pair of cycles with a shared edge.
5 (Other)
: Anything which does not fit into the above categories.
- loop\_id: This is a unique positive integer assigned to each
simple cycle. Edges that are not part of a cycle receive a default
value of zero. If an edge is shared (i.e. part of more than one
cycle) then it will be labeled with only one of its cycles. In
this case, the cycle corresponding to the label is not fully
specified because there is more than one right answer.
**`line_graph`** with **`nodes`** is based on the option for
elements, except that it does not create extra attributes. Based on
the sorted elements, the nodes will be reordered in the same sequence.
This is necessary for triangulation as "TRIANGULATE" routine requires
the nodes to be in either clockwise or counterclockwise order.
<hr>
## EXAMPLES
<pre>
sort / cmo / line_graph / ascending / ikey / elements
</pre>
Sort the line segment elements into a reasonable order based on connectivity. This also creates attributes cid, ctype, and loop_id (see above).
<pre>
sort / cmo / index / ascending / ikey / imt zic yic xic
</pre>
Multi-key sort first by imt then to break ties consider z coordinate, then if there are further ties, use y coordinate. Use x coordinate as final tie breaker.
<pre>
sort / cmo / rank / descending / ikey / yic
</pre>
Produce ranking of nodes based on y coordinate in descending order.
<pre>
sort / cmo / index /-def-/-def-/ xic yic zic
</pre>
Produce index of noded coordinates. This would be like a line sweep
sort where the sweep is first along x coordinate then y then z.
<pre>
sort / cmo / bins / ascending / i_index / xic
sort/ cmo / bins / ascending / j_index / yic
sort / cmo / bins / ascending / k_index / zic
</pre>
If the cmo were a finite difference grid of points, the above three
commands would produce the finite difference indexing. All points with
the same x value would be in the same i_index bin, all points with
the same y value would be in the same j_index bin, etc.
<pre>
define MOGOOD motet
define MOSORT mopts
cmo/addatt/MOSORT id_mesh1 /VINT/scalar/nnodes/linear/permanent//0
interpolate/voronoi/ MOSORT id_mesh1/1,0,0/ MOGOOD id_node
cmo/addatt/MOSORT id_diff /VINT/scalar/nnodes/linear/permanent//0
math/sub/MOSORT id_diff/1,0,0/ MOSORT id_mesh1 /MOGOOD id_node
cmo/printatt/MOSORT/ id_diff / minmax
sort/ MOSORT/ index / ascending / ikey / id_mesh1
reorder/MOSORT/ ikey
</pre>
Sort and reorder a set of nodes based on a source mesh, based on node id and position xyz. Use **`interpolate/voronoi`** to associate each node with the good mesh node id's. We check to see if the ordering for both mesh objects is different by subtracting the node id of one from the second. The result would be 0 for all nodes that match position and node id. Sort mesh object using the attribute with the interpolated node id's, then reorder using the ikey values.
## LINKS
[LaGriT command file example 1 for sort and reorder](../demos/input/sort_lagrit_input_1.txt)
[LaGrit command file example 2 for sort and reorder](../demos/input/sort_lagrit_input_2.txt)
## OLD FORMAT - No longer supported but syntax will still work. ##
<pre>
sort / xyz / [ index bins rank ]
</pre>
**`sort/xyz/index`** sorts the x,y,z coordinate integer arrays i_index,
j_index, k_index such that xic(i_index(i)) i=1,..nnodes lists the coordinate in ascending order.
**`sort/xyz/bins`** sorts the x,y,z coordinates and assigns each i_index,
j_index, k_index values in ascending order of the bin number of the sorted list.
**`sort/xyz/rank`** sorts the x,y,z coordinates and assigns each i_index,
j_index, k_index values the ranking of the node in the sorted list.
If all array values are unique, then the maximum value of the index
array will equal the number of entries in the sorted list. Otherwise,
the maximum value of the index array will be less than the number of
entries in the sorted list but will equal the number of unique entries
in the list.
<pre>
For example given x = 0, 1, 2, 1, 0
sort/xyz/index returns i_index = 5, 1, 4, 2, 3
sort/xyz/bins returns i_index = 1, 2, 3, 2, 1
sort/xyz/rank returns i_index = 2, 4, 5, 3, 1
</pre>

175
docs/pages/docs/commands/STACK.md Executable file
View File

@@ -0,0 +1,175 @@
---
title: STACK
tags: stack layers
---
# STACK
-------
The **stack/layers** command is used to read surfaces and merge into a
single stacked layers cmo. The surfaces must have the same number of
nodes, and the x,y coordinates of each layer must be the same. (i.e.
x_n,y_n of surface M must equal x_n,y_n of surface N), and the
surfaces must be single valued functions of z.
The first file listed is bottom, last file is the top surface.
The lower elevation of each layer truncates the upper. The second from
last surface can be made to truncate all lower surfaces, commonly done
with a topographic surface.
Three scalar attributes are added and used later by the **`stack/fill`** command.
- **nlayers** are the total number of layers in the stacked cmo, this includes layers added
for refinement. nnperlayer are the number of nodes in each of the
layers.
- **neperlayer** are the number of elements in each of the layers.
- **layertyp** is created to indicate what type of layer each node is in.
Value -1 is bottom, -2 is top, 0 is the surfaces read at input, 1 is a derived interface buffer, 2 is a derived refinement layer.
## SYNTAX
<pre>
cmo/create/ cmo_stack
<b>stack/layers</b> / [<b>avs</b> or <b>gmv</b>] [minx,miny, maxx,maxy] / &
file_bot(1) [matnum] &
file_lay(i) [matnum, refnum] &
file_top(n) [matnum, refnum] &
[ <b>flip</b> ] [ <b>buffer</b> [xdistance] ] [ <b>pinch</b> xthick ] <b>trunc</b> [ifile_no] [ <b>dpinch</b> xvalue / <b>dmin</b> xvalue ]
<b>stack/fill</b> / cmo_3D / cmo_stack
</pre>
### Required Options
The stacked layers are read into the current mesh object. Create and name the stacked mesh object with **cmo/create**/cmo_stack before command **`stack/layers`**.
**`stack/fill`** command creates a new mesh object `cmo_3D` from the stacked mesh `cmo_stack`.
The stacked 2D layers are filled to create 3D elements. For triangulated surfaces, the elements will be prisms, and for quad sheets the filler elements will be hex.
**avs** or **gmv** are the allowable file types that can be read. These must be surfaces with element type **quad** or **tri**.
`minx, miny, maxx, maxy` is optional argument that allows a subset of the surfaces to be used.
`file(1) ... file(n)` is the list of files to read from bottom surface to top.
Each surface can be followed by an integer value to indicate a material
number, and an integer value to indicate the number of layers to add as
refinement between input surfaces.
`mat_num` and `ref_num` material number and refinement count are optional arguments for each file so the file list can look like one of the following 3 syntax lines:
<pre>
file_bottom, file2, ... file_top
file_bottom mat_num, file2 mat_num, ... file_top mat_num
file_bottom mat_num, file2 mat_num [ref_num], ... file_top mat_num [ref_num]
</pre>
`mat_num` is the material number for the unit defined by upper and lower surface. These values will detirmine the element colors when the
layers are filled with element volumes.
`ref_num` is the number of refinement layers to add between two surfaces. Refinement is done proportionallly, creating new layers
between the choosen surfaces. The first filename can not have a refinement number, units start at second file name. See examples
below.
### Additional Options
**`flip`** will flip elements so the normals point positive Z direction, no change if normals are already up direction.
**`buffer`** creates buffer layers around interfaces at a distance equal to `xvalue`. It derives layers above and
below each surface that is read in to the stack routine. Buffers are not created around refinement layers or on the top and bottom surfaces.
**`trunc`** causes all layers below the choosen surface to be truncated. The truncating surface is indicated by
the integer `ifile_no`. For instance, 5 will truncate all layers below the 5th surface by the 5th surface.
**`pinch`** `xthick` controls how layers are made coincident where they cross and will also help to control the minimum thickness between layers.
The real value `xthick` is mininum thickness allowed between layers. This allows upper surface elevations to be equal to lower surface
elevation if the upper surface dips below lower surface. (default 0)
**`dpinch`** `dvalue` **dmin** `mvalue` These options are used along with buffers to help elements to follow the interface boundarys. These
options differ from the simple **pinch** option and uses the beads_ona_ring algrithm to move points vertically after all the layers are stacked.
<br>
The algorithm follows these rules:
```
If layer thickness <= dvalue then thickness is set to zero.
If layer thickness is < dvalue < mvalue, set thickness to mvalue.
(default dvalue = mvalue = 0.0, no post processing)
```
<hr>
## EXAMPLES
```
cmo/create/cmo_stack
stack/layers/avs/ fsrf5.inp 1/ fsrf09.inp 2/ fsrf44.inp 2 /flip/pinch 1.0
stack/fill/ mo_prism / cmo_stack
```
This command will read 3 triangulated surface files, flip the normal from down to up, and pinch layers less than 1.0 meter apart. When
converted to a 3D grid, this mesh will be two prism elements thick in the z direction.
<br>
A surface is assigned the material value that occurs with it on the command line. When the surfaces are filled with volumes, the nodes on
the bottom surface will detirmine the material of volume elements on and above that surface. So nodes on fsrf5.inp and above will all
have imt values of 1. Nodes on fsrf09.inp and above will have imt equal to 2.
<br>
The prism mesh will have a bottom layer of material 1 and a top layer of material 2.
```
cmo/create/cmo_stack
stack/layers/avs / fsrf5.inp 1/ fsrf09.inp 2/fsrf44.inp 2/ &
flip / buffer 3.0 / dpinch 1.0 / dmin 3.0
```
Three surfaces are read and buffer layers are added at 3 meters below and 3 meters above the unit interface fsrf09.inp. The units are
pinched at anything less than 1 meter and the mininum distance to next layer is 3 meters.
```
cmo create cmo_stack
stack/layers/avs/ &
surf-12.inp 1 &
surf-5.inp 2 3 &
surf5.inp 3 &
surf2_slope.inp 4 &
surf25.inp 4 1 / trunc 4 / pinch 0.
stack/fill/mohex/cmo_stack
hextotet//motet/cmohex
```
This command reads a list of quad surfaces and assigns material values 1 through 4. The first thickness (between surf-12.inp and surf-5.inp) is
refined by 3, so that 3 layers are added between these file surfaces. All materials will be 1 in this refined unit.
The next two units, material 2 and 3, will have no refinement layers added. The last unit is
refined once, with a layer between the file surfaces surf2_slope.inp and surf25.inp.
<br>
The fill option will fill the space between quad surfaces with hex elements. This hex grid will have 4 units and 10 layers.
<br>
The hextotet command can be used to convert the hex grid to a tet grid. Note that the second option to hextotet is defaulted. This
allows hextotet to check on the grid's mesh type and use the appropriate tet conversion. There will be 6 tet from each hex and
there are 3 tets from each prism.
### LINKS
[Simple Examples for stack](../stack_demo.md)
[Advanced Examples for stack](../stack_demo2.md)

View File

@@ -0,0 +1,234 @@
---
title: SURFACE
tags: surface, geometry
---
# SURFACE
-----------------------
Defines a boundary, interface, or geometry for a selected mesh object.
Surfaces are used to create geometry [**`REGION`**](REGION.md) and material regions [**`MREGION`**](MREGION.md) for a mesh object.
Mesh interfaces will be assigned node constraint (**icr**) values corresponding to the surfaces on which nodes sit.
The command [**`SETTETS`**](SETTETS.md) will generate parent/child node chains (**isn**) for nodes on **intrface** or **intrcons** surfaces.
The [inside/outside](#insideoutside) conventions for sheet surfaces are described below.
## SYNTAX
<pre>
<b>surface</b>/isurname/ ibtype / istype / istype_parameters
<b>surface</b>/isurname/<b>release</b>
</pre>
`isurname` is the name of the surface and must be unique for each surface defined for the current mesh object.
**release** will release the previously defined surface referenced by name. All references will be removed from the geometry data structures and all constraints (icr) values associated with this surface will be removed.
### Options for `ibtype`
These options define the boundary type and constraints.
**`free`** unconstrained, exterior
**`reflect`** constrained, exterior, assigned constraint values (icr).
**`intrface`** unconstrained, interior, will generate parent/child node chains (isn).
**`intrcons`** constrained, internal, are assigned constraint values (icr) and will generate parent/child node chains (isn).
**`virtual`** constrained, internal surfaces which have different materials on either side of the virtual interfaces do not
separate material regions but are intended to identify other structural features of a geometry. Nodes on this surface will be assigned constraint values (icr).
### Options for `istype`
*`istype`* are types of surfaces represented by geometric shapes. Each type has parameters specific to its geometry.
**`box`** / `xmin,ymin,zmin` / `xmax,ymax,zmax` is a cube defined by min and max coordinates, i.e bottom left and top right corners.
**`cylinder`** / `x1,y1,z1/x2,y2,z2/radius` is a cylinder defined by point 1 bottom center and point 2 top center. The radius is the length from center to cylinder edge. Cylinders are open but finite. To create a closed cylinder cap both ends with planes.
**`cone`** / `x1,y1,z1/x2,y2,z2/radius` is a cone where point 1 is the vertex and point 2 is the base center of the cone with radius from that point. A cone is finite but does have an open end. To create a closed cone cap the open end with a plane.
**`ellipse`** / `x1,y1,z1 / x2,y2,z2 / x3,y3,z3 / ar,br,cr` is an ellipse point 1 is the center of the ellipsoid and point 2 is on the a semi-axis (new x), point 3 is on the b semi-axis (new y). The values ar, br, cr are radii on their respective semi-axes.
**`parallel`** / `x1,y1,z1 / x2,y2,z2 / x3,y3,z3 / x4,y4,z4` is a parallel piped where points 1, 2, 3 are the front left, front right and back left points of the base and point 4 is the upper left point of the front face.
**`plane`** or **`planexyz`** / `x1,y1,z1 / x2,y2,z2 / x3,y3,z3` is a plane defined by 3 coordinate points. The direction normal to the plane is determined by the order of the points according to the right hand rule.
**`planertz`** / `radius1, theta1, z1, radius2, theta2, z2, radius ,zcen` is a plane defined by cylindrical coordinate system.
**`planertp`** / `radius1,theta1,phi1, radius2,theta2,phi2, radius3,theta3,phi3/ xc, yc, zc` is a plane defined by spherical coordinate system.
**`sphere`** / `xc, yc, zc, radius` is a sphere defined by the center point and the radius distance from center point to sphere surface.
**`sheet`** / `cmo_name` is a surface defined by a mesh object that is a 2D quad or triangle connected mesh. See [inside/outside](#insideoutside) conventions below for a description of inside/outside or left/right with respect to sheet surfaces.
**`tabular`** / `x1,y1,z1/x2,y2,z2`/ **rz** or **rt** / is a rotated tabular profile where point 1 and point 2 define the axis of rotation for the tabular profile with point 1 as the origin. This is followed by pairs of profile descriptors depending on the value of rz or rt. If **rz**, then the r value is a radius normal to the axis of rotation and z is the distance along the new axis of rotation. If set to **rt** then theta is the angle from the axis of rotation at point 1 and r is the distance from point 1 along theta. The first pair must start on a new line and all lines must contain pairs of data. The last pair of data must be followed by **end**.
<pre>
surface/s_name/ibtype/<b>tabular</b> / x1,y1,z1 / x2,y2,z2 / <b>rz</b> / &
r1,z1 &
r2,z2 &
....
rn,zn &
<b>end</b>
or
surface/s_name/ibtype/<b>tabular</b> / x1,y1,z1 / x2,y2,z2 / <b>rt</b> / &
r1,theta1 &
r2,theta2 &
...
rn,thetan &
<b>end</b>
</pre>
<hr>
## EXAMPLES
```
surface / s_box / reflect / box / -1. -1. -1. / 1. 1. 1.
region/ r_box / le s_box
```
Define a region inside or equal to a box with lower left corner (-1. -1. -1.) and upper right corner at (1. 1. 1.).
```
read avs surfmesh_input.inp mosurf
cmo/select/motet
surface/surf_bndry/intrface/sheet/mosurf
region/ rout / ge surf_bndry
eltset/ eout / region / rout
```
Read a triangulated surface to truncate a mesh. Use the surface to find elements outside the surface and name the set "eout".
```
surface / s_cone / reflect / cone / .1 .1 .1 / .5 .5 .5 / .3
```
Define a cone surface with tip at (.1 .1 .1) and center at (.5 .5 .5) with .3 radius.
```
define XC 498.0
define YC 539.0
define ZBOT -500.0
define ZTOP 500.0
define RAD 42.0
surface/ s_cyl /intrface/cylinder/XC,YC,ZBOT/XC,YC,ZTOP/ RAD
```
Use define variables to create a cylinder shaped surface.
```
surface / s_ellipse / reflect / ellipse / &
552250.0 4121975.0 1275.0 / &
552251.0 4121975.0 1275.0 / &
552250.0 4121976.0 1275.0 / &
500.0 225.0 125.0
region / r_ellipse / le s_ellipse
eltset/ereset/region/r_ellipse
```
Define an ellipsed shaped region and select elements.
```
define x1 497000.
define y1 540612.
define x2 499300.
define y2 540100.
define x3 497000.
define y3 541316.
surface/SSBOX/intrface/parallel/x1,y1,1700./ &
x2,y2,1700./x3,y3,1700./x1,y1,5000./
define x1 499029.5961
define x2 500174.3616
define y1 538579.7712
define y2 539378.5612
define uleft 1779.9725
define uright 1778.7472
define lleft 1779.7481
define lright 1778.5228
surface/ swtr / intrface /plane/ x2, y1, lright / x2, y2, uright / x1, y2, uleft
surface / bbox / reflect / box / .1 .1 .1 / .9 .9 .9
surface / s1 / intrface / sheet / cmo_2
surface / s2 / intrface / sheet / cmo_3
region / r1 / lt bbox and gt s1 and gt s2
region / r2 / lt bbox and gt s1 and lt s2
region / r3 / lt bbox and lt s1 and gt s2
region / r4 / lt bbox and lt s1 and lt s2
```
Set up a parallel piped and plane surfaces then define sheet surfaces from the triangulations in cmo_2 and cmo_3.
Define geometry regions relative to the surfaces.
## Sheet surfaces inside/outside Convention <a name="insideoutside"></a>
Inside/outside will be determined by the following algorithm:
* For the point being considered, p, find the nearest sheet triangle
and the closest point, q, to p that lies on that triangle.
* Construct the vector <img width="`20" src="https://lanl.github.io/LaGriT/assets/images/Image255.gif">, from q to p.
* Construct the outward normal to the triangle, <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image256.gif">
The outward normal is constructed using the right hand rule and the order of the
points in the sheet. Sheets may be specified as quad Mesh Object (i.e. a
2 dimensional array of points containing the coordinates of the corners
of each quad). Either two triangles (divide each quad in two using point
(i,j) and (i+1,j+1)) or four triangles (add a point in the center of the
quad) are generated by each quad. Applying the right hand rule to the
points (i,j), (i+1,j), (i+1,j+1) gives the direction of the normal for
all triangles created from the quad.
* If <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image255.gif"> <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image256.gif"> &lt; 0 then
the point is inside. If  <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image255.gif"> <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image256.gif"> &gt;0 the
point is outside. If <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image255.gif"> <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image256.gif"> * n = 0, and if
p is on the triangle then p=q and p in on the triangle.
* If <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image255.gif"> <img width="10" src="https://lanl.github.io/LaGriT/assets/images/Image256.gif"> = 0 and p is not on the triangle then p is outside.
<img src="https://lanl.github.io/LaGriT/assets/images/Image257.gif">
One implication of this definition is that the concept of shadows cast
by open sheets no longer is valid. Sheets may be considered to extend to
the boundary of the geometry.
<img src="https://lanl.github.io/LaGriT/assets/images/Image259.gif">

View File

@@ -0,0 +1,96 @@
---
title: SURFTPTS
tags: surfpts
---
# SURFPTS
----------------
Generates points on boundary surfaces previously defined by the [**`SURFACE`**](SURFACE.md) or [**`REGION`**](REGION.md) command.
The points are generated by shooting rays through a user specified set of points from an origin point, line or plane and finding the surface intersection of each ray.
## SYNTAX
<pre>
<b>surfpts</b>/ itype/iname/ <b>inside outside both</b>/ifirst,ilast,istride/geom/ray_origin
</pre>
`itype` is the name of the surface or region.
`ifirst,ilast,istride` or **pset,get**,psetname define the set of points to shoot rays through.
**`inside`** **`outside`** or **`both`** indicates the point location for a region relative to the surface.
### Options for Ray Geometry
The parameters `geom / ray_origin` are the geometry and ray origin with parameters based on the geometry.
**`xyz`**/ `x1,y1,z1/x2,y2,z2/x3,y3,z3` where points 1, 2, 3 define the plane to shoot rays from that are normal to the plane.
**`rtz`**/ `x1,y1,z1/x2,y2,z2` where points 1, 2, define the line to shoot rays from that are perpendicular to the line.
**`rtp`**/ `xcen,ycen,zcen` where point is the center.
**`points`** / `iffirst,iflast,ifstride` define a set of points to shoot rays from.
## EXAMPLES
```
* coordinates and elevations for watertable plane
define x1 499029.5961
define x2 500174.3616
define y1 538579.7712
define y2 539378.5612
define uleft 1779.9725
define uright 1778.7472
define lleft 1779.7481
define lright 1778.5228
* point distribution for ray shooting
define / XMIN / 498400.
define / YMIN / 538900.
define / XMAX / 500200.
define / YMAX / 540400.
define / NZ / 1
define / NX / 61
define / NY / 51
cmo/create/cmos
surface/swtr/intrface/plane/x2 y1 lright/x2 y2 uright/x1 y2 uleft
createpts/xyz/NX NY NZ / XMIN YMIN ZMAX / XMAX YMAX ZMAX
pset/rayend/seq/1 0 0
* SURFPTS/CTYPE/INAME/IREGPT/IPFIRST,IPLAST,ISTRIDE/GEOM/RAY ORIGIN
* ctype = surface or region
* iname = name of surface or region
* iregpt = inside, outside, or both (ignored for surface)
* geom = center pt, line, or plane
*
surfpts/surface/swtr/inside/pset,get,rayend/ &
xyz /0. 0. 0./1. 0. 0./1. 1. 1./
* remove ray points and duplicate points
rmpoint/pset get rayend
filter/1 0 0
rmpoint/compress
```
Generate a set of points on a plane

View File

@@ -0,0 +1,72 @@
---
title: TRANS
tags: trans, translate
---
# TRANS
---------------------
Translate a mesh object from old to new coordinates.
## SYNTAX
<pre>
<b>trans</b>/ifirst,ilast,istride/xold,yold,zold/xnew,ynew,znew
<b>trans</b>/ifirst,ilast,istride/<b>enter</b> <b>zero</b> <b>original</b>/[<b>xyz</b> <b>rtp</b> <b>rtz</b>]/ [xdim,ydim,zdim]
</pre>
`ifirst,ilast,istride` is the range of points to translate. They can be defined as **pset,get,** pset_name or node numbers where 1,0,0 means all.
### First form of this command:
translates a set of points **from** point `xold,yold,zold` **to** new coordinate `xnew,ynew,znew` with a linear translation. This will then cause the remaining points in the set to be moved by the same translation.
### Second form of this command:
**`zero`** point set is translated so that (0,0,0) is located at the midpoint of min x,y,z and max x,y,z of the mesh.
**`center`** point set is translated so that (0,0,0) is located at the min x,y,z of the mesh.
**`original`** point set is translated to the original location before **enter** or **zero** was called.
**`xyz`** is the default (**rtp** and **rtz** are reserved for future implementation).
`xdim,ydim,zdim` indicate the axes along which to translate. For example, 1,1,0 or x,y will translate along
the x and y axes, the z values will not change.
## EXAMPLES
```
trans/pset,get,mypoints/ 0.,0.,0./2.0,2.0,0./
```
The points in the set mypoints will be moved 2 in the positive x direction and 2 in the positive y direction.
```
cmo/create/motet
copypts/motet/mopts
cmo/select/motet
trans/1,0,0/ zero
connect
trans/1,0,0/ original
```
Moving points close to zero coordinates will improve accuracy where coordinate numbers are large.
Here we move the points to zero, connect, and them move back to original coordinates.
[Click here for demos](../demos/description_trans.md)

Some files were not shown because too many files have changed in this diff Show More