Skip to content

Commit c14174c

Browse files
Merge pull request #856 from baagaard-usgs/fix-default-nondimensionalization
Improve nondimensionalization adding a displacement scale
2 parents 93a8ebe + 22e2150 commit c14174c

File tree

411 files changed

+6013
-5519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

411 files changed

+6013
-5519
lines changed

configure.ac

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ AC_CHECK_HEADER([mpi.h], [], [AC_MSG_ERROR([header 'mpi.h' not found])])
114114

115115
dnl PETSC
116116
AC_LANG(C)
117-
CIT_PATH_PETSC([3.23.5])
117+
CIT_PATH_PETSC([3.24.0])
118118
CIT_HEADER_PETSC
119119
CIT_CHECK_LIB_PETSC
120120

@@ -205,6 +205,7 @@ AC_CONFIG_FILES([Makefile
205205
libsrc/pylith/problems/Makefile
206206
libsrc/pylith/topology/Makefile
207207
libsrc/pylith/utils/Makefile
208+
libsrc/pylith/scales/Makefile
208209
libsrc/pylith/testing/Makefile
209210
modulesrc/Makefile
210211
modulesrc/include/Makefile
@@ -216,6 +217,7 @@ AC_CONFIG_FILES([Makefile
216217
modulesrc/meshio/Makefile
217218
modulesrc/mpi/Makefile
218219
modulesrc/problems/Makefile
220+
modulesrc/scales/Makefile
219221
modulesrc/topology/Makefile
220222
modulesrc/utils/Makefile
221223
tests/Makefile
@@ -233,6 +235,7 @@ AC_CONFIG_FILES([Makefile
233235
tests/libtests/problems/Makefile
234236
tests/libtests/problems/data/Makefile
235237
tests/libtests/meshio/data/Makefile
238+
tests/libtests/scales/Makefile
236239
tests/libtests/topology/Makefile
237240
tests/libtests/topology/data/Makefile
238241
tests/libtests/testing/Makefile

developer/uncrustify.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ sp_endif_cmt = Add
5151
sp_after_new = Add
5252
sp_paren_brace = Add
5353
sp_fparen_brace = Add
54-
sp_before_tr_emb_cmt = Force
55-
sp_num_before_tr_emb_cmt = 1
54+
sp_before_tr_cmt = Force
55+
sp_num_before_tr_cmt = 1
5656

5757
# Align
5858
align_left_shift = True
@@ -98,7 +98,7 @@ nl_if_leave_one_liners = True
9898
nl_after_brace_open = False
9999
nl_after_brace_close = False
100100
nl_after_brace_open_cmt = False
101-
nl_max = 2
101+
nl_max = 3
102102
nl_after_func_proto = 2
103103
nl_after_func_body = 3
104104
nl_after_func_body_class = 2

docs/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ dist_noinst_DATA = \
679679
user/problems/figs/hdf5layout.svg \
680680
user/problems/figs/hdf5layout.tex \
681681
user/problems/index.md \
682+
user/problems/nondimensionalization.md \
682683
user/problems/output.md \
683684
user/problems/problems.md \
684685
user/run-pylith/figs/cells2d.pdf \

docs/developer/implementation/figs/classdiagram_problem.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
\node (pyre-component) [abstract-class, anchor=west] at ($(pythia-component.east)+(2em,0)$) {\umlemptyclass{PyreComponent}};
2020

2121
\node (python-problem) [abstract-class] at ($(petsc-component.south)-(0,4em)$) {\umlclass{Python Problem}{%
22-
normalizer\\
22+
scales\\
2323
materials\\
2424
bc\\
2525
interfaces\\
@@ -28,7 +28,7 @@
2828
observers
2929
}};
3030
\node (cxx-problem) [abstract-class, anchor=north] at ($(python-problem.north)+(12em,0)$) {\umlclass{C++ Problem}{%
31-
normalizer\\
31+
scales\\
3232
materials\\
3333
bc\\
3434
interfaces\\
@@ -53,8 +53,8 @@
5353
}};
5454

5555

56-
\node (normalizer) [abstract-class, anchor=west] at ($(cxx-problem.east)+(12em,12em)$) {\umlemptyclass{spatialdata::units::Nondimensional}};
57-
\node (material) [abstract-class] at ($(normalizer.south)-(0,1em)$) {\umlemptyclass{Material}};
56+
\node (scales) [abstract-class, anchor=west] at ($(cxx-problem.east)+(12em,12em)$) {\umlemptyclass{pylith::scales::Scales}};
57+
\node (material) [abstract-class] at ($(scales.south)-(0,1em)$) {\umlemptyclass{Material}};
5858
\node (bc) [abstract-class] at ($(material.south)-(0,1em)$) {\umlemptyclass{BoundaryCondition}};
5959
\node (interface) [abstract-class] at ($(bc.south)-(0,1em)$) {\umlemptyclass{FaultCohesive}};
6060
\node (gravity-field) [concrete-class] at ($(interface.south)-(0,1em)$) {\umlemptyclass{spatialdata::spatialdb::GravityField}};
@@ -76,7 +76,7 @@
7676
\draw[inherit] (cxx-problem) -- (pyre-component);
7777
\draw[inherit] (cxx-time-dependent) -- (cxx-problem);
7878

79-
\draw[aggregate] ($(cxx-problem.east)+(0,8ex)$) -- (normalizer.west);
79+
\draw[aggregate] ($(cxx-problem.east)+(0,8ex)$) -- (scales.west);
8080
\draw[aggregate] ($(cxx-problem.east)+(0,5.5ex)$) -- (material.west);
8181
\draw[aggregate] ($(cxx-problem.east)+(0,3.0ex)$) -- (bc.west);
8282
\draw[aggregate] ($(cxx-problem.east)+(0,0.5ex)$) -- (interface.west);

docs/developer/testing/libtests.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace pylith {
6060
class pylith::problems::TestPhysics : public CppUnit::TestFixture {
6161
CPPUNIT_TEST_SUITE(TestPhysics); // CppUnit macro used to define the `TestPhysics` test suite.
6262
63-
CPPUNIT_TEST(testSetNormalizer); // CppUnit macro to add test implemented by class method.
63+
CPPUNIT_TEST(testSetScales); // CppUnit macro to add test implemented by class method.
6464
CPPUNIT_TEST(testSetAuxiliaryFieldDB);
6565
CPPUNIT_TEST(testSetAuxiliarySubfieldDiscretization);
6666
CPPUNIT_TEST(testObservers);
@@ -81,7 +81,7 @@ public:
8181
8282
// Methods that implement tests. The naming convention is testMethodName.
8383
// All test methods must return void and not have any arguments.
84-
void testSetNormalizer(void);
84+
void testSetScales(void);
8585
void testSetAuxiliaryFieldDB(void);
8686
void testSetAuxiliarySubfieldDiscretization(void);
8787
void testObservers(void);
@@ -129,20 +129,20 @@ pylith::problems::TestPhysics::tearDown(void) {
129129
130130
131131
void
132-
pylith::problems::TestPhysics::testSetNormalizer(void) {
132+
pylith::problems::TestPhysics::testSetScales(void) {
133133
PYLITH_METHOD_BEGIN;
134134
135-
spatialdata::units::Nondimensional normalizer;
135+
pylith::scales::Scales scales;
136136
const PylithReal lengthScale = 3.0;
137-
normalizer.setLengthScale(lengthScale);
137+
scales.setLengthScale(lengthScale);
138138
139139
CPPUNIT_ASSERT(_physics);
140-
_physics->setNormalizer(normalizer);
140+
_physics->setScales(scales);
141141
142-
CPPUNIT_ASSERT_DOUBLES_EQUAL(lengthScale, _physics->_normalizer->getLengthScale(), 1.0e-6);
142+
CPPUNIT_ASSERT_DOUBLES_EQUAL(lengthScale, _physics->_scales->getLengthScale(), 1.0e-6);
143143
144144
PYLITH_METHOD_END;
145-
} // testSetNormalizer
145+
} // testSetScales
146146
147147
148148
void

docs/user/components/problems/GreensFns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Implements `Problem`.
2525
* `materials`: Materials in problem.
2626
- **current value**: 'homogeneous', from {default}
2727
- **configurable as**: homogeneous, materials
28-
* `normalizer`: Nondimensionalizer for problem.
28+
* `scales`: Nondimensionalizer for problem.
2929
- **current value**: 'nondimelasticquasistatic', from {default}
30-
- **configurable as**: nondimelasticquasistatic, normalizer
30+
- **configurable as**: nondimelasticquasistatic, scales
3131
* `petsc_defaults`: Flags controlling which default PETSc options to use.
3232
- **current value**: 'petscdefaults', from {default}
3333
- **configurable as**: petscdefaults, petsc_defaults

docs/user/components/problems/Problem.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ If the nonlinear (SNES) solver requires multiple iterations to converge for thes
2929
* `materials`: Materials in problem.
3030
- **current value**: 'homogeneous', from {default}
3131
- **configurable as**: homogeneous, materials
32-
* `normalizer`: Nondimensionalizer for problem.
32+
* `scales`: Nondimensionalizer for problem.
3333
- **current value**: 'nondimelasticquasistatic', from {default}
34-
- **configurable as**: nondimelasticquasistatic, normalizer
34+
- **configurable as**: nondimelasticquasistatic, scales
3535
* `petsc_defaults`: Flags controlling which default PETSc options to use.
3636
- **current value**: 'petscdefaults', from {default}
3737
- **configurable as**: petscdefaults, petsc_defaults

docs/user/components/problems/TimeDependent.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Implements `Problem`.
2828
* `materials`: Materials in problem.
2929
- **current value**: 'homogeneous', from {default}
3030
- **configurable as**: homogeneous, materials
31-
* `normalizer`: Nondimensionalizer for problem.
31+
* `scales`: Nondimensionalizer for problem.
3232
- **current value**: 'nondimelasticquasistatic', from {default}
33-
- **configurable as**: nondimelasticquasistatic, normalizer
33+
- **configurable as**: nondimelasticquasistatic, scales
3434
* `petsc_defaults`: Flags controlling which default PETSc options to use.
3535
- **current value**: 'petscdefaults', from {default}
3636
- **configurable as**: petscdefaults, petsc_defaults
@@ -89,8 +89,8 @@ ic = [domain]
8989
# Turn on gravitational body forces
9090
gravity_field = spatialdata.spatialdb.GravityField
9191

92-
# Set the normalizer for nondimensionalizing the problem
93-
normalizer = spatialdata.units.NondimElasticQuasistatic
92+
# Set the scales for nondimensionalizing the problem
93+
scales = pylith.scales.NondimElasticQuasistatic
9494

9595
# Set the subfields in the solution
9696
solution = = pylith.problems.SolnDispLagrange

docs/user/examples/box-2d/step05-sheardisptractrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ start_time = -1.0*year
3434
end_time = 5.0*year
3535
initial_dt = 1.0*year
3636
37-
[pylithapp.problem.normalizer]
37+
[pylithapp.problem.scales]
3838
relaxation_time = 10.0*year
3939
```
4040

docs/user/examples/box-3d/step05-sheardisptractrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ initial_dt = 1.0*year
3434
start_time = -1.0*year
3535
end_time = 5.0*year
3636
37-
[pylithapp.problem.normalizer]
37+
[pylithapp.problem.scales]
3838
relaxation_time = 10.0*year
3939
```
4040

0 commit comments

Comments
 (0)