Skip to content

Commit

Permalink
examples: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Jan 27, 2022
1 parent 20a695f commit feee2e3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions examples/userapi/05_conditional_dimension.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Use case A (honour a condition)\n",
"# Use case A - Honour a condition\n",
"\n",
"Now it's time to show a more descriptive example. We define a conditional that increments by one all values of a Function that are larger than zero. We name our `ConditionalDimension` `ci`.\n",
"In this example we want to update again by one all the elements in `f` that are larger than zero. Before updating the elements we reinitialize our data to the eye function."
Expand Down Expand Up @@ -666,7 +666,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Use case B (Function subsampling)\n",
"# Use case B - Function subsampling\n",
"\n",
"`ConditionalDimension`s are additionally indicated to implement `Function` subsampling. In the following example, an `Operator` subsamples `Function` `g` and saves its content into `f` every `factor=4` iterations."
]
Expand Down Expand Up @@ -787,10 +787,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Use case C (Count nonzero elements/ Find nonzero positions)\n",
"# Example A - Count nonzero elements\n",
"\n",
"Here we present another example of using `ConditionalDimension`. In the following example, an `Operator` counts the nonzero elements of an array.\n",
"This example may not have a practical use in Devito, but can help the reader to familarize with the use of `ConditionalDimension`."
"Here we present an of using `ConditionalDimension`. In the following example, an `Operator` counts the nonzero elements of an array."
]
},
{
Expand Down Expand Up @@ -938,6 +937,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Example B - Find nonzero positions \n",
"\n",
"Here we present another example of using `ConditionalDimension`. In the following example, an `Operator` counts the nonzero elements of an array.\n",
"\n",
"Now, let's take it a step further to return the nonzero positions in $f$. We know that we have `g.data[0]` nonzero elements. In this example, we use the Devito DSL to generate code that will save the nonzero positions."
]
},
Expand Down

0 comments on commit feee2e3

Please sign in to comment.