Skip to content

Commit 849b677

Browse files
committed
PYGEOSX_ to PYGEOS_
1 parent 5065190 commit 849b677

File tree

7 files changed

+43
-43
lines changed

7 files changed

+43
-43
lines changed

examples/pygeosxExamples/hydraulicFractureWithMonitor/hydraulicFractureWithMonitor.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11

2-
# PYGEOSX_SETUP
2+
# PYGEOS_SETUP
33
from mpi4py import MPI
44
import pygeosx
55
from pygeosx_tools import wrapper
66
from geosx_xml_tools.main import preprocess_parallel
77
import matplotlib.pyplot as plt
8-
# PYGEOSX_SETUP_END
8+
# PYGEOS_SETUP_END
99

1010

1111
def run_problem(plot_frequency=1):
1212
"""
1313
Run the GEOSX problem
1414
"""
15-
# PYGEOSX_INITIALIZATION
15+
# PYGEOS_INITIALIZATION
1616
# Get the MPI rank
1717
comm = MPI.COMM_WORLD
1818
rank = comm.Get_rank()
@@ -21,21 +21,21 @@ def run_problem(plot_frequency=1):
2121
args = preprocess_parallel()
2222
problem = pygeosx.initialize(rank, args)
2323
pygeosx.apply_initial_conditions()
24-
# PYGEOSX_INITIALIZATION_END
24+
# PYGEOS_INITIALIZATION_END
2525

26-
# PYGEOSX_KEY_SEARCH
26+
# PYGEOS_KEY_SEARCH
2727
# Rather than specifying the wrapper paths explicitly,
2828
# search for them using a set of filters
2929
fracture_location_key = wrapper.get_matching_wrapper_path(problem, ['Fracture', 'elementCenter'])
3030
fracture_aperture_key = wrapper.get_matching_wrapper_path(problem, ['Fracture', 'effectiveAperture'])
31-
# PYGEOSX_KEY_SEARCH_END
31+
# PYGEOS_KEY_SEARCH_END
3232

3333
# Note: we will be plotting our results.
3434
# This will modify the fonts so that they a bit easier to read
3535
plot_font = {'weight': 'normal', 'size': 8}
3636
plt.rc('font', **plot_font)
3737

