Skip to content

Commit c225416

Browse files
ryar9534rrsettgast
andauthored
docs: Move table titles from CompleteXMLSchema.rst to corresponding include file (#3321)
* alter SchemaToRSTDocumentation to move headers into table files * rename Element to XML Element * avoid includeding headers in table files when included outside of CompleteXMLSchema.rst --------- Co-authored-by: Randolph R. Settgast <settgast1@llnl.gov>
1 parent d6c5900 commit c225416

File tree

7 files changed

+102
-91
lines changed

7 files changed

+102
-91
lines changed

scripts/SchemaToRSTDocumentation.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def comment(self, data):
1313
self.end(etree.Comment)
1414

1515

16-
def writeTableRST(file_name, values):
16+
def writeTableRST(type_name, file_name, title_prefix, values):
17+
18+
element_header = '%s: %s' % (title_prefix, type_name)
19+
1720
L = [[len(x) for x in row] for row in values]
1821

1922
# np isn't in the docker images for our CI
@@ -54,7 +57,9 @@ def writeTableRST(file_name, values):
5457

5558
# Build table
5659
with open(file_name, 'w') as f:
57-
f.write('\n\n')
60+
f.write('%s\n' % (element_header))
61+
f.write('=' * len(element_header) + '\n')
62+
f.write('\n')
5863
f.write(boundary)
5964
f.write(formatted_lines[0])
6065
f.write(boundary)
@@ -269,13 +274,10 @@ def main(schema_name='schema.xsd', output_folder='./', xsd='{http://www.w3.org/2
269274
for type_name in sorted(input_attribute_map.keys()):
270275
# Write the individual tables
271276
table_values = buildTableValues(input_attribute_map[type_name])
272-
writeTableRST('%s/%s.rst' % (datastructure_folder, type_name), table_values)
277+
writeTableRST( type_name, '%s/%s.rst' % (datastructure_folder, type_name), 'XML Element', table_values)
273278

274279
# Write to the master list
275-
element_header = 'Element: %s' % (type_name)
276280
output_handle.write('\n.. _XML_%s:\n\n' % (type_name))
277-
output_handle.write('%s\n' % (element_header))
278-
output_handle.write('=' * len(element_header) + '\n')
279281
output_handle.write('.. include:: %s.rst\n\n' % (type_name))
280282

281283
# Parse the non-input schema definitions
@@ -288,13 +290,10 @@ def main(schema_name='schema.xsd', output_folder='./', xsd='{http://www.w3.org/2
288290
table_values = buildTableValues(other_attribute_map[type_name],
289291
link_string='DATASTRUCTURE',
290292
include_defaults=False)
291-
writeTableRST('%s/%s_other.rst' % (datastructure_folder, type_name), table_values)
293+
writeTableRST( type_name, '%s/%s_other.rst' % (datastructure_folder, type_name), 'Datastructure', table_values)
292294

293295
# Write to the master list
294-
element_header = 'Datastructure: %s' % (type_name)
295296
output_handle.write('\n.. _DATASTRUCTURE_%s:\n\n' % (type_name))
296-
output_handle.write('%s\n' % (element_header))
297-
output_handle.write('=' * len(element_header) + '\n')
298297
output_handle.write('.. include:: %s_other.rst\n\n' % (type_name))
299298

300299

src/coreComponents/events/docs/EventManager.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Event
5353
The children of the Event block define the events that may execute during a simulation. These may be of type ``HaltEvent``, ``PeriodicEvent``, or ``SoloEvent``. The exit criteria for the global event loop are defined by the attributes ``maxTime`` and ``maxCycle`` (which by default are set to their max values). If the optional logLevel flag is set, the EventManager will report additional information with regards to timestep requests and event forecasts for its children.
5454

5555
.. include:: /docs/sphinx/datastructure/Events.rst
56-
56+
:start-line: 3
5757

5858
PeriodicEvent
5959
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -68,20 +68,21 @@ By default, a PeriodicEvent will execute throughout the entire simulation. This
6868
The timestep request event is typically determined via its target. However, this value can be overridden by setting the ``forceDt`` or ``maxEventDt`` attributes.
6969

7070
.. include:: /docs/sphinx/datastructure/PeriodicEvent.rst
71-
71+
:start-line: 3
7272

7373
SoloEvent
7474
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7575
This type of event will execute once once the event loop reaches a certain cycle (targetCycle) or time (targetTime). Similar to the PeriodicEvent type, this event will modify its timestep requests so that a cycle occurs at the exact time requested (this can be turned off by specifying targetExactTimestep="0"). The forecast calculations follow an similar approach to the PeriodicEvent type.
7676

7777
.. include:: /docs/sphinx/datastructure/SoloEvent.rst
78-
78+
:start-line: 3
7979

8080
HaltEvent
8181
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8282
This event type is designed to track the wall clock. When the time exceeds the value specified via maxRunTime, the event will trigger and set a flag that instructs the main EventManager loop to cleanly exit at the end of the current cycle. The event for cast for this event type is given by: ``forecast = (maxRuntime - (currentTime - startTime)) / realDt``
8383

8484
.. include:: /docs/sphinx/datastructure/HaltEvent.rst
85+
:start-line: 3
8586

8687

8788

src/coreComponents/events/docs/TasksManager.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ Task
2222
The children of the Tasks block define different Tasks to be triggered by events specified in the :ref:`EventManager` during the execution of the simulation. At present the only supported task is the ``PackCollection`` used to collect time history data for output by a TimeHistory output.
2323

2424
.. include:: /docs/sphinx/datastructure/Tasks.rst
25-
25+
:start-line: 3
26+
2627
PackCollection
2728
***************************
2829
The ``PackCollection`` Task is used to collect time history information from fields. Either the entire field or specified named sets of indices in the field can be collected.
2930

3031
.. include:: /docs/sphinx/datastructure/PackCollection.rst
32+
:start-line: 3
3133

3234
Note: The time history information collected via this task is buffered internally until it is output by a linked TimeHistory Output.
3335

src/coreComponents/functions/docs/FunctionManager.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ A table function uses a set of pre-computed values defined at points on a struct
6565
Typically, the axes of the table will represent time and/or spatial dimensions; however, these can be applied to represent phase diagrams, etc.
6666

6767
.. include:: /docs/sphinx/datastructure/TableFunction.rst
68-
68+
:start-line: 3
6969

7070
1D Table
7171
*************
@@ -158,6 +158,7 @@ This function leverages the symbolic expression library mathpresso to define and
158158
These functions are processed using an x86-64 JIT compiler, so are nearly as efficient as natively compiled C++ expressions.
159159

160160
.. include:: /docs/sphinx/datastructure/SymbolicFunction.rst
161+
:start-line: 3
161162

162163
The ``variableNames`` attribute defines a set of single-character names for the inputs to the symbolic function.
163164
There should be a definition for each scalar input and for each component of a vector input.
@@ -188,7 +189,7 @@ This function is derived from the symbolic function.
188189
However, instead of using the time or object as inputs, it is used to combine the outputs of other functions using a symbolic expression.
189190

190191
.. include:: /docs/sphinx/datastructure/CompositeFunction.rst
191-
192+
:start-line: 3
192193

193194
The ``functionNames`` attribute defines the set of input functions to use (these may be of any type, and may each have any number of inputs).
194195
The ``variableNames`` attribute defines a set of single-character names for each function.

src/coreComponents/physicsSolvers/fluidFlow/SourceFluxStatistics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SourceFluxStatsAggregator::SourceFluxStatsAggregator( const string & name,
3131
Group * const parent ):
3232
Base( name, parent )
3333
{
34-
getWrapper< integer >( Group::viewKeyStruct::logLevelString() ).
34+
getWrapperBase( Group::viewKeyStruct::logLevelString() ).
3535
appendDescription( GEOS_FMT( "\n- Log Level 1 outputs the sum of all {0}(s) produced rate & mass,\n"
3636
"- Log Level 2 details values for each {0},\n"
3737
"- Log Level 3 details values for each region.",

src/coreComponents/schema/schema.xsd

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,10 @@ stress - traction is applied to the faces as specified by the inner product of i
17701770
</xsd:restriction>
17711771
</xsd:simpleType>
17721772
<xsd:complexType name="LinearSolverParametersType">
1773+
<!--adaptiveExponent => Exponent parameter for adaptive method-->
1774+
<xsd:attribute name="adaptiveExponent" type="real64" default="1" />
1775+
<!--adaptiveGamma => Gamma parameter for adaptive method-->
1776+
<xsd:attribute name="adaptiveGamma" type="real64" default="0.1" />
17731777
<!--amgAggressiveCoarseningLevels => AMG number of levels for aggressive coarsening-->
17741778
<xsd:attribute name="amgAggressiveCoarseningLevels" type="integer" default="0" />
17751779
<!--amgAggressiveCoarseningPaths => AMG number of paths for aggressive coarsening-->
@@ -1822,6 +1826,8 @@ stress - traction is applied to the faces as specified by the inner product of i
18221826
<xsd:attribute name="krylovMaxIter" type="integer" default="200" />
18231827
<!--krylovMaxRestart => Maximum iterations before restart (GMRES only)-->
18241828
<xsd:attribute name="krylovMaxRestart" type="integer" default="200" />
1829+
<!--krylovStrongestTol => Strongest-allowed tolerance for adaptive method-->
1830+
<xsd:attribute name="krylovStrongestTol" type="real64" default="1e-08" />
18251831
<!--krylovTol => Relative convergence tolerance of the iterative method
18261832
If the method converges, the iterative solution :math:`\mathsf{x}_k` is such that
18271833
the relative residual norm satisfies:
@@ -1900,7 +1906,7 @@ the relative residual norm satisfies:
19001906
<!--lineSearchAction => How the line search is to be used. Options are:
19011907
* None - Do not use line search.
19021908
* Attempt - Use line search. Allow exit from line search without achieving smaller residual than starting residual.
1903-
* Require - Use line search. If smaller residual than starting resdual is not achieved, cut time step.-->
1909+
* Require - Use line search. If smaller residual than starting resdual is not achieved, cut time-step.-->
19041910
<xsd:attribute name="lineSearchAction" type="geos_NonlinearSolverParameters_LineSearchAction" default="Attempt" />
19051911
<!--lineSearchCutFactor => Line search cut factor. For instance, a value of 0.5 will result in the effective application of the last solution by a factor of (0.5, 0.25, 0.125, ...)-->
19061912
<xsd:attribute name="lineSearchCutFactor" type="real64" default="0.5" />
@@ -1922,10 +1928,12 @@ the relative residual norm satisfies:
19221928
<xsd:attribute name="maxNumConfigurationAttempts" type="integer" default="10" />
19231929
<!--maxSubSteps => Maximum number of time sub-steps allowed for the solver-->
19241930
<xsd:attribute name="maxSubSteps" type="integer" default="10" />
1925-
<!--maxTimeStepCuts => Max number of time step cuts-->
1931+
<!--maxTimeStepCuts => Max number of time-step cuts-->
19261932
<xsd:attribute name="maxTimeStepCuts" type="integer" default="2" />
19271933
<!--minNormalizer => Value used to make sure that residual normalizers are not too small when computing residual norm.-->
19281934
<xsd:attribute name="minNormalizer" type="real64" default="1e-12" />
1935+
<!--minTimeStepIncreaseInterval => Minimum number of cycles since the last time-step cut for increasing the time-step again.-->
1936+
<xsd:attribute name="minTimeStepIncreaseInterval" type="integer" default="10" />
19291937
<!--newtonMaxIter => Maximum number of iterations that are allowed in a Newton loop.-->
19301938
<xsd:attribute name="newtonMaxIter" type="integer" default="5" />
19311939
<!--newtonMinIter => Minimum number of iterations that are required before exiting the Newton loop.-->
@@ -1941,15 +1949,15 @@ the relative residual norm satisfies:
19411949
<xsd:attribute name="sequentialConvergenceCriterion" type="geos_NonlinearSolverParameters_SequentialConvergenceCriterion" default="ResidualNorm" />
19421950
<!--subcycling => Flag to decide whether to iterate between sequentially coupled solvers or not.-->
19431951
<xsd:attribute name="subcycling" type="integer" default="0" />
1944-
<!--timeStepCutFactor => Factor by which the time step will be cut if a timestep cut is required.-->
1952+
<!--timeStepCutFactor => Factor by which the time-step will be cut if a time-step cut is required.-->
19451953
<xsd:attribute name="timeStepCutFactor" type="real64" default="0.5" />
1946-
<!--timeStepDecreaseFactor => Factor by which the time step is decreased when the number of Newton iterations is large.-->
1954+
<!--timeStepDecreaseFactor => Factor by which the time-step is decreased when the number of Newton iterations is large.-->
19471955
<xsd:attribute name="timeStepDecreaseFactor" type="real64" default="0.5" />
1948-
<!--timeStepDecreaseIterLimit => Fraction of the max Newton iterations above which the solver asks for the time-step to be decreased for the next time step.-->
1956+
<!--timeStepDecreaseIterLimit => Fraction of the max Newton iterations above which the solver asks for the time-step to be decreased for the next time-step.-->
19491957
<xsd:attribute name="timeStepDecreaseIterLimit" type="real64" default="0.7" />
1950-
<!--timeStepIncreaseFactor => Factor by which the time step is increased when the number of Newton iterations is small.-->
1958+
<!--timeStepIncreaseFactor => Factor by which the time-step is increased when the number of Newton iterations is small.-->
19511959
<xsd:attribute name="timeStepIncreaseFactor" type="real64" default="2" />
1952-
<!--timeStepIncreaseIterLimit => Fraction of the max Newton iterations below which the solver asks for the time-step to be increased for the next time step.-->
1960+
<!--timeStepIncreaseIterLimit => Fraction of the max Newton iterations below which the solver asks for the time-step to be increased for the next time-step.-->
19531961
<xsd:attribute name="timeStepIncreaseIterLimit" type="real64" default="0.4" />
19541962
<!--normType => Norm used by the flow solver to check nonlinear convergence. Valid options:
19551963
* Linfinity
@@ -2938,7 +2946,7 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions-->
29382946
<!--maxNumResolves => Value to indicate how many resolves may be executed to perform surface generation after the execution of flow and mechanics solver. -->
29392947
<xsd:attribute name="maxNumResolves" type="integer" default="10" />
29402948
<!--newFractureInitializationType => Type of new fracture element initialization. Can be Pressure or Displacement. -->
2941-
<xsd:attribute name="newFractureInitializationType" type="geos_HydrofractureSolver_lt_geos_SinglePhasePoromechanics_lt_geos_SinglePhaseBase_cm_-geos_SolidMechanicsLagrangianFEM_gt_-_gt__InitializationType" default="Pressure" />
2949+
<xsd:attribute name="newFractureInitializationType" type="geos_HydrofractureSolver_lt_geos_SinglePhasePoromechanics_lt_geos_SinglePhaseBase_cm_-geos_SolidMechanicsLagrangianFEM_gt__gt__InitializationType" default="Pressure" />
29422950
<!--solidSolverName => Name of the solid solver used by the coupled solver-->
29432951
<xsd:attribute name="solidSolverName" type="groupNameRef" use="required" />
29442952
<!--stabilizationMultiplier => Constant multiplier of stabilization strength-->
@@ -2961,7 +2969,7 @@ Local- Add jump stabilization on interior of macro elements-->
29612969
<!--name => A name is required for any non-unique nodes-->
29622970
<xsd:attribute name="name" type="groupName" use="required" />
29632971
</xsd:complexType>
2964-
<xsd:simpleType name="geos_HydrofractureSolver_lt_geos_SinglePhasePoromechanics_lt_geos_SinglePhaseBase_cm_-geos_SolidMechanicsLagrangianFEM_gt_-_gt__InitializationType">
2972+
<xsd:simpleType name="geos_HydrofractureSolver_lt_geos_SinglePhasePoromechanics_lt_geos_SinglePhaseBase_cm_-geos_SolidMechanicsLagrangianFEM_gt__gt__InitializationType">
29652973
<xsd:restriction base="xsd:string">
29662974
<xsd:pattern value=".*[\[\]`$].*|Pressure|Displacement" />
29672975
</xsd:restriction>

0 commit comments

Comments
 (0)