Skip to content

Commit

Permalink
small revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc2 committed Jan 2, 2025
1 parent d88ac48 commit ac48398
Show file tree
Hide file tree
Showing 3 changed files with 460 additions and 1,115 deletions.
30 changes: 14 additions & 16 deletions notebooks/02-intro-to-uxarray/grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
"cell_type": "markdown",
"id": "a2041dc5-06c0-4cae-bbfb-4f62bfb3b7ab",
"metadata": {},
"source": [
"We have already stated in the previous section that ``Grid`` is the UXarray class that ensures awareness of the unstructured grid topology. Exploring the grid geometry can be helpful throughout analysis and visualization workflows, and it can be done through either checking one of ``UxDataset.Grid`` and ``UxDataArray.Grid``, or looking at a standalone ``Grid`` object that can also be created with UXarray. "
]
"source": "In the previous section, we briefly introduced the ``Grid`` class, which stores unstructured grid variables such as coordinates and connectivity. This class is the foundation of UXarray, which ensures awareness of the unstructured grid topology between operations. Exploring the grid geometry can be helpful throughout analysis and visualization workflows. \n"
},
{
"cell_type": "markdown",
Expand All @@ -75,9 +73,7 @@
"cell_type": "markdown",
"id": "13319a80-c211-43b5-b7d1-dad74d4b6d94",
"metadata": {},
"source": [
"In the following sections, we will look into loading a standalone grid-specific file as follows with UXarray and then explore some of the ``Grid`` features."
]
"source": "In the following sections, we will look into loading a standalone grid-specific file. The coordinates and connectivity variables of an unstructured grid are often stored as a separate unstructured grid file. "
},
{
"cell_type": "code",
Expand Down Expand Up @@ -106,9 +102,7 @@
"cell_type": "markdown",
"id": "4e5f564a-3fb2-4fcc-b010-94a2631011a8",
"metadata": {},
"source": [
"The suggested way to construct a **standalone** `ux.Grid` is by using the `uxarray.open_grid()` method. Note that this way, you'd only be able to explore the grid topology and use only grid-specific functionality, i.e. you would not explore any actual data, which will be covered in the next section."
]
"source": "The suggested way to construct a **standalone** `Grid` is by using the `uxarray.open_grid()` method. When constructing a standalone grid, only topology variables such as coordinates and connectivity are used to construct the grid. This means that any data variables that reside on the unstructured grid, such as temperature, would not be stored in a `Grid`. Pairing the grid definiton with data variables will be covered in the next notebook. \n"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -1153,10 +1147,16 @@
"source": [
"import uxarray as ux\n",
"\n",
"uxgrid = ux.open_grid(\"../../meshfiles/outCSne30.grid.ug\")\n",
"uxgrid = ux.open_grid(grid_path)\n",
"uxgrid"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Printing a `Grid` displays the contents of our newly created grid object. If you are coming from an Xarray background, this output will look very similar to what one might see when constructing an `xarray.Dataset`. ",
"id": "df239b4dac17e91f"
},
{
"cell_type": "markdown",
"id": "a5a24484-e5c3-4d38-829f-359d9b3a23cb",
Expand All @@ -1169,9 +1169,7 @@
"cell_type": "markdown",
"id": "fefc4cad-d68e-4385-8b16-ecf32cc00185",
"metadata": {},
"source": [
"Different types of coordinates for the geometric elements of a ``Grid`` are either constructed upfront the the grid instantiation or generated at the time of use."
]
"source": "Different types of coordinates for the geometric elements of a ``Grid`` are either constructed upfront during the grid instantiation or generated at the time of use."
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -2450,11 +2448,11 @@
"id": "f8e5bca1-ea3d-46ea-bb4b-354f48576690",
"metadata": {},
"source": [
"In an unstructured grid geometry, connectivity information between each type of geometric elements can be defined, e.g. face-node, node-edge, edge-face, etc. UXarray requires only the **face-node** connectivity, either coming from the grid definition or being constructed by UXarray in special cases, in addition to the node coordinates to represent the topology. \n",
"In unstructured grid geometry, connectivity information between each type of geometric elements can be defined, e.g. face-node, node-edge, edge-face, etc. UXarray requires only the **face-node** connectivity, either coming from the grid definition or being constructed by UXarray in special cases, in addition to the node coordinates to represent the topology. \n",
"\n",
"All the other connectivity information can also be generated by UXarray when prompted.\n",
"UXarray can also generate all the other connectivity information when prompted.\n",
"\n",
"Let us look at the face-node connectivity for example:"
"Let us look at the face-node connectivity, for example:"
]
},
{
Expand Down
Loading

0 comments on commit ac48398

Please sign in to comment.