38-
# PYGEOSX_QUERY_SETUP
38+
# PYGEOS_QUERY_SETUP
3939
# Setup values to record
4040
records = {fracture_location_key: {'label': 'Fracture Extents (m)',
4141
'scale': 1.0,
@@ -48,17 +48,17 @@ def run_problem(plot_frequency=1):
4848
'time': {'label': 'Time (min)',
4949
'scale': 1.0 / 60.0,
5050
'history': []}}
51-
# PYGEOSX_QUERY_SETUP_END
51+
# PYGEOS_QUERY_SETUP_END
5252

53-
# PYGEOSX_MAIN_LOOP
53+
# PYGEOS_MAIN_LOOP
5454
# Run the code
5555
query_count = 0
5656
while pygeosx.run() != pygeosx.COMPLETED:
5757
wrapper.run_queries(problem, records)
5858
query_count += 1
5959
if (query_count % plot_frequency == 0):
6060
wrapper.plot_history(records)
61-
# PYGEOSX_MAIN_LOOP_END
61+
# PYGEOS_MAIN_LOOP_END
6262

6363

6464
if __name__ == '__main__':

examples/pygeosxExamples/sedovWithStressFunction/run_sedov_problem.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from geosx_xml_tools.main import preprocess_parallel
77

88

9-
# PYGEOSX_STRESS_FN
9+
# PYGEOS_STRESS_FN
1010
def stress_fn(x):
1111
"""
1212
Function to set stress values
@@ -19,14 +19,14 @@ def stress_fn(x):
1919
"""
2020
R = x[:, 0]**2 + x[:, 1]**2 + x[:, 2]**2
2121
return np.sin(2.0 * np.pi * R / np.amax(R))
22-
# PYGEOSX_STRESS_FN_END
22+
# PYGEOS_STRESS_FN_END
2323

2424

2525
def run_problem():
2626
"""
2727
Run the GEOSX problem
2828
"""
29-
# PYGEOSX_INITIALIZATION
29+
# PYGEOS_INITIALIZATION
3030
# Get the MPI rank
3131
comm = MPI.COMM_WORLD
3232
rank = comm.Get_rank()
@@ -41,9 +41,9 @@ def run_problem():
4141
location_key = wrapper.get_matching_wrapper_path(problem, ['Region2', 'elementCenter'])
4242
stress_key = wrapper.get_matching_wrapper_path(problem, ['Region2', 'shale', 'stress'])
4343
ghost_key = wrapper.get_matching_wrapper_path(problem, ['Region2', 'cb1', 'ghostRank'])
44-
# PYGEOSX_INITIALIZATION_END
44+
# PYGEOS_INITIALIZATION_END
4545

46-
# PYGEOSX_STRESS_IC
46+
# PYGEOS_STRESS_IC
4747
# Print initial stress
4848
wrapper.print_global_value_range(problem, stress_key, 'stress')
4949

@@ -56,9 +56,9 @@ def run_problem():
5656
wrapper.set_wrapper_with_function(problem, stress_key, location_key, stress_fn, target_index=1)
5757
wrapper.set_wrapper_with_function(problem, stress_key, location_key, stress_fn, target_index=2)
5858
wrapper.print_global_value_range(problem, stress_key, 'stress')
59-
# PYGEOSX_STRESS_IC_END
59+
# PYGEOS_STRESS_IC_END
6060

61-
# PYGEOSX_MAIN_LOOP
61+
# PYGEOS_MAIN_LOOP
6262
# Run the code
6363
while pygeosx.run() != pygeosx.COMPLETED:
6464
wrapper.print_global_value_range(problem, stress_key, 'stress')
@@ -72,7 +72,7 @@ def run_problem():
7272

7373
tmp = wrapper.allgather_wrapper(problem, stress_key, ghost_key=ghost_key)
7474
print(wrapper.rank, 'allgather_ghost_filtered', np.shape(tmp), flush=True)
75-
# PYGEOSX_MAIN_LOOP_END
75+
# PYGEOS_MAIN_LOOP_END
7676

7777

7878
if __name__ == '__main__':

scripts/automatic_xml_preprocess.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ COMPILED_XML_NAME_OVERRIDE=""
99
PARAMETER_ARGS=""
1010
NEW_ARGS=""
1111
USE_PYGEOSX=1
12-
PYGEOSX_WARNINGS=0
12+
PYGEOS_WARNINGS=0
1313
SCRIPT_DIR=$(dirname "$0")
1414
PYGEOSX=$SCRIPT_DIR/../lib/PYGEOSX/bin/python
1515

@@ -37,7 +37,7 @@ do
3737
shift
3838
;;
3939
-w|--pygeosx-warnings)
40-
PYGEOSX_WARNINGS=$2
40+
PYGEOS_WARNINGS=$2
4141
shift
4242
;;
4343
-h|--help)
@@ -75,12 +75,12 @@ if [ "$USE_PYGEOSX" -eq "1" ]
7575
then
7676
if [ -f $PYGEOSX ]
7777
then
78-
if [ "$PYGEOSX_WARNINGS" -eq "1" ]
78+
if [ "$PYGEOS_WARNINGS" -eq "1" ]
7979
then
8080
echo "Using pygeosx to preprocess the xml file"
8181
fi
8282
else
83-
if [ "$PYGEOSX_WARNINGS" -eq "1" ]
83+
if [ "$PYGEOS_WARNINGS" -eq "1" ]
8484
then
8585
echo "Pygeosx installation not found... reverting to non-pygeosx version"
8686
fi

scripts/pygeosx_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def run_problem():
77
"""
88
Run the GEOSX problem
99
"""
10-
# PYGEOSX_INITIALIZATION
10+
# PYGEOS_INITIALIZATION
1111
# Get the MPI rank
1212
comm = MPI.COMM_WORLD
1313
rank = comm.Get_rank()

src/docs/sphinx/advancedExamples/pygeosxExamples/inSituDataMonitor/AdvancedExample.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ The custom packages include pygeosx, which provides an interface to GEOS, and py
6363

6464
.. literalinclude:: ../../../../../../examples/pygeosxExamples/hydraulicFractureWithMonitor/hydraulicFractureWithMonitor.py
6565
:language: python
66-
:start-after: # PYGEOSX_SETUP
67-
:end-before: # PYGEOSX_SETUP_END
66+
:start-after: # PYGEOS_SETUP
67+
:end-before: # PYGEOS_SETUP_END
6868

6969
In the next step, we apply the xml preprocessor to resolve the advanced xml features.
7070
Note that this step will modify the input arguments to reflect the location of the compiled xml file, which is processed directly by GEOS.
@@ -73,8 +73,8 @@ There is an opportunity to interact with the GEOS before the initial conditions
7373

7474
.. literalinclude:: ../../../../../../examples/pygeosxExamples/hydraulicFractureWithMonitor/hydraulicFractureWithMonitor.py
7575
:language: python
76-
:start-after: # PYGEOSX_INITIALIZATION
77-
:end-before: # PYGEOSX_INITIALIZATION_END
76+
:start-after: # PYGEOS_INITIALIZATION
77+
:end-before: # PYGEOS_INITIALIZATION_END
7878

7979
To extract information from the problem, you need to know the full path (or 'key') to the target object.
8080
These keys can be quite long, and can change depending on the xml input.
@@ -84,8 +84,8 @@ Note that these functions will throw an error if they do not find a matching key
8484

8585
.. literalinclude:: ../../../../../../examples/pygeosxExamples/hydraulicFractureWithMonitor/hydraulicFractureWithMonitor.py
8686
:language: python
87-
:start-after: # PYGEOSX_KEY_SEARCH
88-
:end-before: # PYGEOSX_KEY_SEARCH_END
87+
:start-after: # PYGEOS_KEY_SEARCH
88+
:end-before: # PYGEOS_KEY_SEARCH_END
8989

9090
Next, we setup a dictionary that will allow us to use pygeosx_tools to automatically query the problem.
9191
The root level of this dictionary contains the target keys (fracture location and aperture) and the required `time` key.
@@ -94,8 +94,8 @@ The target dictionaries also hold an entry `fhandle`, which contains a matplotli
9494

9595
.. literalinclude:: ../../../../../../examples/pygeosxExamples/hydraulicFractureWithMonitor/hydraulicFractureWithMonitor.py
9696
:language: python
97-
:start-after: # PYGEOSX_QUERY_SETUP
98-
:end-before: # PYGEOSX_QUERY_SETUP_END
97+
:start-after: # PYGEOS_QUERY_SETUP
98+
:end-before: # PYGEOS_QUERY_SETUP_END
9999

100100
After setting up the problem, we enter the main problem loop.
101101
Upon calling `pygeosx.run()`, the code will execute until a Python event is triggered in the Event loop.
@@ -104,8 +104,8 @@ Here, we use pygeosx_tools to query the datastructure and occasionaly plot the r
104104

105105
.. literalinclude:: ../../../../../../examples/pygeosxExamples/hydraulicFractureWithMonitor/hydraulicFractureWithMonitor.py
106106
:language: python
107-
:start-after: # PYGEOSX_QUERY_SETUP
108-
:end-before: # PYGEOSX_QUERY_SETUP_END
107+
:start-after: # PYGEOS_QUERY_SETUP
108+
:end-before: # PYGEOS_QUERY_SETUP_END
109109

110110

111111
---------------------------------

src/docs/sphinx/advancedExamples/pygeosxExamples/initialConditionModification/AdvancedExample.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,32 @@ Similar to the previous example, the python script begins by importing the requi
5959

6060
.. literalinclude:: ../../../../../../examples/pygeosxExamples/sedovWithStressFunction/run_sedov_problem.py
6161
:language: python
62-
:start-after: # PYGEOSX_INITIALIZATION
63-
:end-before: # PYGEOSX_INITIALIZATION_END
62+
:start-after: # PYGEOS_INITIALIZATION
63+
:end-before: # PYGEOS_INITIALIZATION_END
6464

6565
The next steps rely on a python function that we use to set stress.
6666
The argument to this function, x, is assumed to be a numpy array of element centers:
6767

6868
.. literalinclude:: ../../../../../../examples/pygeosxExamples/sedovWithStressFunction/run_sedov_problem.py
6969
:language: python
70-
:start-after: # PYGEOSX_STRESS_FN
71-
:end-before: # PYGEOSX_STRESS_FN_END
70+
:start-after: # PYGEOS_STRESS_FN
71+
:end-before: # PYGEOS_STRESS_FN_END
7272

7373
In the following section, we zero out the initial stress and then set it based on `stress_fn`.
7474
While doing this, we use `wrapper.print_global_value_range` to check on the process.
7575

7676
.. literalinclude:: ../../../../../../examples/pygeosxExamples/sedovWithStressFunction/run_sedov_problem.py
7777
:language: python
78-
:start-after: # PYGEOSX_STRESS_IC
79-
:end-before: # PYGEOSX_STRESS_IC_END
78+
:start-after: # PYGEOS_STRESS_IC
79+
:end-before: # PYGEOS_STRESS_IC_END
8080

8181
Finally, we run the simulation.
8282
As an optional step, we extract numpy arrays from the datastructure using different parallel approaches:
8383

8484
.. literalinclude:: ../../../../../../examples/pygeosxExamples/sedovWithStressFunction/run_sedov_problem.py
8585
:language: python
86-
:start-after: # PYGEOSX_MAIN_LOOP
87-
:end-before: # PYGEOSX_MAIN_LOOP_END
86+
:start-after: # PYGEOS_MAIN_LOOP
87+
:end-before: # PYGEOS_MAIN_LOOP_END
8888

8989

9090
---------------------------------

src/pygeosx/pygeosx.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*/
1414

1515
// Source includes
16-
#ifndef GEOS_PYGEOSX_PYGEOSX_HPP_
17-
#define GEOS_PYGEOSX_PYGEOSX_HPP_
16+
#ifndef GEOS_PYGEOS_PYGEOS_HPP_
17+
#define GEOS_PYGEOS_PYGEOS_HPP_
1818

1919
#include "LvArray/src/python/pythonForwardDeclarations.hpp"
2020
#include "mainInterface/GeosxState.hpp"

0 commit comments

Comments
 (0)