Documentation for alamo
Table of contents
Getting Started
Note: this README page is also the Doxygen main page, the Github readme page,
and the Docs main page.
You can view it by running make docs
in the root directory, then opening
docs/doxygen/html/index.html
or docs/build/html/index.html
in a web browser.
Downloading Alamo
Download alamo using git:
git clone git@github.com:solidsgroup/alamo.git
If you do not have a Github account and/or you have not uploaded your public SSH key, this will probably throw an error. You can download alamo using HTTPS instead,
https://github.com/solidsuccs/alamo.git
Note, however, that you will not be able to push anything using HTTPS authentication.
The master
branch is the most stable and is what is checked out by default.
The develompent
branch is generally stable, and includes the latest functionality.
To switch to development
, in the alamo directory,
git checkout development
Installing dependencies
Alamo depends primarily on AMReX, but has some of its own dependencies, such as Eigen. The two officially supported Linux distributions are currently: the latest version of Ubuntu, and Ubuntu 20.04. (This is subject to change). If you are using Ubuntu (or a debian-based distribution) you can install all necessary dependencies by running the dependencies script:
sudo bash .github/workflows/dependencies.sh
If you are using a non-debian based system such as RedHat, you can install the corresponding packages in dependencies.sh
.
Windows and Mac OS are not supported.
Configuring
To compile alamo, you must first run the configure script. This is done simply by running the following in the alamo directory (note that AMReX download is triggered by this command, so it may take a couple minutes to complete depending on your internet connection)
./configure
By default, alamo will configure in 3D production mode. To compile in 2D debug mode,
./configure --dim=2 --debug
There are multiple compilation options available for Alamo, and they must all be specified at configure time. For a complete listing of the Alamo configuration options, type
./configure --help
Note
The configure script produces output designed to assist in determining compile issues with Alamo. Whenever you request help with alamo, please always include the complete output of the configure script.
Compiling
Once you have configured Alamo, compile it by
make
If you are on a platform with multiple cores, you can compile in parallel (for instance, with 4 cores) with
make -j4
The alamo exectuable will be stored in ./bin/
and name according to the options specified at configure time.
For instance, if you are using GCC to make Alamo in 2D using debug mode, the alamo executable will be ./bin/alamo-2d-debug-g++
.
You can work with multiple versions of Alamo at the same time without having to re-compile the entire code base.
All you need to do is re-run the configure script, and previous versions of Alamo and AMReX will be saved automatically.
Warning
There is an issue with GNU Make that can cause I/O errors during parallel builds. You may get the following error:
make[1]: write error: stdout
To continue the build, just issue the make
command again and it should continue normally.
You can also add the --output-sync=target
option which may help eliminate the issue.
Testing
Upon successful compilation, run tests by
make test
This will run the unit tests and regression tests for all compiled production versions of Alamo.
If you have only run in 2D, only 2D tests will be generated.
If you are a developer and you are preparing to merge your branch into development
, you should perform a complete test via
./configure --dim=2
make
./configure --dim=3
make
make test
For a full description of the Alamo regression test system, please see
Common Error Messages
The following are some common error messages and problems encountered:
MLLinOp: grids not coarsenable between AMR levels
This is a conflict in the multigrid solver because the grid size is not a power of 2. Solve by changing the domain dimensions (amr.n_cell) so that they are powers of two.static_cast<long>(i) < this->size() failed
One common reason this happens is if Dirichlet/Neumann boundaries are specified but no boundary values are provided.error: lvalue required as left operand of assignment
This can happen when using the()
operator with aIsotropic
Matrix4
-type object. Because this data structure only stores two constants, it is not possible to define any of the values using indices. (Similarly, you cannot set anIsotropic
4-matrix to aCubic
4-matrix since the Cubic matrix has lower symmetry). If you get this error, you should use a lower-symmetry 4-matrix.Inconsistent box arrays
This is known to happen when using anOperator::Elastic
inside anIntegrator
, e.g. inTimeStepBegin
. Typically this happens when the Elastic operator is not initialized within the routine in which it is used - i.e.e if it is declared as a member variable inside theIntegrator
- derived class. (The reason is that there are AMReX-specific functions that only get called by the constructor.) The fix is to initialize the operator object inside the routine in which it is used - either by making the member variable a pointer and using thenew
keyword, or by just creating the variable inside the function.
Generating this documentation
Generating documentation requires the following packages:
Doxygen (on Ubuntu:
sudo apt install doxygen
)Sphinx (on Ubuntu:
sudo apt install python3-sphinx
)Breathe (on Ubuntu:
sudo apt install python3-breathe
)M2R (on Ubuntu:
python3 -m pip install m2r
)RTD theme (on Ubuntu:
python3 -m pip install sphinx_rtd_theme
)GraphViz (on Ubuntu:
sudo apt install graphviz
)
To generate the documentation, type
make docs
(You do not need to run ./configure
before generating documentation.)
Documentation will be generated in docs/build/html and can be viewed using a browser.
Compiling on STAMPEDE2
To compile on STAMPEDE2 you must first load the following modules:
module load python3
This will load Python3. The following configure script is recommended:
./configure --build-amrex --get-eigen --comp=icc
where other arguments (e.g. --dim=2
) can be added as necessary.
Finally, make with
make
Warning
Remember to use good stewardship when compiling and running on a supercomputer.
(For instance, do not use make -j16
to build.)
Be sure to consult the Stampede2 user guide: https://portal.tacc.utexas.edu/user-guides/stampede2;
along with https://solids.uccs.edu/resources/xsede.php for general Stampede2/XSEDE instructions.
SimBA
Reproducibility is critical to ensuring the integrity of simulation results. SimBA is a set of python scripts designed to manage, organize, and view Alamo simulations through a web browser. It integrates with Alamo’s metadata recording functionality and uses a database to manage simulation information.
Running SimBA
Suppose you have a directory containing a collection of simulation results.
output
output.old.1111111
output.old.2222222
output.old.3333333
Begin by running ./simba/database.py output*
.
This should produce the following output:
ADDED TABLE: simulation_data
├╴Inserting: output
├╴Inserting: output.old.1111111
├╴Inserting: output.old.2222222
├╴Inserting: output.old.3333333
└╴Done
and should create a database called results.db
in your directory.
Note that the database name and table name are all customizable.
Now, you can start the web interface with ./simba/web.py
.
Open a browser and go to localhost:5000
.
You should see each of your simulation entries listed.
You can click on each entry to see greater detail, and you can edit the “Description” and “Tags” fields to record information about the simulation.
You can also delete simulations (and the corresponding directory).
The SimBA web interface will automatically recognize images stored within the simulation directory, and will display them under the simulation entry.
Updating SimBA Records
Simulation directories are never overwritten - following the AMReX implementation, old directories are renamed if there is a naming conflict.
SimBA recognizes this and accounts for it.
In the above example, suppose that another simulation was run so that output
was renamed to be output.old.4444444
.
Running SimBA again produces the following output
ADDED TABLE: simulation_data
├╴Inserting: output
├╴Updating: output.old.1111111 ( record already exists )
├╴Updating: output.old.2222222 ( record already exists )
├╴Updating: output.old.3333333 ( record already exists )
├╴Moving: output --> output.old.4444444
└╴Done
Alamo records a unique identifier for each simulation that is stored in the metadata
file - this way simulations can be moved around and renamed without losing their designation in the SimBA database.
Note
SimBA does need to be updated using the database.py
script - the web interface does not
do this automatically (yet).
Autodoc and Autotest
Alamo includes a self-contained automatic documentation (autodoc) and automatic test (autotest) system. The purpose of the custom autodoc and autotest systems is to:
Make it easy for developers to add documentation and regression tests
Keep documentation and tests accessible and up-to-date
Prevent old or out-of-date documentation.
Autodoc system
The autodoc system parses the source files stored in ./src/
to generate the content of the
Inputs portion of this documentation.
There are two ways to create compliant documentation: via parser comments, and via header file
comments.
Parser comments
The IO::ParmParse
class (inherited from the AMReX ParmParse
class) is used to read
all input paramters from the input file, usually though lines like this:
pp.query("lame",lambda);
pp.query("shear",mu);
To generate the autodocumentation, simply add a standard C++ comment following the query line:
pp.query("lame",lambda); // Lame parameter
pp.query("shear",mu); // Shear modulus
or immediately preceeding the query line:
// Lame parameter
pp.query("lame",lambda);
// Shear modulus
pp.query("shear",mu);
Note that the parser object must be called pp
for the autodoc system to locate the query.
As long as the convention is followed, the content of the comments will be automatically scraped
and included in the Inputs section of the documentation.
(For instance: Model::Solid::Linear::Isotropic)
Header comments
General comments to document a class, or collection of methods, goes at the top of the associated
header file.
Use standard C++ comments (//
).
These comments will get scraped by the autodoc system, and will be formatted along with the rest
of the inputs.
For example, consider the documentation for the linear isotropic material model class. The following leading comment is formatted at Model::Solid::Linear::Isotropic
//
// This model implements an isotropic linear elastic material.
// See `this link <https://en.wikipedia.org/wiki/Linear_elasticity#(An)isotropic_(in)homogeneous_media>`_
// for more information about the theory.
//
// Free energy for a linear material is defined as
//
// .. math::
//
// W(\nabla\mathbf{u}) =
// \frac{1}{2}\nabla\mathbf{u}\cdot\mathbb{C}\,\nabla\mathbf{u}
//
// For an isotropic material, stress and strain are related through
//
// .. math::
//
// \mathbb{C}_{ijkl} = \lambda \delta_{ij}\varepsilon_{kk} + 2\mu\varepsilon_{ij}
//
// where :math:`\lambda` and :math:`\mu` are the Lame constant and shear modulus, respectively.
// Users can specify these either through (:code:`lame` and :code:`shear`)
// OR (:code:`lambda` and :code:`mu`) OR (:code:`E` and :code:`nu`).
//
// Class methods:
//
// #. :code:`Isotropic()`:
// Basic constructor. Does nothing, and leaves all values initiated as NAN.
// #. :code:`Isotropic(Solid<Set::Sym::Isotropic> base)`
// Basic constructor. Does nothing gut allows for inheritance.
// #. :code:`Isotropic(Set::Scalar a_mu, Set::Scalar a_lambda)`
// BAD old-fashioned constructor. Do not use!
// #. :code:`~Isotropic()`
// Simple destructor. Don't need to change it.
// #. :code:`void Define(Set::Scalar a_mu, Set::Scalar a_lambda)`
// BAD old-fashioned way of doing things. Use :code:`Parse` instead.
// #. :code:`Set::Scalar W(const Set::Matrix & gradu) const override`
// Returns elastic free energy density
// #. :code:`Set::Matrix DW(const Set::Matrix & gradu) const override`
// Returns first derivative of free energy, the stress tensor
// #. :code:`Set::Matrix4<...> DDW(const Set::Matrix & ) const override`
// Returns second derivative of free energy, the modulus tensor
// #. :code:`virtual void Print(std::ostream &out) const override`
// Prints the modulus tensor object to output stream (usually the terminal)
// #. :code:`static Isotropic Random()`
// Static method that generates a random yet acceptable model.
// #. :code:`static Isotropic Zero()`
// Static method that generates a "zero" element (so that there is no effect under addition)
// #. :code:`static void Parse(Isotropic & value, IO::ParmParse & pp)`
// Parser where all the IO occurs
//
//
ReStructuredText
All comments are formatted using restructuredtext markup. You can make use of this is if you like, but it is not required for good documentation.
Documentation generation
To generate this documentation, complete with the scraped markup, run
make docs
in the alamo root directory.
The file alamo/docs/requirements.txt
contains a list of the necessary packages.
You can install them using pip.
Once the documenation generation is complete, you can view it by
google-chrome docs/build/html/index.html
Autotest system
Alamo contains a complete regression testing system to ensure that established capabilities do not get lost during subsequent development. Regression tests are run automatically by github, and must all pass prior to merge into the development or master branches. For information on how to run the regression tests, see Testing.
Test requirements
Remember that your test will be run automatically on GitHub and by other users, so avoid creating long, memory-intensive tests. Instead, design your tests so that they run long enough to identify errors, but short enough so that they can be performed tractable. Make sure that your tests are not redundant with existing tests as well.
Creating a test
Create a subdirectory in the
./tests
with your test name, e.g. “MyTest” [./tests/MyTest
]Place your test input file in this directory and name it input [
./tests/input
].At the top of the test input file, add
#@ [sectionname]
where
sectionname
can be any unique handle name. The#@
directive is ignored by alamo, but all comments beginning with it will be parsed by the autotest system.Test your test by running
./scripts/runtests ./tests/MyTest
If alamo has been compiled in 3D, this should cause your test to run. The output of your test will be stored in
./tests/MyTest/output_YYYY-MM-DD_HH.MM.SS_hostname_sectionname
Once you have done this, your test will be executed along with all other regression tests by GitHub. If your test fails to complete - for instance, it segfaults or aborts abnormally - this will trigger a “failed test”
Input file directives
There are several directives that you can use for your inputs. These are written using the #@ comments at the top of the input file.
#@ [2D-serial-5levels] | each [...] specifies a run of the test
#@ dim = 2 | specify two dimensions
#@ nprocs = 1 | specify running in serial (the default)
#@ check = false | for this test we do not want to run the verification
#@
#@ [3D-parallel-4levels] | another test
#@ dim = 3 | specify running in 3D (the default)
#@ nprocs = 4 | specify run in parallel with 4 processors
#@ args = amr.max_level=4 | specify an additional argument to be added to input file
#@ benchmark-beaker = 16.10 | timing test: benchmark-id record current average time to
#@ benchmark-statler = 11.36 | run on platform "id". The autotest system will let you
#@ benchmark-github = 22.75 | know if future changes slow the test down.
#@ ignore = myargument | tell alamo to ignore certain arguments
For additional examples, see the Tests section.
Test verification
Successfully running a test does not tell you much unless you know that the correct answer was produced.
To automatically verify your test, add an executable file called test
to the test directory:
./tests/MyTest/test
The test script must be executable, and can be written in a language of your choice, as long as you have the appropriate shebang at the top. There are two requirements on the test script:
It must take a single argument, the test directory name.
It produces a zero error code if the test passes, and a nonzero error code if the test fails.
It is up to you to make sure that the test accurately assesses the output. You can store reference data inside the test directory; e.g.
./tests/MyTest/reference/stress_xx.dat
./tests/MyTest/reference/stress_xy.dat
....
as long as the data files are reasonably small in size and, of course, are text-based. For example tests, see the existing tests in the repository.
Tests
Status |
Name |
Sections |
Dimension |
Validation |
---|---|---|---|---|
warning |
400GrainStampede2 |
|||
warning |
Disconnection |
|||
warning |
Dynamics |
|||
check_circle |
3 |
2d 3d_rotation |
verified |
|
warning |
EshelbyDynamics |
|||
warning |
Expression |
|||
warning |
Flame |
|||
warning |
Fracture2DDeflection |
|||
check_circle |
2 |
2d 3d_rotation |
verified |
|
check_circle |
1 |
2d |
verified |
|
check_circle |
1 |
2d |
verified |
|
check_circle |
3 |
2d 3d_rotation |
verified |
|
check_circle |
1 |
2d |
||
check_circle |
2 |
2d |
verified |
|
check_circle |
2 |
2d |
verified |
|
check_circle |
2 |
2d |
verified |
|
check_circle |
9 |
2d 3d_rotation |
verified |
|
check_circle |
1 |
2d |
verified |
|
warning |
ThermoElastic |
|||
check_circle |
1 |
2d |
||
check_circle |
6 |
2d 3d_rotation |
verified |
|
check_circle |
6 |
2d 3d_rotation |
verified |
|
check_circle |
2 |
2d |
verified |
|
check_circle |
2 |
2d |
verified |
Eshelby
This example demonstrates the Mechanics solver using the Eshelby inclusion problem. The example primarily tests the following Alamo capabilities
In 2D, the sigma_xx
solution is:

In 3D, the solution is tested against the exact solution derived using Eshelby inclusion theory. For additional background see Runnels et al: https://doi.org/10.1016/j.jcp.2020.110065
[Eshelby] 2D-serial-5levels
2d |
Two-dimensional |
square |
Serial |
report_off |
No testing script |
play_circle |
./bin/alamo-2d-g++ tests/Eshelby/input
|
[Eshelby] 3D-serial-4levels
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
16.10s (beaker) 11.36s (statler) 22.75s (github) |
play_circle |
./bin/alamo-3d-g++ tests/Eshelby/input amr.max_level="4"
|
[Eshelby] 3D-parallel-5levels
3d_rotation |
Three-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
timer |
24.66s (beaker) 18.76s (statler) |
play_circle |
mpiexec -np 4 ./bin/alamo-3d-g++ tests/Eshelby/input
|
#@ [2D-serial-5levels]
#@ dim = 2
#@ nprocs = 1
#@ check = false
#@
#@ [3D-serial-4levels]
#@ dim = 3
#@ nprocs = 1
#@ args = amr.max_level=4
#@ benchmark-beaker = 16.10
#@ benchmark-statler = 11.36
#@ benchmark-github = 22.75
#@
#@ [3D-parallel-5levels]
#@ dim = 3
#@ nprocs = 4
#@ benchmark-beaker = 24.66
#@ benchmark-statler = 18.76
alamo.program = mechanics
alamo.program.mechanics.model = affine.isotropic
plot_file = tests/Eshelby/output
# this is not a time integration, so do
# exactly one timestep and then quit
timestep = 0.1
stop_time = 0.1
# amr parameters
amr.plot_int = 1
amr.max_level = 5
amr.n_cell = 32 32 32
amr.blocking_factor = 8
amr.regrid_int = 1
amr.grid_eff = 1.0
amr.cell.all = 1
# geometry
geometry.prob_lo = -8 -8 -8
geometry.prob_hi = 8 8 8
geometry.is_periodic = 0 0 0
# ellipse configuration
ic.type = ellipse
ic.ellipse.a = 1.0 0.75 0.5 # ellipse radii
ic.ellipse.x0 = 0 0 0 # location of ellipse center
ic.ellipse.eps = 0.1 # diffuse boundary
# elastic moduli
nmodels = 2
model1.E = 210
model1.nu = 0.3
model1.F0 = 0.001 0 0 0 0.001 0 0 0 0.001 # eigenstrain
model2.E = 210
model2.nu = 0.3
model2.F0 = 0 0 0 0 0 0 0 0 0 # eigenstrain
solver.verbose = 3
solver.nriters = 1
solver.max_iter = 20
HeatConduction
This is the test for the Integrator::HeatConduction integrator. All BCs are Dirichlet. Low faces have constant nonzero temperature, high faces have constant zero temperature. Domain is initialized with zero temperature. Sample result below in 3D:

[HeatConduction] 2d-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/HeatConduction/input
|
[HeatConduction] 3d-parallel
3d_rotation |
Three-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
timer |
7.66s (beaker) |
play_circle |
mpiexec -np 4 ./bin/alamo-3d-g++ tests/HeatConduction/input
|
#@
#@ [2d-serial]
#@ dim=2
#@
#@ [3d-parallel]
#@ dim=3
#@ nprocs=4
#@ benchmark-beaker=7.66
#@
alamo.program = heat
plot_file = tests/HeatConduction/output
# Simulation length
timestep = 0.0001
stop_time = 0.05
# AMR parameters
amr.plot_int = 10
amr.max_level = 3
amr.n_cell = 8 8 8
amr.blocking_factor = 1
amr.regrid_int = 10
amr.grid_eff = 1.0
# Specify geometry and unrefined mesh
geometry.prob_lo = 0 0 0
geometry.prob_hi = 1 1 1
geometry.is_periodic= 0 0 0
# Criterion for mesh refinement
heat.alpha = 1.0
heat.refinement_threshold = 0.01
# Specify initial conditions
ic.type = sphere
ic.sphere.center = 0.5 0.5 0.5
ic.sphere.radius = 0.25
ic.sphere.inside = 0.0
# Boundary conditions
bc.temp.type.xhi = dirichlet
bc.temp.type.xlo = dirichlet
bc.temp.type.yhi = dirichlet
bc.temp.type.ylo = dirichlet
bc.temp.type.zhi = dirichlet
bc.temp.type.zlo = dirichlet
bc.temp.val.xhi = 0.0
bc.temp.val.xlo = 1.0
bc.temp.val.yhi = 0.0
bc.temp.val.ylo = 1.0
bc.temp.val.zhi = 0.0
bc.temp.val.zlo = 1.0
Inclusion
This demonstrates the evolution of an initially spherical inclusion, with anisotropic boundary energy, and with a volume constraint enforced using a Lagrange multiplier. See Integrator::PhaseFieldMicrostructure for additional information.

[Inclusion] 2d-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
29.49s (beaker) 20.54s (statler) |
play_circle |
./bin/alamo-2d-g++ tests/Inclusion/input
|
#@
#@ [2d-serial]
#@ dim = 2
#@ check = true
#@ benchmark-beaker = 29.49
#@ benchmark-statler = 20.54
#@
alamo.program = microstructure
timestep = 0.01
stop_time = 2.0
plot_file = tests/Inclusion/output
amr.plot_dt = 0.1
amr.max_level = 2
amr.n_cell = 64 64 64
amr.blocking_factor = 8
amr.regrid_int = 10
amr.grid_eff = 1.0
amr.max_grid_size = 8
amr.thermo.plot_dt = 0.1
ic.type=sphere
ic.sphere.center = 4 4 4
ic.sphere.radius = 1
geometry.prob_lo = 0 0 0
geometry.prob_hi = 8 8 8
geometry.is_periodic= 0 0 0
bc.eta.type.xlo = neumann
bc.eta.type.xhi = neumann
bc.eta.type.ylo = neumann
bc.eta.type.yhi = neumann
pf.number_of_grains = 2
pf.M = 1.0
pf.mu = 10.0
pf.gamma = 1.0
pf.l_gb=0.1
pf.sigma0=0.075
anisotropy.on=1
anisotropy.timestep=0.0005
anisotropy.tstart= 1.
anisotropy.gb_type=sin
anisotropy.sin.sigma0=0.075
anisotropy.sin.sigma1=0.07
anisotropy.sin.theta0=45
anisotropy.beta= 0.00001
elastic.on = 0
lagrange.on = 1
lagrange.lambda = 2.0
lagrange.tstart = 1.0
lagrange.vol0 = 4.0
PerturbedInterface
This example simluates the evolution of a perturbed interface with strongly anisotropic grain boundary energy. For background see Ribot et al: https://doi.org/10.1088/1361-651X/ab47a0
This problem tests the following
Example output:

Notice that the sharp corner in the equilibrium shape is the result of strong anisotropy.
[PerturbedInterface] perturbed-interface
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
19.87s (beaker) 12.53s (statler) 18.75s (github) |
play_circle |
./bin/alamo-2d-g++ tests/PerturbedInterface/input
|
#@
#@ [perturbed-interface]
#@ dim = 2
#@ check = true
#@ benchmark-beaker = 19.87
#@ benchmark-statler = 12.53
#@ benchmark-github = 18.75
#@
alamo.program = microstructure
timestep = 0.01
stop_time = 2.0
plot_file = tests/PerturbedInterface/output
amr.plot_dt = 0.1
amr.max_level = 2
amr.n_cell = 64 64 64
amr.blocking_factor = 8
amr.regrid_int = 10
amr.grid_eff = 1.0
amr.max_grid_size = 8
#amr.thermo.plot_dt = 0.1
ic.type=perturbed_interface
ic.wave_numbers=4
ic.wave_amplitudes=0.5
ic.normal = y
ic.mollifier = dirac
geometry.prob_lo = 0 -4 0
geometry.prob_hi = 8 4 8
geometry.is_periodic= 0 0 0
bc.eta.type.xlo = neumann
bc.eta.type.xhi = neumann
bc.eta.type.ylo = dirichlet
bc.eta.type.yhi = dirichlet
bc.eta.val.ylo = 1.0 0.0
bc.eta.val.yhi = 0.0 1.0
pf.number_of_grains = 2
pf.M = 1.0
pf.mu = 10.0
pf.gamma = 1.0
pf.l_gb=0.1
pf.sigma0=0.075
anisotropy.on=1
anisotropy.timestep=0.001
anisotropy.tstart= 1.
anisotropy.gb_type=sin
anisotropy.sin.sigma0=0.075
anisotropy.sin.sigma1=0.07
anisotropy.sin.theta0=45
anisotropy.beta= 0.00001
#anisotropy.damp=1.0
elastic.on = 0
PlateHole
[PlateHole] 2D-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/PlateHole/input
|
[PlateHole] 3D-parallel
3d_rotation |
Three-dimensional |
grid_view |
Parallel (4 procs) |
report_off |
No testing script |
timer |
13.52s (beaker) 11.48s (statler) |
play_circle |
mpiexec -np 4 ./bin/alamo-3d-g++ tests/PlateHole/input
|
[PlateHole] 3D-serial
3d_rotation |
Three-dimensional |
square |
Serial |
report_off |
No testing script |
timer |
42.00s (beaker) |
play_circle |
./bin/alamo-3d-g++ tests/PlateHole/input
|
#@ [2D-serial]
#@ dim = 2
#@ nprocs = 1
#@ check = true
#@
#@ [3D-parallel]
#@ dim = 3
#@ nprocs = 4
#@ check = false
#@ benchmark-beaker = 13.52
#@ benchmark-statler = 11.48
#@
#@ [3D-serial]
#@ dim = 3
#@ nprocs = 1
#@ check = false
#@ benchmark-beaker = 42.00
alamo.program = mechanics
alamo.program.mechanics.model = linear.isotropic
plot_file = tests/PlateHole/output
# this is not a time integration, so do
# exactly one timestep and then quit
timestep = 0.1
stop_time = 0.1
amr.plot_int = 1
amr.blocking_factor = 8
amr.regrid_int = -1
amr.grid_eff = 1.0
amr.node.all = 1
amr.cell.all = 1
# grid
amr.max_level = 5 #8
amr.n_cell = 32 32 32
# geometry
geometry.prob_lo = -16 -16 -16
geometry.prob_hi = 16 16 16
geometry.is_periodic = 0 0 0
# ellipse configuration
psi.ic.type = ellipse
psi.ic.ellipse.a = 1.0 1.0 1.0 # ellipse radius
psi.ic.ellipse.x0 = 0 0 0 # location of ellipse center
psi.ic.ellipse.eps = 0.2
psi.ic.ellipse.invert = 1
# elastic moduli
nmodels = 1
model1.E = 1.0
model1.nu = 0.3
model1.planestress = 1
solver.verbose = 3
solver.nriters = 1
solver.max_iter = 20
solver.bottom_solver = smoother
solver.tol_abs = 1E-16 # This is very important for near-singular problems!!!
print_residual = 1
bc.type = tension_test
bc.tension_test.type = uniaxial_stress
bc.tension_test.disp=0.01
elasticop.small=1E-16
RubberPlateHole
This example demonstrates the Finite Kinematics newton solver in conjunction with the near-singular void field \(\psi\) to simulate a compliant material with a hole in the middle.

It also demonstrates the use of the IC::Expression class with the variable
functionality.
[RubberPlateHole] serial-2d
2d |
Two-dimensional |
square |
Serial |
report_off |
No testing script |
play_circle |
./bin/alamo-2d-g++ tests/RubberPlateHole/input
|
#@
#@ [serial-2d]
#@ dim=2
#@ check=false
#@
alamo.program = mechanics
alamo.program.mechanics.model = elastic.neohookean
plot_file = output
type = static
timestep = 0.1
stop_time = 1.0
amr.plot_int = 1
amr.max_level = 2
amr.n_cell = 16 16 16
amr.blocking_factor = 2
amr.thermo.int = 1
amr.thermo.plot_int = 1
amr.node.all = 1
amr.cell.all = 1
geometry.prob_lo = -1 -1 -1
geometry.prob_hi = 1 1 1
ic.type = ellipse
ic.ellipse.a = 0.25 0.25 0.25
ic.ellipse.x0 = 0.5 0.5 0.5
ic.ellipse.eps = 0.05
nmodels = 1
model1.mu = 30
model1.kappa = 60
psi.ic.type=expression
psi.ic.expression.constant.eps = 0.05
psi.ic.expression.constant.R = 0.25
psi.ic.expression.region0 = "0.5 + 0.5*tanh((x^2 + y^2 - R)/eps)"
solver.verbose = 2
solver.max_iter = 150
solver.nriters = 1000
solver.nrtolerance = 1E-5
ref_threshold = 100
bc.type = tension_test
bc.tension_test.type = uniaxial_stress
bc.tension_test.disp = (0,1:0,0.5)
solver.dump_on_fail = 1
amrex.signal_handling = 0
amrex.throw_exception = 1
RubberWithInclusion
This example demonstrates the Finite Kinematics newton solver for a composite consisting of a compliant rubber-like material and a (near) rigid metal or ceramic-like material. The difference in elastic moduli is 10x. The low faces (xlo, ylo, zlo) are homogeneous dirichlet in the normal direction and naumann in the lateral directions. The three-dimensional test yields the following:

For regression testing purposes, only the two-dimensional case is considered for efficiency. In two dimensions, the distortion of the mesh is more severe, which usually means that additional Newton iterations are required.

[RubberWithInclusion] serial-2d
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
13.8s (beaker) |
play_circle |
./bin/alamo-2d-g++ tests/RubberWithInclusion/input
|
[RubberWithInclusion] parallel-2d
2d |
Two-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
timer |
6.6s (beaker) |
play_circle |
mpiexec -np 4 ./bin/alamo-2d-g++ tests/RubberWithInclusion/input
|
#@
#@ [serial-2d]
#@ dim=2
#@ benchmark-beaker=13.8
#@ check-file=reference/thermo.dat
#@
#@ [parallel-2d]
#@ dim=2
#@ nprocs=4
#@ benchmark-beaker=6.6
#@ check-file=reference/thermo.dat
#@
alamo.program = mechanics
alamo.program.mechanics.model = elastic.neohookean
plot_file = tests/RubberWithInclusion/output
type = static
timestep = 0.1
stop_time = 1.0
amr.plot_int = 1
amr.max_level = 2
amr.n_cell = 16 16 16
amr.blocking_factor = 2
amr.thermo.int = 1
amr.thermo.plot_int = 1
geometry.prob_lo = 0 0 0
geometry.prob_hi = 1 1 1
ic.type = ellipse
ic.ellipse.a = 0.25 0.25 0.25
ic.ellipse.x0 = 0.5 0.5 0.5
ic.ellipse.eps = 0.05
nmodels = 2
model1.mu = 30
model1.kappa = 60
model2.mu = 3.0
model2.kappa = 6.0
solver.verbose = 3
solver.max_iter = 150
solver.nriters = 1000
solver.nrtolerance = 1E-5
ref_threshold = 100
bc.type = tension_test
bc.tension_test.type = uniaxial_stress
bc.tension_test.disp = (0,1:0,0.5)
solver.dump_on_fail = 1
amrex.signal_handling = 0
amrex.throw_exception = 1
SCPSandwich
[SCPSandwich] serial
2d |
Two-dimensional |
square |
Serial |
report_off |
No testing script |
play_circle |
./bin/alamo-2d-g++ tests/SCPSandwich/input stop_time="0.01"
|
[SCPSandwich] parallel
2d |
Two-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
play_circle |
mpiexec -np 4 ./bin/alamo-2d-g++ tests/SCPSandwich/input
|
#@
#@ [serial]
#@ dim = 2
#@ check = false
#@ args = stop_time=0.01
#@
#@ [parallel]
#@ dim = 2
#@ nprocs = 4
#@ check = true
#@
alamo.program = flame
# AMR parameters
plot_file = tests/SCPSandwich/output
amr.plot_dt = 0.01
amr.max_level = 7
amr.n_cell = 16 2 2
amr.blocking_factor = 2
amr.regrid_int = 100
amr.base_regrid_int = 20
amr.grid_eff = 0.7
# Geometry
geometry.prob_lo = 0.0 -0.25 -0.1 # [mm]
geometry.prob_hi = 4.0 0.25 0.1 # [mm]
geometry.is_periodic = 0 1 1
# Timestep and duration
timestep = 0.00005 # [s]
stop_time = 0.2 # [s]
# Phase field params
pf.eps = 0.0005 # [mm]
pf.lambda = 0.001
pf.kappa = 1.0
pf.gamma = 0.02726
pf.w1 = 1.0
pf.w12 = 2.0
pf.w0 = 0.0
# AP / HTPB regression rate params
pf.r_ap = 1.222 # [ mm / s ]
pf.n_ap = 1.042 # [ 1 ]
pf.r_htpb = 0.1 # [ mm / s]
pf.r_comb = 10.0 # [ mm / s]
pf.n_htpb = 0.0 # [ 1 ]
pf.n_comb = 0.0 # [ 1 ]
# Pressure used in regression rate calc
pf.P = 0.2
# Phase field IC
eta.ic.type = constant
eta.ic.constant.value = 1
# Species field params
phi.ic.type = laminate
phi.ic.laminate.number_of_inclusions = 1
phi.ic.laminate.center = 0.0 0.0 0.0
phi.ic.laminate.thickness = 0.1
phi.ic.laminate.orientation = 0 1
phi.ic.laminate.eps = 0.015
phi.ic.laminate.singlefab = 1
phi.ic.laminate.invert = 1
# Boundary conditions on eta
pf.eta.bc.type.xlo = dirichlet
pf.eta.bc.type.xhi = dirichlet
pf.eta.bc.type.ylo = neumann
pf.eta.bc.type.yhi = neumann
pf.eta.bc.val.xlo = 0.0
pf.eta.bc.val.xhi = 1.0
pf.eta.bc.val.ylo = 0.0
pf.eta.bc.val.yhi = 0.0
Scratch
This input file simulates the effect of a moving point load applied over the surface of the domain. The J2 plastic material accumulates residual stress left by the application of the point load. This test exercises the following capabilities:

To generate the movie here, run in 3D. A 3D test is not included in the regression test suite due to the extensive time required.
[Scratch] 2d-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
16.9s (beaker) |
play_circle |
./bin/alamo-2d-g++ tests/Scratch/input
|
[Scratch] 2d-parallel
2d |
Two-dimensional |
grid_view |
Parallel (2 procs) |
verified |
Testing script present |
timer |
12.49s (beaker) |
play_circle |
mpiexec -np 2 ./bin/alamo-2d-g++ tests/Scratch/input
|
#@
#@ [2d-serial]
#@ dim=2
#@ benchmark-beaker=16.9
#@
#@ [2d-parallel]
#@ dim=2
#@ nprocs=2
#@ benchmark-beaker=12.49
#@
alamo.program = mechanics
alamo.program.mechanics.model = affine.j2
plot_file = tests/Scratch/output
timestep = 0.05
stop_time = 6.0
# amr parameters
amr.plot_int = 10
amr.max_level = 3
amr.n_cell = 16 16 16
amr.blocking_factor = 4
amr.regrid_int = 1
amr.grid_eff = 1.0
amr.node.any = 0
amr.cell.all = 1
# geometry
geometry.prob_lo = -8 -8 -8
geometry.prob_hi = 8 8 8
geometry.is_periodic = 0 0 0
# elastic moduli
nmodels = 1
model1.E = 210
model1.nu = 0.3
model1.sigma0=0.2
# solver parameters
solver.verbose = 3
solver.nriters = 1
solver.max_iter = 40
# Elastic refinement criterion
ref_threshold = 0.0005
# Expression-based boundary condition
bc.type = expression
bc.expression.type.yhi = trac trac trac
bc.expression.val.yhi = "0.0" "-exp(-((x-t)*(x-t)+z*z)/0.4)" "0.0"
Solid
[Solid] linear-isotropic
3d_rotation |
Three-dimensional |
square |
Serial |
report_off |
No testing script |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input
|
[Solid] linear-cubic
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input alamo.program.mechanics.model="linear.cubic" model1.C11="168.3" model1.C12="1.221" model1.C44="0.757" ignore="model1.E model1.nu"
|
[Solid] affine-cubic
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input alamo.program.mechanics.model="affine.cubic" model1.C11="168.3" model1.C12="1.221" model1.C44="0.757" model1.F0="0.001 0 0 0 0.001 0 0 0 0.001" ignore="model1.E model1.nu"
|
[Solid] affine-hexagonal
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input alamo.program.mechanics.model="affine.hexagonal" model1.C11="0.597" model1.C12="0.262" model1.C13="0.217" model1.C33="0.617" model1.C44="0.164" model1.F0="0.001 0 0 0 0.001 0 0 0 0.001" ignore="model1.E model1.nu"
|
[Solid] j2
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
10.42s (beaker) 7.02s (statler) 11.09s (github) |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input timestep="0.001" alamo.program.mechanics.model="affine.j2" model1.E="210" model1.nu="0.3" model1.sigma0="0.2" bc.tension_test.disp="(0,0.25,0.75,1.0:0,0.002,-0.002,0)"
|
[Solid] affine-isotropic
3d_rotation |
Three-dimensional |
square |
Serial |
report_off |
No testing script |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input alamo.program.mechanics.model="affine.isotropic" model1.F0="0.001 0 0 0 0.001 0 0 0 0.001" model1.E="210" model1.nu="0.3"
|
[Solid] neo-hookean
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
10.73s (beaker) 8.17s (statler) 11.35s (github) |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input timestep="0.01" alamo.program.mechanics.model="elastic.neohookean" model1.mu="3.0" model1.kappa="6.5" bc.tension_test.disp="(0,1:0,1)" solver.nriters="10" ignore="model1.E model1.nu"
|
[Solid] neo-hookean-2d
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/Solid/input timestep="0.01" alamo.program.mechanics.model="elastic.neohookean" model1.mu="3.0" model1.kappa="6.5" bc.tension_test.disp="(0,1:0,1)" solver.nriters="10" ignore="model1.E model1.nu"
|
[Solid] pseudolinear-cubic
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-3d-g++ tests/Solid/input alamo.program.mechanics.model="elastic.pseudolinearcubic" model1.C11="168.3" model1.C12="1.221" model1.C44="0.757" ignore="model1.E model1.nu"
|
#@
#@ [linear-isotropic]
#@ dim = 3
#@ check = false
#@
#@ [linear-cubic]
#@ dim = 3
#@ check-file = reference/linear-cubic.dat
#@ args = alamo.program.mechanics.model=linear.cubic
#@ args = model1.C11 = 168.3
#@ args = model1.C12 = 1.221
#@ args = model1.C44 = 0.757
#@ ignore = model1.E model1.nu
#@
#@ [affine-cubic]
#@ dim = 3
#@ check-file = reference/affine-cubic.dat
#@ args = alamo.program.mechanics.model=affine.cubic
#@ args = model1.C11 = 168.3
#@ args = model1.C12 = 1.221
#@ args = model1.C44 = 0.757
#@ args = model1.F0=0.001 0 0 0 0.001 0 0 0 0.001
#@ ignore = model1.E model1.nu
#@
#@
#@ [affine-hexagonal]
#@ dim = 3
#@ check-file = reference/affine-hexagonal.dat
#@ args = alamo.program.mechanics.model=affine.hexagonal
#@ args = model1.C11 = 0.597
#@ args = model1.C12 = 0.262
#@ args = model1.C13 = 0.217
#@ args = model1.C33 = 0.617
#@ args = model1.C44 = 0.164
#@ args = model1.F0=0.001 0 0 0 0.001 0 0 0 0.001
#@ ignore = model1.E model1.nu
#@
#@ [j2]
#@ dim = 3
#@ check-file = reference/j2.dat
#@ args = timestep = 0.001
#@ args = alamo.program.mechanics.model=affine.j2
#@ args = model1.E=210
#@ args = model1.nu=0.3
#@ args = model1.sigma0=0.2
#@ args = bc.tension_test.disp = (0,0.25,0.75,1.0:0,0.002,-0.002,0)
#@ benchmark-beaker = 10.42
#@ benchmark-statler = 7.02
#@ benchmark-github = 11.09
#@
#@ [affine-isotropic]
#@ dim = 3
#@ check = false
#@ args = alamo.program.mechanics.model=affine.isotropic
#@ args = model1.F0=0.001 0 0 0 0.001 0 0 0 0.001
#@ args = model1.E=210
#@ args = model1.nu=0.3
#@
#@ [neo-hookean]
#@ dim=3
#@ check-file = reference/neo-hookean.dat
#@ args = timestep=0.01
#@ args = alamo.program.mechanics.model=elastic.neohookean
#@ args = model1.mu=3.0
#@ args = model1.kappa=6.5
#@ args = bc.tension_test.disp=(0,1:0,1)
#@ args = solver.nriters=10
#@ ignore = model1.E model1.nu
#@ benchmark-beaker = 10.73
#@ benchmark-statler = 8.17
#@ benchmark-github = 11.35
#@
#@ [neo-hookean-2d]
#@ dim=2
#@ check-file = reference/neo-hookean-2d.dat
#@ args = timestep=0.01
#@ args = alamo.program.mechanics.model=elastic.neohookean
#@ args = model1.mu=3.0
#@ args = model1.kappa=6.5
#@ args = bc.tension_test.disp=(0,1:0,1)
#@ args = solver.nriters=10
#@ ignore = model1.E model1.nu
#@
#@ [pseudolinear-cubic]
#@ dim = 3
#@ check-file = reference/pseudolinear-cubic.dat
#@ args = alamo.program.mechanics.model=elastic.pseudolinearcubic
#@ args = model1.C11=168.3
#@ args = model1.C12=1.221
#@ args = model1.C44=0.757
#@ ignore = model1.E model1.nu
#@
alamo.program = mechanics
plot_file = tests/Solid/output
type=static
timestep = 0.01
stop_time = 1.0
# amr parameters
amr.plot_dt = 0.1
amr.max_level = 0
amr.n_cell = 4 4 4
amr.blocking_factor = 2
amr.thermo.int = 1
amr.thermo.plot_int = 1
# geometry
geometry.prob_lo = 0 0 0
geometry.prob_hi = 1 1 1
nmodels = 1
model1.E=210
model1.nu=0.3
solver.verbose = 3
solver.nriters = 1
solver.max_iter = 30 #30
bc.type = tension_test
bc.tension_test.type = uniaxial_stress
bc.tension_test.disp=(0,1:0,0.01)
Suture
[Suture] 2D-serial-4levels
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/Suture/input
|
#@ [2D-serial-4levels]
#@ dim = 2
#@ nprocs = 1
alamo.program = mechanics
alamo.program.mechanics.model = affine.isotropic
plot_file = tests/Suture/output
# this is not a time integration, so do
# exactly one timestep and then quit
timestep = 0.1
stop_time = 0.1
# amr parameters
amr.plot_int = 1
amr.max_level = 4
amr.n_cell = 32 32 32
amr.blocking_factor = 4
amr.regrid_int = 1
amr.grid_eff = 1.0
amr.cell.all = 1
# geometry
geometry.prob_lo = -8 -8 -8
geometry.prob_hi = 8 8 8
geometry.is_periodic = 0 0 0
ic.type = bmp
ic.bmp.filename = tests/Suture/interface-blur.bmp
ic.bmp.fit = fitwidth
ic.bmp.channel = g
#Aluminum Oxide
nmodels = 2
model1.E = 370 #GPa
model1.nu = 0.22
model1.F0 = -0.001 0 0 0 -0.001 0 0 0 -0.001
#Nickel
model2.E = 207 #GPa
model2.nu = 0.31
model2.F0 = 0.001 0 0 0 0.001 0 0 0 0.001
solver.verbose = 3
solver.nriters = 1
solver.fixed_iter=2000
## Sliders on all walls
bc.type = constant
bc.constant.type.ylo = trac disp
bc.constant.type.xloylo = disp disp
bc.constant.type.xhiylo = disp disp
bc.constant.type.xlo = disp trac
bc.constant.type.xhi = disp trac
bc.constant.type.xloyhi = disp disp
bc.constant.type.xhiyhi = disp disp
bc.constant.type.yhi = trac disp
TopOp
[TopOp] serial
2d |
Two-dimensional |
square |
Serial |
report_off |
No testing script |
play_circle |
./bin/alamo-2d-g++ tests/TopOp/input stop_time="1.0"
|
#@
#@ [serial]
#@ dim = 2
#@ args=stop_time=1.0
#@ check=false
#@
alamo.program = topop
plot_file = tests/TopOp/output
timestep = 0.1
stop_time = 20.0
# amr parameters
amr.plot_int = 1 #10000
amr.max_level = 2
amr.n_cell = 64 32 32
amr.blocking_factor = 4
amr.regrid_int = 1
amr.grid_eff = 1.0
amr.node.all = 1
amr.thermo.plot_dt = 0.1
# geometry
geometry.prob_lo = 0 0 0
geometry.prob_hi = 1.8 1 1
geometry.is_periodic = 0 0 0
#
# Isotropic elastic model
#
model.E = 3.70
model.nu = 0.22
#
# Topology optimization parameters
#
alpha = 200.
beta = 0.05
gamma = 50000.0
L.str = 0.005
volume0 = 0.5
lambda.str = 400.0
#
# BCs for psi variable
#
psi.ic.type = constant
psi.ic.constant.value = 1.0
psi.bc.type.xhi = NEUMANN
psi.bc.type.xlo = NEUMANN
psi.bc.type.yhi = NEUMANN
psi.bc.type.ylo = NEUMANN
#### Canonical test case: cantilever with load at tip
#bc.type = expression
#bc.expression.type.xloylo = disp disp
#bc.expression.type.xlo = disp disp
#bc.expression.type.xloyhi = disp disp
#bc.expression.type.ylo = trac trac
#bc.expression.type.yhi = trac trac
#bc.expression.type.xhi = trac trac
#bc.expression.type.xhiylo = trac trac
#bc.expression.type.xhiyhi = trac trac
#bc.expression.val.yhi = "0.0" "0.0"
#bc.expression.val.xhiylo = "0.0" "0.0"
#bc.expression.val.xhiyhi = "0.0" "0.0"
#bc.expression.val.ylo = "0.0" "0"
#bc.expression.val.xhi = "0.0" "-0.1 * (y > 0.45) * (y < 0.55)"
#L.str = 0.01
### Canonical test case: cantilever with full load at tip
bc.type = constant
bc.constant.type.xloylo = disp disp
bc.constant.type.xlo = disp disp
bc.constant.type.xloyhi = disp disp
bc.constant.type.ylo = trac trac
bc.constant.type.yhi = trac trac
bc.constant.type.xhi = trac trac
bc.constant.type.xhiylo = trac trac
bc.constant.type.xhiyhi = trac trac
bc.constant.val.xhi = 0.0 -0.1
#
# Solver inputs
#
elasticop.small=0.01
solver.bottom_solver = smoother
solver.tol_abs = 1E-16 # This is very important for near-singular problems!!!
solver.verbose = 3
solver.nriters = 1
solver.fixed_iter=2000
#
# Mechanics inputs
#
interval = 1
print_residual=1
eta_ref_threshold = 0.05
elastic_ref_threshold = 100000
zero_out_displacement = 1
TrigTest
[TrigTest] 2D-1AMR-Levels-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/TrigTest/input amr.max_level="0"
|
[TrigTest] 2D-2AMRLevels-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/TrigTest/input amr.max_level="1"
|
[TrigTest] 2D-3AMRLevels-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/TrigTest/input
|
[TrigTest] 2D-3AMRLevels-parallel
2d |
Two-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
play_circle |
mpiexec -np 4 ./bin/alamo-2d-g++ tests/TrigTest/input
|
[TrigTest] 3D-1AMRLevels-serial
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-3d-g++ tests/TrigTest/input
|
[TrigTest] 3D-3AMRLevels-parallel
3d_rotation |
Three-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
play_circle |
mpiexec -np 4 ./bin/alamo-3d-g++ tests/TrigTest/input
|
#@ [2D-1AMR-Levels-serial]
#@ dim = 2
#@ nprocs = 1
#@ args = amr.max_level=0
#@
#@ [2D-2AMRLevels-serial]
#@ dim = 2
#@ nprocs = 1
#@ args = amr.max_level=1
#@
#@ [2D-3AMRLevels-serial]
#@ dim = 2
#@ nprocs = 1
#@
#@ [2D-3AMRLevels-parallel]
#@ dim = 2
#@ nprocs = 4
#@
#@ [3D-1AMRLevels-serial]
#@ dim = 3
#@ nprocs = 1
#@
#@ [3D-3AMRLevels-parallel]
#@ dim = 3
#@ nprocs = 4
alamo.program = mechanics
alamo.program.mechanics.model = linear.laplacian
plot_file = tests/TrigTest/output
# this is not a time integration, so do
# exactly one timestep and then quit
timestep = 0.1
stop_time = 0.1
# amr parameters
amr.plot_int = 1
amr.max_level = 2
amr.n_cell = 32 32 32
amr.blocking_factor = 4
amr.regrid_int = 1
amr.grid_eff = 1.0
amr.cell.all = 1
# use an explicit mesh (i.e. no adaptive meshing)
explicitmesh.on = 1
explicitmesh.lo1 = 16 16 16
explicitmesh.hi1 = 47 47 47
explicitmesh.lo2 = 48 48 48
explicitmesh.hi2 = 79 79 79
# geometry
geometry.prob_lo = 0 0 0
geometry.prob_hi = 1 1 1
geometry.is_periodic = 0 0 0
rhs.type = trig
rhs.trig.nr = 0 0 0
rhs.trig.ni = 1 1 1
rhs.dim = 1
rhs.alpha = 1
solver.verbose = 3
solver.nriters = 1
solver.max_iter = 20
### UNIAXIAL TENSION ###
elastic.bc.type = constant
UniaxialTension
[UniaxialTension] 2D-serial-1level
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/UniaxialTension/input amr.max_level="0"
|
[UniaxialTension] 2D-serial-2levels
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/UniaxialTension/input amr.max_level="1"
|
[UniaxialTension] 2D-serial-3levels
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
play_circle |
./bin/alamo-2d-g++ tests/UniaxialTension/input
|
[UniaxialTension] 2D-parallel-3levels
2d |
Two-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
play_circle |
mpiexec -np 4 ./bin/alamo-2d-g++ tests/UniaxialTension/input
|
[UniaxialTension] 3D-serial-3levels
3d_rotation |
Three-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
8.29s (github) |
play_circle |
./bin/alamo-3d-g++ tests/UniaxialTension/input
|
[UniaxialTension] 3D-parallel-3levels
3d_rotation |
Three-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
play_circle |
mpiexec -np 4 ./bin/alamo-3d-g++ tests/UniaxialTension/input
|
#@ [2D-serial-1level]
#@ dim=2
#@ nprocs=1
#@ args=amr.max_level=0
#@
#@ [2D-serial-2levels]
#@ dim=2
#@ nprocs=1
#@ args=amr.max_level=1
#@
#@ [2D-serial-3levels]
#@ dim=2
#@ nprocs=1
#@
#@ [2D-parallel-3levels]
#@ dim=2
#@ nprocs=4
#@
#@ [3D-serial-3levels]
#@ dim=3
#@ nprocs=1
#@ benchmark-github = 8.29
#@
#@ [3D-parallel-3levels]
#@ dim=3
#@ nprocs=4
#@
alamo.program = mechanics
alamo.program.mechanics.model = linear.isotropic
plot_file = tests/UniaxialTension/output
# this is not a time integration, so do
# exactly one timestep and then quit
timestep = 0.1
stop_time = 0.1
# amr parameters
amr.plot_int = 1
amr.max_level = 2
amr.n_cell = 32 32 32
amr.blocking_factor = 4
amr.regrid_int = 1
amr.grid_eff = 1.0
amr.cell.all = 1
# use an explicit mesh (i.e. no adaptive meshing)
explicitmesh.on = 1
explicitmesh.lo1 = 16 16 16
explicitmesh.hi1 = 47 47 47
explicitmesh.lo2 = 48 48 48
explicitmesh.hi2 = 79 79 79
# geometry
geometry.prob_lo = -8 -8 -8
geometry.prob_hi = 8 8 8
geometry.is_periodic = 0 0 0
# elastic moduli
model1.planestress = true
model1.E = 210
model1.nu = 0.3
solver.verbose = 3
solver.nriters = 1
solver.max_iter = 50
### UNIAXIAL TENSION ###
bc.type = constant
### --- Faces
bc.constant.type.xlo = disp trac trac
bc.constant.type.xhi = disp trac trac
bc.constant.val.xhi = 0.1 0.0 0.0
bc.constant.type.ylo = trac disp trac
bc.constant.type.yhi = trac trac trac
bc.constant.type.zlo = trac trac disp
bc.constant.type.zhi = trac trac trac
### --- Edges
### XY edges
bc.constant.type.xloylo = disp trac trac
bc.constant.type.xloyhi = disp trac trac
bc.constant.type.xhiylo = disp trac trac
bc.constant.type.xhiyhi = disp trac trac
bc.constant.val.xhiylo = 0.1 0.0 0.0
bc.constant.val.xhiyhi = 0.1 0.0 0.0
### ZX edges
bc.constant.type.zloxlo = disp trac trac
bc.constant.type.zhixlo = disp trac trac
bc.constant.type.zloxhi = disp trac trac
bc.constant.type.zhixhi = disp trac trac
bc.constant.val.zloxhi = 0.1 0.0 0.0
bc.constant.val.zhixhi = 0.1 0.0 0.0
### YZ edges
bc.constant.type.ylozlo = trac disp disp
bc.constant.type.ylozhi = trac disp trac
bc.constant.type.yhizlo = trac trac disp
bc.constant.type.yhizhi = trac trac trac
### --- Corners
### on xmin face
bc.constant.type.xloylozlo = disp disp disp
bc.constant.type.xloylozhi = disp disp trac
bc.constant.type.xloyhizlo = disp trac disp
bc.constant.type.xloyhizhi = disp trac trac
### on xmax face
bc.constant.type.xhiylozlo = disp disp disp
bc.constant.val.xhiylozlo = 0.1 0.0 0.0
bc.constant.type.xhiylozhi = disp disp trac
bc.constant.val.xhiylozhi = 0.1 0.0 0.0
bc.constant.type.xhiyhizlo = disp trac disp
bc.constant.val.xhiyhizlo = 0.1 0.0 0.0
bc.constant.type.xhiyhizhi = disp trac trac
bc.constant.val.xhiyhizhi = 0.1 0.0 0.0
Voronoi
This test problem illustrates the use of the phase field method when initialized with a Voronoi tesselation. This example tests the following capabilities
The following is the result in 2D; the problem can be run in 3D as well.

Notice that there are 100 initial grains in the tesselation, but only 10 actual grains in the simulation. Therefore, some grains will eventually merge together when the boundary between them disappears.
[Voronoi] 2D-100grain-parallel
2d |
Two-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
timer |
16.04s (beaker) 11.58s (statler) |
play_circle |
mpiexec -np 4 ./bin/alamo-2d-g++ tests/Voronoi/input
|
[Voronoi] 2D-100grain-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
50.84s (beaker) 37.94s (statler) 60.03s (github) |
play_circle |
./bin/alamo-2d-g++ tests/Voronoi/input
|
#@
#@ [2D-100grain-parallel]
#@ nprocs = 4
#@ dim = 2
#@ benchmark-beaker = 16.04
#@ benchmark-statler = 11.58
#@
#@ [2D-100grain-serial]
#@ nprocs = 1
#@ dim = 2
#@ benchmark-beaker = 50.84
#@ benchmark-statler = 37.94
#@ benchmark-github = 60.03
#@
alamo.program = microstructure
plot_file = tests/Voronoi/output
timestep = 0.005
stop_time = 1
amr.plot_dt = 0.1
amr.max_level = 3
amr.n_cell = 32 32 32
amr.blocking_factor = 4
amr.regrid_int = 10
amr.grid_eff = 1.0
ic.type = voronoi
ic.voronoi.number_of_grains = 100
#ic.voronoi.number_of_grains = 100
#ic.type = constant
#ic.value = 1 0 0 0 0 0 0 0 0 0
geometry.prob_lo = 0 0 0
geometry.prob_hi = 5 5 5
geometry.is_periodic = 1 1 1
bc.eta.type.xhi = periodic
bc.eta.type.xlo = periodic
bc.eta.type.yhi = periodic
bc.eta.type.ylo = periodic
bc.eta.type.zhi = periodic
bc.eta.type.zlo = periodic
pf.number_of_grains = 10
pf.M = 1.0
pf.mu = 10.0
pf.gamma = 1.0
pf.l_gb = 0.05
pf.sigma0 = 0.075
VoronoiElastic
This problem is identical to Voronoi, but solves mechanical equilibrium in the microstructure with grain-dependent moduli. This problem tests the following capabilities
The following is the result in 2D:

[VoronoiElastic] 2d-serial
2d |
Two-dimensional |
square |
Serial |
verified |
Testing script present |
timer |
65.12s (beaker) 45.09s (statler) 70.39s (github) |
play_circle |
./bin/alamo-2d-g++ tests/VoronoiElastic/input
|
[VoronoiElastic] 2d-parallel
2d |
Two-dimensional |
grid_view |
Parallel (4 procs) |
verified |
Testing script present |
timer |
19.99s (beaker) 16.68s (statler) |
play_circle |
mpiexec -np 4 ./bin/alamo-2d-g++ tests/VoronoiElastic/input
|
#@
#@ [2d-serial]
#@ dim=2
#@ benchmark-beaker = 65.12
#@ benchmark-statler = 45.09
#@ benchmark-github = 70.39
#@
#@ [2d-parallel]
#@ dim=2
#@ nprocs=4
#@ benchmark-beaker=19.99
#@ benchmark-statler=16.68
#@
alamo.program = microstructure
plot_file = tests/VoronoiElastic/output
timestep = 0.0005
stop_time = 0.1
amr.plot_dt = 0.01
amr.max_level = 2
amr.n_cell = 64 64 64
amr.max_grid_size = 8
amr.blocking_factor = 8
amr.base_regrid_int = 100
amr.grid_eff = 1.0
amr.ref_threshold = 0.1
amr.cell.all = 1
amr.max_grid_size = 8
ic.type = voronoi
ic.voronoi.number_of_grains = 40
geometry.prob_lo = 0 0 0
geometry.prob_hi = 5 5 5
geometry.is_periodic = 0 0 0
bc.eta.type.xhi = neumann
bc.eta.type.xlo = neumann
bc.eta.type.yhi = neumann
bc.eta.type.ylo = neumann
bc.eta.type.zhi = neumann
bc.eta.type.zlo = neumann
pf.number_of_grains = 10
pf.M = 1.0
pf.mu = 10.0
pf.gamma = 1.0
pf.l_gb = 0.05
pf.sigma0 = 0.075
mechanics.interval = 10
mechanics.type = static
mechanics.bc.type = constant
mechanics.bc.constant.type.xlo = disp disp disp
mechanics.bc.constant.type.xhi = disp disp disp
mechanics.bc.constant.type.xloyhi = disp disp disp
mechanics.bc.constant.type.xhiyhi = disp disp disp
mechanics.bc.constant.type.ylo = neumann neumann neumann
mechanics.bc.constant.type.yhi = neumann neumann neumann
mechanics.bc.constant.val.xhi = 0.0 0.01 0.0
mechanics.bc.constant.val.xlo = 0.0 0.0 0.0
mechanics.bc.constant.val.xhiyhi = 0.0 0.01 0.0
mechanics.bc.constant.val.xloyhi = 0.0 0.0 0.0
mechanics.bc.constant.val.xhiylo = 0.0 0.01 0.0
mechanics.bc.constant.val.xloylo = 0.0 0.0 0.0
mechanics.bc.constant.val.yhi = 0.0 0.0 0.0
mechanics.bc.constant.val.ylo = 0.0 0.0 0.0
mechanics.model.C11 = 1.68
mechanics.model.C12 = 1.21
mechanics.model.C44 = 0.75
mechanics.model.random = 1
#mechanics.solver.fixed_iter = 100
mechanics.solver.verbose = 3
mechanics.print_model = 1
mechanics.print_residual = 1
mechanics.solver.tol_rel = 1E-8
mechanics.solver.tol_abs = 1E-8
mechanics.solver.average_down_coeffs = 0
mechanics.time_evolving = 0
Inputs
BC
This is the mechanism for impositing boundary conditions on Set::Field
objects of
scalar type.
Typical convention is for [prefix]
to be given by the field name. For instance,
bc.temp.type.xhi = dirichlet dirichlet dirichlet
bc.temp.val.xhi = 0.0 1.0 0.0
corresponds to the boundary condition for temperature. See the specific integrator for details.
BC::Constant
This is the most commonly used standard boundary condition implementation. The name “Constant” refers to the invariance of the BC value or character along each face of the simulation domain; however, you may cause a change in the value with time by using a Numeric::Interpolator::Linear string.
The BC on each face is specified with a type
string that specifies the nature of
the BC, and a val
that specifies the value.
By default, all types are Dirichlet and all values are 0.0.
The complete list of BC types are below:
BC Type |
Description |
---|---|
|
Standard Dirichlet boundary condition (https://en.wikipedia.org/wiki/Dirichlet_boundary_condition). Fixes the value of the function at the boundary. |
|
|
|
|
|
Standard Neumann boundary condition (https://en.wikipedia.org/wiki/Neumann_boundary_condition) |
|
|
|
Standard periodic boundary condition.
(https://en.wikipedia.org/wiki/Periodic_boundary_conditions).
Important: Ensure that your geometry is specified to be
periodic using |
|
|
|
|
|
Effectively the same as dirichlet but with value fixed to 0 |
|
|
|
Effectively the same as neumann but with value fixed to 0 |
|
Used for internal operations - not for general use |
|
These are BC types inherited from AMReX and not yet implemented in Alamo. If you need BCs of this type, you will need to implement them yourself. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The BC values can be specified either as a number (e.g. 1.0
) or using a linear interpolator
string (e.g. (0,1:2.3,-0.1)
).
The number of values and types must be either 0 (for defaults), 1 (to set the same for all field components) or N (where N=number of field components).
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
BC type on the lower x edge (2d) face (3d) |
|
queryarr |
BC type on the upper x edge (2d) face (3d) |
|
queryarr |
BC type on the lower y edge (2d) face (3d) |
|
queryarr |
BC type on the upper y edge (2d) face (3d) |
|
queryarr |
BC type on the lower z face (processed but ignored in 2d to prevent unused input errors) |
|
queryarr |
BC type on the upper z face (processed but ignored in 2d to prevent unused input errors) |
|
queryarr |
BC value on the lower x edge (2d) face (3d) |
|
queryarr |
BC value on the upper x edge (2d) face (3d) |
|
queryarr |
BC value on the lower y edge (2d) face (3d) |
|
queryarr |
BC value on the upper y edge (2d) face (3d) |
|
queryarr |
BC value on the lower z face (processed but ignored in 2d to prevent unused input errors) |
|
queryarr |
BC value on the upper z face (processed but ignored in 2d to prevent unused input errors) |
BC::Step
Warning
This will be replaced by the more general BC::Expression
Parameter |
Type |
Description |
---|---|---|
|
query |
Location of the step on the xlo edge/face |
|
query |
Location of the step on the xhi edge/face |
BC::Operator
The BC::Operator
family of BC classes are designed to work with implicit
operators.
They are not the same thing as other BC types and cannot be used in that same
way.
(This is not an ideal taxonomy for BC structures - we may transition other BC types
to be subspaces of BC::Integrator.)
BC::Operator::Elastic
Class of BC operators that work with Operator::Elastic.
BC::Operator::Elastic::Constant
This BC defines boundary conditions that are constant with respect to space. However they may change in time using the Numeric::Interpolator::Linear method.
In 2D, BCs are prescribed for each edge (4) and corner (4) on the boundary, for a total of 8 possible regions. In 3D, BCs are prescribed for each face (6), each edge (12), and each corner (8), for a total of 26 possible regions. Care must be taken to define BCs for edges/corners consistently with the faces/edges, or you will get poor convergence and inaccurate behavior. (See BC::Operator::Elastic::TensionTest for a reduced BC with streamlined load options.)
To define a boundary condition, you must define both a “type” and a “value” in each direction. The type can be “displacement”, “disp”, “neumann”, “traction”, “trac”. The value is the corresponding value. All BCs are, by default, dirichlet (displacement) with a value of zero.
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face |
|
queryarr |
3D Face |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Face / 2D Edge |
|
queryarr |
3D Face / 2D Edge |
|
queryarr |
3D Face / 2D Edge |
|
queryarr |
3D Face / 2D Edge |
|
queryarr |
3D Face |
|
queryarr |
3D Face |
BC::Operator::Elastic::Expression
Parameter |
Type |
Description |
---|---|---|
This is basically the same as BC::Operator::Elastic::Constant except that you can use dynamically compiled expressions in space and time to define values. Usage is exactly the same except that the “val” inputs can depend on x, y, z, and t. |
||
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Corner |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Edge / 2D Corner |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face 2D Edge |
|
queryarr |
3D Face |
|
queryarr |
3D Face |
BC::Operator::Elastic::TensionTest
Parameter |
Type |
Description |
---|---|---|
|
query |
Tension test type. (Only option right now is |
|
query |
Applied displacement (can be interpolator) |
|
query |
Applied traction (can be interpolator) |
IC
IC::Affine
Initialize a field to a value (alpha) on the positive side of a hyperplane
Warning
This is an old-fasioned IC that will soon be deleted.
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Normal vector for hyperplane |
|
query |
Value of the field on the positive side of the hyperplane |
IC::BMP
Initialize a field using a bitmap image. (2D only)
Note that in GIMP, you must select “do not write color space information” and “24 bit R8 G8 B8” when exporting the BMP file.
Parameter |
Type |
Description |
---|---|---|
|
query |
BMP filename. |
|
query |
How to fit. (options: stretch, fitheight, fitwidth) |
|
query |
Color channel to use (options: r, R, g, G, b, B) |
|
query |
Scaling value - minimum (default: 0.0) |
|
query |
Scaling value - maximum (default: 255.0) |
IC::Cuboid
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Coordinates (X Y Z) of the center of the square/cube. |
|
queryarr |
Lenth of the square/cube edges |
IC::Constant
Basic IC that just sets the entire field to a constant value. Works with a single or multiple-component field.
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Array of constant values. The number of values should equal either 1 or N where N is the number of fab components |
IC::DoubleNotch
Implement a double-notch. Primarily used in fracture.
Warning
This function is depricated. Use IC::Expression instead.
Parameter |
Type |
Description |
---|---|---|
|
query |
Thickness of the notches |
|
query |
Width of the notches |
|
queryarr |
Center of the notches |
|
query |
Length of the notches |
IC::Ellipse
If number_of_inclusions
is specified, then multiple ellipses are specified.
In this case, each parameter must have number_of_inclusion*M values, where M is the
number of values specified for the single ellipse case.
Warning
This class is redundant with IC::Ellipsoid and IC::Expression and will probably be consolidated.
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Coorinates of ellipse center |
|
query |
Diffuse boundary thickness |
|
queryarr |
DxD square matrix defining an ellipse. |
|
queryarr |
If |
|
query |
Number of ellipses |
|
queryarr |
center of the ellipse |
|
queryarr |
either a vector containing ellipse radii, or a matrix defining the ellipse |
|
queryarr |
Same |
|
queryarr |
Array of radii [depricated] |
|
queryarr |
Regularization for smooth boundary |
|
query |
Flip the inside and the outside |
IC::Expression
Initialize a field using a mathematical expression. Expressions are imported as strings and are compiled real-time using the AMReX Parser.
Works for single or multiple-component fields.
Use the regionN
(N=0,1,2, etc. up to number of components) to pass expression.
For example:
ic.region0 = "sin(x*y*z)"
ic.region1 = "3.0*(x > 0.5 and y > 0.5)"
for a two-component field. It is up to you to make sure your expressions are parsed correctly; otherwise you will get undefined behavior.
Constants
You can add constants to your expressions using the constant
directive.
For instance, in the following code
psi.ic.type=expression
psi.ic.expression.constant.eps = 0.05
psi.ic.expression.constant.R = 0.25
psi.ic.expression.region0 = "0.5 + 0.5*tanh((x^2 + y^2 - R)/eps)"
the constants eps
and R
are defined by the user and then used
in the subsequent expression.
The variables can have any name made up of characters that is not reserved.
However, if multiple ICs are used, they must be defined each time for each IC.
Parameter |
Type |
Description |
---|---|---|
|
query |
coordinate system to use: “cartesian” (for x,y,z,t) and “polar” (for r, theta, z, t) |
IC::Ellipsoid
This IC initializes a single-component fab using the formula
The boundary can be mollified using an error function with parameter \(\varepsilon\)
Warning
This IC is redundant with IC::Ellipse and IC::Expression and will probably be consolidated
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Center of the ellipse \(\mathbf{x}_0\) |
|
queryarr |
Matrix defining elipse radii and orientation |
|
queryarr |
“Vector of radii (use instead of A)” |
|
queryarr |
Mollifying value for erf |
|
query |
Value of field inside ellipse (default: 0) |
|
query |
Value of field outside ellipse (default: 1) |
|
query |
Type of mollifier to use (options: dirac, [gaussian]) |
IC::Laminate
Create a single laminate with specified orientation, thickness, and offset.
Parameter |
Type |
Description |
---|---|---|
|
query |
How many laminates (MUST be greater than or equal to 1). Default = 1 |
|
queryarr |
(x,y,[z]) values for the center point of the laminate |
|
queryarr |
thickness of the laminate |
|
queryarr |
Vector normal to the interface of the laminate |
|
queryarr |
Diffuse thickness |
|
query |
Type of mollifer to use (options: dirac, [gaussian]) |
|
query |
Switch to mode where only one component is used. |
|
query |
Take the complement of the laminate |
IC::Notch
Create a simple notch in an otherwise uniformly filled region. (This was created for, and mostly used for, Mode II fracture tests.)
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Center of notch |
|
queryarr |
Vector describing notch orientation |
|
queryarr |
Thickness of notch |
|
queryarr |
Length of notch |
|
queryarr |
Radius of notch ends |
|
query |
Magnitude of mollifier |
|
query |
IC::PS
Fill a domain with randomly packed and sized spheres.
Warning
This is not used for anything useful as far as we can see. It will likely be removed shortly.
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
IC::PSRead
Fill a domain (region where field=0) with packed spheres (regions where field=1). Sphere locations and radii are determined from an xyzr file.
Parameter |
Type |
Description |
---|---|---|
|
query |
Diffuseness of the sphere boundary |
|
query |
Location of .xyzr file |
IC::PerturbedInterface
Initialize a perturbed interface using Fourier Modes
Notes: 1. todo Extend this class to allow for 3D perturbations, currently only 2D are allowed 2. todo Allow for cosine (or complex exponential) expansions rather than just sin. 3. note This is a two grain only initial condition. 4. note This replaces the depricated “perturbed_bar” initial condition from previous versions
The interface is defined as the \(x=0\) plane (2D), or the \(x=0,z=0\) plane (3D). The equation for the interface is given by \(y(x,z) = \sum_{n\in \{n_1,\ldots,n_N\}} A_n \sin(n\pi x/L_x)\) where \(A_n\) are the amplitudes (stored in #wave_amplitudes), \(n_1,\ldots,n_N\subset\mathbb{Z}_+\) are wave numbers (stored in #wave_numbers), and \(L_x\) is the length in the x direction (obtained using the #geom object).
Grain 1 is defined as being above \(y(x,z)\), Grain 2 is defined as being below.
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Wave numbers |
|
queryarr |
Wave amplitudes |
|
query |
Which axis is normal to the interface (x,y,z) |
|
query |
Interface offset from origin |
|
query |
If true, flip the interface (default:false) |
|
query |
Mollifier (options: dirac, [gaussian]) |
|
query |
Magnitude of mollifier |
IC::Sphere
Parameter |
Type |
Description |
---|---|---|
This is a somewhat antiquated IC that will eventually be replaced with the Expression IC. |
||
|
query |
Radius of the sphere |
|
queryarr |
Vector location of the sphere center |
|
query |
Value of the field inside the sphere |
|
query |
Value of the field outside teh sphere |
|
query |
Type - can be cylinder oriented along the x, y, z directions or full sphere. |
IC::Trig
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
|
|
queryarr |
|
|
query |
|
|
query |
IC::TabulatedInterface
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
|
|
queryarr |
IC::Voronoi
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
queryarr |
|
|
query |
IO
IO::ParmParse
This is a thin wrapper to the amrex::ParmParse class This class exists to add some additional parsing capability, e.g. parsing Set::Matrix and Set::Vector data types.
IO::ParmParse uses static Parse()
functions to
perform cascading class-based input parsing.
See the Autodoc and Autotest section for instructions on adding documentation.
This is standard infrastructure code; make sure you know what you ard doing before you change it.
IO::WriteMetaData
This provide an IO routine for generating run-specific output.
Every Alamo run produces a metadata file and (if applicable) a diff.patch
file that reflects the exact state when the simulation was run.
Note that the file WriteMetaData.cpp
file is _always_ recompiled
upon make
, in order to pull the latest information about the local
state at build.
This is standard infrastructure code; make sure you know what you ard doing before you change it.
Integrator
Pure abstract class for managing data structures, time integration (with substepping), mesh refinement, and I/O.
Native input file parameters:
max_step = [maximum number of timesteps]
stop_time = [maximum simulation time]
timestep = [time step for coarsest level]
amr.regrid_int = [number of timesteps between regridding]
amr.plot_int = [number of timesteps between dumping output]
amr.plot_file = [base name of output directory]
amr.nsubsteps = [number of temporal substeps at each level. This can be
either a single int (which is then applied to every refinement
level) or an array of ints (equal to amr.max_level)
corresponding to the refinement for each level.]
Inherited input file parameters (from amrex AmrMesh class):
amr.v = [verbosity level]
amr.max_level = [maximum level of refinement]
amr.n_proper =
amr.grid_eff =
amr.n_error_buff =
amr.ref_ratio_vect = [refinement ratios in each direction]
amr.ref_ratio = [refinement ratio in all directions (cannot be used with ref_ratio_vect)]
amr.max_grid_x =
amr.blocking_factor =
amr.n_cell = [number of cells on coarsest level]
amr.refine_grid_layout =
amr.check_input =
Parameter |
Type |
Description |
---|---|---|
These are basic parameters that are, in general, common to all Alamo simulations. |
||
|
query |
Number of iterations before ending |
|
query |
Simulation time before ending |
|
query |
Nominal timestep on amrlev = 0 |
|
query |
Name of restart file to READ from |
|
query |
Name of cell-fab restart file to read from |
|
query |
Name of node-fab restart file to read from |
|
queryarr |
Space-separated list of entries to ignore |
These are parameters that are specific to the AMR/regridding part of the code. |
||
|
query |
Regridding interval in step numbers |
|
query |
Regridding interval based on coarse level only |
|
query |
Interval (in timesteps) between plotfiles |
|
query |
Interval (in simulation time) between plotfiles |
|
query |
Output file |
|
query |
Turn on to write all output in cell fabs (default: off) |
|
query |
Turn off to prevent any cell based output (default: on) |
|
query |
Turn on to write all output in node fabs (default: off) |
|
query |
Turn off to prevent any node based output (default: on) |
|
query |
Specify a maximum level of refinement for output files |
|
queryarr |
Number of substeps to take on each level (default: 2) |
|
query |
Number of substeps to take on each level (set all levels to this value) |
Information on how to generate thermodynamic data (to show up in thermo.dat) |
||
|
query |
Default: integrate every time. Integration interval (1) |
|
query |
Interval (in timesteps) between writing |
|
query |
Interval (in simulation time) between writing |
Instead of using AMR, prescribe an explicit, user-defined set of grids to work on. This is pretty much always used for testing purposes only. |
||
|
query |
Use explicit mesh instead of AMR |
Integrator::CahnHilliard
CahnHilliard
Integrator::Flame
Parameter |
Type |
Description |
---|---|---|
|
query |
Burn width thickness |
|
query |
Interface energy param |
|
query |
Scaling factor for mobility |
|
query |
Chemical potential multiplier |
|
query |
Unburned rest energy |
|
query |
Barrier energy |
|
query |
Burned rest energy |
|
query |
Pressure [UNITS?] |
|
query |
AP Power law multiplier |
|
query |
AP Power law exponent |
|
query |
HTPB Power law multiplier |
|
query |
HTPB Power law exponent |
|
query |
Combination power law multiplier |
|
query |
Combination power law exponent |
|
queryclass |
See BC::Constant |
|
query |
IC type - [packedspheres,laminate] - see classes for more information |
|
query |
These parameters are for the Thermal transport model Whether to use the thermal model |
|
query |
Density (before) |
|
query |
Density (after) |
|
query |
Thermal conductivity (before and after) |
|
query |
Thermal conductivity (before and after) |
|
query |
Thermal conductivity (before and after) |
|
query |
Specific heat (before and after) |
|
query |
Specific heat (before and after) |
|
query |
Thermal flux of each material |
|
query |
Thermal flux of each material |
|
query |
Refinement criterion for eta field |
|
query |
Refinement criterion for temperature field |
|
query |
Eta value to restrict the refinament for the temperature field |
|
query |
IC type (psread, laminate, constant) |
|
queryclass |
|
|
queryclass |
Integrator::Fracture
Parameter |
Type |
Description |
---|---|---|
IC for crack field |
||
|
queryarr |
|
|
queryclass |
|
|
queryclass |
|
|
queryclass |
Solver::Nonlocal::Linear<brittle_fracture_model_type_test> solver(op_b); |
Integrator::HeatConduction
This implements a basic heat conduction method in Alamo. The partial differential equation to be solved is
where \(T\) is temperature, \(t\) is time, and \(alpha\) is the thermal diffusivity. Integration is performed explicitly in time using forward Euler, and differentiation is performed using the finite difference method.
Parameter |
Type |
Description |
---|---|---|
The Parse function initializes the HeatConduction object using a parser, pp. Note that this is a static function, which means it does not have direct access to member variables. Instead, it initializes the variables inside the argument, “value”, and so all references to member items are prefixed by “value.” |
||
|
query |
Diffusion coefficient [1.0] |
|
query |
Criterion for mesh refinement [0.01] |
|
query |
Initial condition type ([sphere], constant, expression) |
|
queryclass |
BC::Constant parameters with prefix bc.temp |
Integrator::Mechanics
This is a general purpose integrator that focuses on solving
elasticity/mechanics equations in the absence of other multiphysics
simulations.
It is enabled by alamo.program=mechanics
if used on its own, in
which case there is no prefix.
If it is being used by another integrator, see that integrator to determine
the value of [prefix]
(often equal to elastic
).
This integrator inherits from Integrator::Base::Mechanics; see documentation for that integrator for additional parameters.
Model setup There are two basic tools for setting up a mechanics problem in this integrator.
The
eta
field: this is used to mix models of different types. Usenmodels
to specify how many material models to use, and then specify each model asmodel1
,model2
, etc. The type of moel is specified using thealamo.program.mechanics.model
input.Once you have done this, you must determine the spatial distribution of each model. This is done by choosing an IC for the eta field with
ic.type
. TheIC::Expression
is the most general and recommended. The models are then mixed linearly, i.e.\[W_{\textrm{eff}} = \sum_{i=1}^N W_i\,\eta_i(\mathbf{x})\]See the Eshelby test for an example of model mixing.
The
psi
field: this is used specifically for cases where a “void” region is desired. Its usage is similar to theeta
case, and is conceptually similar in that it scales the model field to near-zero in order to mimic the (lack of) mechanical behavior in an empty region. It is important to usepsi
here, for reasons that are discussed in detail in this paper. The initialization ofpsi
is similar to that foreta
.See the PlateHole and RubberPlateHole for canonical exmaples. The Integrator::Fracture and Integrator::TopOp integrators are examples of integrators that leverage the psi property.
Body forces currently have limited support due to the relatively low number of times they are needed. See the Integrator::Base::Mechanics documentation for detail. See the TrigTest test for examples of current body force implementation.
Boundary conditions are implemented using the BC::Operator::Elastic classes. See the documentation on these classes for more detail. See any of the mechanics-based tests for examples of boundary condition application.
Parameter |
Type |
Description |
---|---|---|
Mechanics inputs. See also Integrator::Base::Mechanics |
||
|
query |
Number of elastic model varieties |
|
query |
Refinement threshold for eta field |
|
query |
Refinement threshold for strain gradient |
|
query |
Read IC type for the eta field |
|
query |
Whether to re-initialize eta when re-gridding occurs. Default is false unless eta ic is set, then default is. true. |
|
query |
Read IC type for the eta field |
|
query |
Whether to re-initialize psi when re-gridding occurs. Default is false unless a psi ic is set, then default is true. |
Integrator::PhaseFieldMicrostructure
file PhaseFieldMicrostructure.H
Parameter |
Type |
Description |
---|---|---|
|
query |
Number of grain fields (may be more if using different IC) |
|
query |
Mobility |
|
query |
Phase field \(\mu\) |
|
query |
Phase field \(\gamma\) |
|
query |
Initial GB energy if not using GB anisotropy |
|
query |
Mobility |
|
query |
Determine whether to use elastic driving force |
|
query |
Multiplier of elastic energy |
|
query |
Elastic threshold (\(\phi_0\)) |
|
query |
Maximum AMR level |
|
query |
Phase field refinement threshold |
|
query |
Elasticity |
|
queryclass |
By default, read in the model specified by “mechanics.model” |
|
query |
Lagrange multiplier method for enforcing volumes Turn on |
|
query |
Lagrange multiplier value |
|
query |
Prescribed volume |
|
query |
Time to start enforcing Lagrange multipler |
|
query |
Anisotropic grain boundary energy parameters Turn on |
|
query |
Regularization param |
|
query |
Time to turn on anisotropy |
|
query |
Modify timestep when turned on |
|
query |
Modify plot_int when turned on |
|
query |
Modify plot_dt when turned on |
|
query |
Modify thermo int when turned on |
|
query |
Modify thermo plot int when turned on |
|
query |
Frequency of elastic calculation |
|
query |
Type of regularization to use |
|
query |
Set the anisotropic GB model Type of GB energy to use |
|
query |
Type (constnat) |
|
query |
IC Type |
Integrator::PolymerDegradation
file PolymerDegradation.H
Parameter |
Type |
Description |
---|---|---|
Water diffusion |
||
|
query |
|
|
query |
Diffusivity |
|
query |
AMR refinement criterion |
|
query |
|
|
queryarr |
|
|
queryclass |
Integrator::SutureCrack
Parameter |
Type |
Description |
---|---|---|
IC for crack field |
||
|
query |
|
|
queryclass |
Integrator::ThermoElastic
Parameter |
Type |
Description |
---|---|---|
|
queryclass |
|
|
queryclass |
|
|
queryarr |
Integrator::TopOp
Parameter |
Type |
Description |
---|---|---|
The mechanics integrator manages the solution of an elastic solve using the MLMG solver. |
||
|
queryclass |
|
|
query |
Read IC type for the eta field |
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
queryclass |
|
|
query |
|
|
query |
|
|
queryclass |
Integrator::Base
Integrator::Base::Mechanics
Parameter |
Type |
Description |
---|---|---|
The mechanics integrator manages the solution of an elastic solve using the MLMG solver. |
||
|
query |
|
|
query |
|
|
queryclass |
Read parameters for Solver::Nonlocal::Newton solver |
|
query |
|
|
query |
Determine the boundary condition type (contant, tension_test, expression) |
|
query |
|
|
query |
Initializer for RHS |
|
query |
Timestep interval for elastic solves (default - solve every time) |
|
query |
Maximum multigrid coarsening level (default - none, maximum coarsening) |
|
query |
|
|
query |
Whether to refine based on elastic solution |
|
query |
Set this to true to zero out the displacement before each solve. (This is a temporary fix - we need to figure out why this is needed.) |
Model
In Alamo, any type of constitutive behavior is encapsulated in a “Model”. There is a broad range of model types, and so there is no abstract Model class. Rather, the base Model classes are stored in subsets of Model.
Model::Interface
Model::Interface::Crack
Model::Interface::Crack::Constant
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Interface::Crack::Sin
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Interface::GB
Model::Interface::GB::AbsSin
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
convert degrees into radians |
|
query |
Model::Interface::GB::Read
Parameter |
Type |
Description |
---|---|---|
|
query |
Model::Interface::GB::Sin
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
convert degrees into radians |
|
query |
|
|
query |
Model::Interface::GB::SH
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
convert degrees into radians |
|
query |
convert degrees into radians |
|
query |
|
|
query |
Model::Solid
Solid models are used with the Integrator::Mechanics integrator, which
implements the Solver::Nonlocal::Newton elasticity solver.
All solid models inherit from the Model::Solid
base class, which requires
all of the necessary components to be used in a mechanics solve.
Model classes have basically two functions:
Provide energy (W), stress (DW), and modulus (DDW) based on a kinematic variable
Evolve internal variables in time.
Model::Solid::Affine
“Affine” generally means “linear with an offset”. Here we use “affine” to refer to models that are elastic with an eigenstrain, i.e.
The quantity \(\varepsilon_0\) is any kind of eigenstrain - examples include thermal strain, plastic strain, or viscous strain. This class can be used directly, where the eigenstrain is read in or set by the integrator. There are also classes (particularly visco/plastic models) that inherit from this type of model.
Model::Solid::Affine::Cubic
Parameter |
Type |
Description |
---|---|---|
This class extends Model::Solid::Linear::Cubic by adding an eigenstrain. (See the Linear::Cubic class for more inputs for this model) |
||
|
queryarr |
Eigenstrain |
Model::Solid::Affine::CubicDegradable
Parameter |
Type |
Description |
---|---|---|
This class inherits from Model::Solid::Affine::Cubic. It provides the ability to “degrade” while retaining information about its original, pristine state |
||
|
query |
Original, undegraded \(\mathbb{C}_{11}\) |
|
query |
Original, undegraded \(\mathbb{C}_{12}\) |
|
query |
Original, undegraded \(\mathbb{C}_{44}\) |
|
query |
Bunge Euler angles \(\phi_1\) |
|
query |
Bunge Euler angles \(\Phi\) |
|
query |
Bunge Euler angles \(\phi_2\) |
Model::Solid::Affine::Hexagonal
Parameter |
Type |
Description |
---|---|---|
|
queryarr |
Eigenstrain |
Model::Solid::Affine::IsotropicDegradable
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Solid::Affine::Isotropic
Parameter |
Type |
Description |
---|---|---|
|
query |
Lame modulus |
|
query |
Shear modulus |
|
query |
Elastic modulus |
|
query |
Poisson’s ratio |
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
queryarr |
Eigendeformation gradient |
Model::Solid::Affine::J2PlasticDegradable
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Solid::Affine::J2
This models an isotropic elastic-perfectly-plastic, non-time-dependent solid model.
The energy and derivatives are:
where \(\mathbb{C}\) is an isotropic Set::Matrix4
and \(\varepsilon_p\) is
is stored in the F0
eigenstrain.
The plastic strain is evolved according to the following:
Calculate the deviatoric stress \(\sigma_v=\sigma - \frac{1}{3}tr(\sigma)\mathbf{I}\)
Calculate \(J_2=\sqrt{\frac{3}{2}\sigma_v:\sigma_v}\)
If \(J_2<\sigma_0\) then quit - no plasticity occurs
Calculate \(\Delta\sigma = (1-\frac{\sigma_0}{J_2})\), which projects the stress back on the yield surface.
Convert to change in plastic strain, \(\Delta\varepsilon=\mathbb{C}^{-1}\Delta\sigma\)
Update plastic strain: \(\varepsilon_p += \Delta\varepsilon\)
Notes:
This does not implement any kind of hardening model. Rate hardening, isotropic hardening, and kinematic hardening have yet to be implemneted.
Parameter |
Type |
Description |
---|---|---|
See also inputs to Model::Solid::Affine::Isotropic |
||
|
query |
J2 Yield criterion |
Model::Solid::Affine::J2Plastic
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Solid::Elastic
Model::Solid::Elastic::NeoHookean
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
Model::Solid::Elastic::PseudoLinearCubic
Parameter |
Type |
Description |
---|---|---|
|
query |
Elastic constant (default: 1.68) |
|
query |
Elastic constant (default: 1.21) |
|
query |
Elastic constant (default: 0.75) |
|
query |
Bunge Euler angle \(\phi_1\) |
|
query |
Bunge Euler angle \(\Phi\) |
|
query |
Bunge Euler angle \(\phi_2\) |
Model::Solid::Linear
Model::Solid::Linear::Cubic
This class implements basic cubic elasticity. For a discussion on cubic elasticity, please see this link.
Parameter |
Type |
Description |
---|---|---|
|
query |
Elastic constant (default: 1.68) |
|
query |
Elastic constant (default: 1.21) |
|
query |
Elastic constant (default: 0.75) |
|
query |
Bunge Euler angle \(\phi_1\) |
|
query |
Bunge Euler angle \(\Phi\) |
|
query |
Bunge Euler angle \(\phi_2\) |
Model::Solid::Linear::Hexagonal
This class implements basic hexagonal elasticity.
Parameter |
Type |
Description |
---|---|---|
|
query |
Elastic constant |
|
query |
Elastic constant |
|
query |
Elastic constant |
|
query |
Elastic constant |
|
query |
Elastic constant |
|
query |
Bunge Euler angle \(\phi_1\) |
|
query |
Bunge Euler angle \(\Phi\) |
|
query |
Bunge Euler angle \(\phi_2\) |
Model::Solid::Linear::IsotropicDegradable
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Solid::Linear::Isotropic
This model implements an isotropic linear elastic material. See this link for more information about the theory.
Free energy for a linear material is defined as
For an isotropic material, stress and strain are related through
where \(\lambda\) and \(\mu\) are the Lame constant and shear modulus, respectively.
Users can specify these either through (lame
and shear
)
OR (lambda
and mu
) OR (E
and nu
).
Class methods:
Isotropic()
: Basic constructor. Does nothing, and leaves all values initiated as NAN.Isotropic(Solid<Set::Sym::Isotropic> base)
Basic constructor. Does nothing gut allows for inheritance.Isotropic(Set::Scalar a_mu, Set::Scalar a_lambda)
BAD old-fashioned constructor. Do not use!~Isotropic()
Simple destructor. Don’t need to change it.void Define(Set::Scalar a_mu, Set::Scalar a_lambda)
BAD old-fashioned way of doing things. UseParse
instead.Set::Scalar W(const Set::Matrix & gradu) const override
Returns elastic free energy densitySet::Matrix DW(const Set::Matrix & gradu) const override
Returns first derivative of free energy, the stress tensorSet::Matrix4<...> DDW(const Set::Matrix & ) const override
Returns second derivative of free energy, the modulus tensorvirtual void Print(std::ostream &out) const override
Prints the modulus tensor object to output stream (usually the terminal)static Isotropic Random()
Static method that generates a random yet acceptable model.static Isotropic Zero()
Static method that generates a “zero” element (so that there is no effect under addition)static void Parse(Isotropic & value, IO::ParmParse & pp)
Parser where all the IO occurs
Parameter |
Type |
Description |
---|---|---|
|
query |
Whether or not to use the plane stress approximation. |
|
query |
Lame parameter |
|
query |
Shear modulus (redundant with “mu”) |
|
query |
Lame parameter |
|
query |
Shear modulus (redundant with “shear”) |
|
query |
Elastic modulus |
|
query |
Poisson’s ratio |
Model::Solid::Linear::IsotropicDegradableTanh
Parameter |
Type |
Description |
---|---|---|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
|
|
query |
Model::Solid::Linear::Laplacian
Parameter |
Type |
Description |
---|
Numeric
Numeric::Interpolator
This namespace has evolved to contain some general Interpolator routines that are actually unrelated. The Numeric::Interpolator::Linear is an I/O utility. The Numeric::Interpolator::NodeBilinear is a low-level AMReX override that the average user (or even coder) will probably not need to touch.
Numeric::Interpolator::Linear
This is a general-purpose routine for specifying time-interpolated quantities in an input file. Interpolators obey the following syntax:
(t1,t2,..,tn;v1,v2,...,vn)
where tn
are times and vn
are values at those times.
Note: do not include whitespace in an interpolator, this will mess with the parser.
Interpolators can usually be used in place of regular numbers, but only when supported by the calling parse function.
For instance, the BC::Operator::Elastic::TensionTest allows the user to specify fixed displacement; for instance, to specify a value of 0.1:
bc.tenstion_test.disp = 0.1
However, it may be desirable to change the value over time. In this case, one may specify an interpolator string instead:
bc.tenstion_test.disp = (1.0,1.5,2.0;0.0,0.1,0.0)
This will cause the displacement value to be zero for t<1.0
;
ramp to 0.1
as 1.0<t<2.0
;
ramp back to 0.0
as 2.0<t<3.0
;
and then remain at the constant value of 3.0
for t>3.0
.
Parameter |
Type |
Description |
---|---|---|
|
query |
Interpolator string used when Parsed from queryclass. |
Numeric::Interpolator::NodeBilinear
Provide an interpolator function that can work with templated fields.
Warning: This is a low-level class used to add templating functionality to unerlying AMReX classes. Edit at your own risk!
Operator
Operator::Elastic
Parameter |
Type |
Description |
---|---|---|
|
query |
Set
The Set namespace defines the Alamo datatypes.
This includes scalars (Set::Scalar
), vectors (Set::Vector
), and nD tensors (Set::Tensor
).
Scalars are an alias for AMReX Real
.
Vectors and tensors are an alias for the Tuxfamily Eigen vectors and matrices, and so you can use
Eigen operations on them (like A.determinant()
, etc.)
See the Eigen documentation for more.
The Set namespace defines the Matrix4
datatype for fourth order tensors.
These can have isotropic, major, minor, majorminor, etc., symmetries.
The Set namespace also defines the Field
datatype, which is where most data is stored.
It is templated so that Set::Field<Set::Scalar>
is a field of scalars, Set::Field<Set::Vector>
is a vector field, etc.
One can also have, for instance, a field of models, like Set::Field<Model::Solid::Linear::Iostropic>
.
Solver
Solver::Nonlocal
Solver::Nonlocal::Linear
Parameter |
Type |
Description |
---|---|---|
These are the parameters that are read in for a standard multigrid linear solve. |
||
|
query |
Max number of iterations to perform before erroring out |
|
query |
Max number of iterations on the bottom solver |
|
query |
Max number of F-cycle iterations to perform |
|
query |
Number of fixed iterations to perform before exiting gracefully |
|
query |
Verbosity of the solver (1-5) |
|
query |
Number of smoothing operations before bottom solve (2) |
|
query |
Number of smoothing operations after bottom solve (2) |
|
query |
Number of final smoothing operations when smoother is used as bottom solver (8) |
|
query |
Additional smoothing after bottom CG solver (0) |
|
query |
The method that is used for the multigrid bottom solve (cg, bicgstab, smoother) |
|
query |
Relative tolerance on bottom solver |
|
query |
Absolute tolerance on bottom solver |
|
query |
Relative tolerance |
|
query |
Absolute tolerance |
|
query |
Omega (used in gauss-seidel solver) |
|
query |
Whether to average down coefficients or use the ones given. (Setting this to true is important for fracture.) |
|
query |
Whether to normalize DDW when calculating the diagonal. This is primarily used when DDW is near-singular - like when there is a “void” region or when doing phase field fracture. |
|
query |
[false]
If set to true, output diagnostic multifab information
whenever the MLMG solver fails to converge.
(Note: you must also set |
|
query |
[true]
If set to false, MLMG will not die if convergence criterion
is not reached.
(Note: you must also set |
Solver::Nonlocal::Newton
Parameter |
Type |
Description |
---|---|---|
These paramters control a standard Newton-Raphson solve. Note: This class inherits all of the linear solve paramters from its parent class, Solver::Nonlocal::Linear |
||
|
query |
Number of newton-raphson iterations. |
|
query |
Util
Inputs Search
Use the following box to search over all alamo inputs and descriptions. This is the same list as in the Inputs Search section as generated by the autodoc system.
Note If searching for documentation on an alamo command that you found in an input file, remember that the prefix may not be included in this table. For instance, if you are looking for documentation on the following inputs
hc.heat.alpha = 1.0
el.nmodels = 2
the prefixes hc
and el
are not necessarily included, and you will not find them
if you do an exact search.
Instead, do a reverse search, starting with alpha
and nmodels
, then work out
the prefixes out.
Parameter |
Namespace / Class |
Description |
---|---|---|
|
BC type on the lower x edge (2d) face (3d) |
|
|
BC type on the upper x edge (2d) face (3d) |
|
|
BC type on the lower y edge (2d) face (3d) |
|
|
BC type on the upper y edge (2d) face (3d) |
|
|
BC type on the lower z face (processed but ignored in 2d to prevent unused input errors) |
|
|
BC type on the upper z face (processed but ignored in 2d to prevent unused input errors) |
|
|
BC value on the lower x edge (2d) face (3d) |
|
|
BC value on the upper x edge (2d) face (3d) |
|
|
BC value on the lower y edge (2d) face (3d) |
|
|
BC value on the upper y edge (2d) face (3d) |
|
|
BC value on the lower z face (processed but ignored in 2d to prevent unused input errors) |
|
|
BC value on the upper z face (processed but ignored in 2d to prevent unused input errors) |
|
|
Location of the step on the xlo edge/face |
|
|
Location of the step on the xhi edge/face |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Face 2D Edge |
|
|
3D Face 2D Edge |
|
|
3D Face 2D Edge |
|
|
3D Face 2D Edge |
|
|
3D Face |
|
|
3D Face |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Face / 2D Edge |
|
|
3D Face / 2D Edge |
|
|
3D Face / 2D Edge |
|
|
3D Face / 2D Edge |
|
|
3D Face |
|
|
3D Face |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Corner |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Edge / 2D Corner |
|
|
3D Face 2D Edge |
|
|
3D Face 2D Edge |
|
|
3D Face 2D Edge |
|
|
3D Face 2D Edge |
|
|
3D Face |
|
|
3D Face |
|
|
Tension test type. (Only option right now is |
|
|
Applied displacement (can be interpolator) |
|
|
Applied traction (can be interpolator) |
|
|
Normal vector for hyperplane |
|
|
Value of the field on the positive side of the hyperplane |
|
|
BMP filename. |
|
|
How to fit. (options: stretch, fitheight, fitwidth) |
|
|
Color channel to use (options: r, R, g, G, b, B) |
|
|
Scaling value - minimum (default: 0.0) |
|
|
Scaling value - maximum (default: 255.0) |
|
|
Coordinates (X Y Z) of the center of the square/cube. |
|
|
Lenth of the square/cube edges |
|
|
Array of constant values. The number of values should equal either 1 or N where N is the number of fab components |
|
|
Thickness of the notches |
|
|
Width of the notches |
|
|
Center of the notches |
|
|
Length of the notches |
|
|
Coorinates of ellipse center |
|
|
Diffuse boundary thickness |
|
|
DxD square matrix defining an ellipse. |
|
|
If |
|
|
Number of ellipses |
|
|
center of the ellipse |
|
|
either a vector containing ellipse radii, or a matrix defining the ellipse |
|
|
Same |
|
|
Array of radii [depricated] |
|
|
Regularization for smooth boundary |
|
|
Flip the inside and the outside |
|
|
coordinate system to use: “cartesian” (for x,y,z,t) and “polar” (for r, theta, z, t) |
|
|
Center of the ellipse \(\mathbf{x}_0\) |
|
|
Matrix defining elipse radii and orientation |
|
|
“Vector of radii (use instead of A)” |
|
|
Mollifying value for erf |
|
|
Value of field inside ellipse (default: 0) |
|
|
Value of field outside ellipse (default: 1) |
|
|
Type of mollifier to use (options: dirac, [gaussian]) |
|
|
How many laminates (MUST be greater than or equal to 1). Default = 1 |
|
|
(x,y,[z]) values for the center point of the laminate |
|
|
thickness of the laminate |
|
|
Vector normal to the interface of the laminate |
|
|
Diffuse thickness |
|
|
Type of mollifer to use (options: dirac, [gaussian]) |
|
|
Switch to mode where only one component is used. |
|
|
Take the complement of the laminate |
|
|
Center of notch |
|
|
Vector describing notch orientation |
|
|
Thickness of notch |
|
|
Length of notch |
|
|
Radius of notch ends |
|
|
Magnitude of mollifier |
|
|
||
|
||
|
||
|
||
|
Diffuseness of the sphere boundary |
|
|
Location of .xyzr file |
|
|
Wave numbers |
|
|
Wave amplitudes |
|
|
Which axis is normal to the interface (x,y,z) |
|
|
Interface offset from origin |
|
|
If true, flip the interface (default:false) |
|
|
Mollifier (options: dirac, [gaussian]) |
|
|
Magnitude of mollifier |
|
|
Radius of the sphere |
|
|
Vector location of the sphere center |
|
|
Value of the field inside the sphere |
|
|
Value of the field outside teh sphere |
|
|
Type - can be cylinder oriented along the x, y, z directions or full sphere. |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Number of iterations before ending |
|
|
Simulation time before ending |
|
|
Nominal timestep on amrlev = 0 |
|
|
Name of restart file to READ from |
|
|
Name of cell-fab restart file to read from |
|
|
Name of node-fab restart file to read from |
|
|
Space-separated list of entries to ignore |
|
|
Regridding interval in step numbers |
|
|
Regridding interval based on coarse level only |
|
|
Interval (in timesteps) between plotfiles |
|
|
Interval (in simulation time) between plotfiles |
|
|
Output file |
|
|
Turn on to write all output in cell fabs (default: off) |
|
|
Turn off to prevent any cell based output (default: on) |
|
|
Turn on to write all output in node fabs (default: off) |
|
|
Turn off to prevent any node based output (default: on) |
|
|
Specify a maximum level of refinement for output files |
|
|
Number of substeps to take on each level (default: 2) |
|
|
Number of substeps to take on each level (set all levels to this value) |
|
|
Default: integrate every time. Integration interval (1) |
|
|
Interval (in timesteps) between writing |
|
|
Interval (in simulation time) between writing |
|
|
Use explicit mesh instead of AMR |
|
|
Burn width thickness |
|
|
Interface energy param |
|
|
Scaling factor for mobility |
|
|
Chemical potential multiplier |
|
|
Unburned rest energy |
|
|
Barrier energy |
|
|
Burned rest energy |
|
|
Pressure [UNITS?] |
|
|
AP Power law multiplier |
|
|
AP Power law exponent |
|
|
HTPB Power law multiplier |
|
|
HTPB Power law exponent |
|
|
Combination power law multiplier |
|
|
Combination power law exponent |
|
|
See BC::Constant |
|
|
IC type - [packedspheres,laminate] - see classes for more information |
|
|
These parameters are for the Thermal transport model Whether to use the thermal model |
|
|
Density (before) |
|
|
Density (after) |
|
|
Thermal conductivity (before and after) |
|
|
Thermal conductivity (before and after) |
|
|
Thermal conductivity (before and after) |
|
|
Specific heat (before and after) |
|
|
Specific heat (before and after) |
|
|
Thermal flux of each material |
|
|
Thermal flux of each material |
|
|
Refinement criterion for eta field |
|
|
Refinement criterion for temperature field |
|
|
Eta value to restrict the refinament for the temperature field |
|
|
IC type (psread, laminate, constant) |
|
|
||
|
||
|
||
|
||
|
||
|
Solver::Nonlocal::Linear<brittle_fracture_model_type_test> solver(op_b); |
|
|
Diffusion coefficient [1.0] |
|
|
Criterion for mesh refinement [0.01] |
|
|
Initial condition type ([sphere], constant, expression) |
|
|
BC::Constant parameters with prefix bc.temp |
|
|
Number of elastic model varieties |
|
|
Refinement threshold for eta field |
|
|
Refinement threshold for strain gradient |
|
|
Read IC type for the eta field |
|
|
Whether to re-initialize eta when re-gridding occurs. Default is false unless eta ic is set, then default is. true. |
|
|
Read IC type for the eta field |
|
|
Whether to re-initialize psi when re-gridding occurs. Default is false unless a psi ic is set, then default is true. |
|
|
Number of grain fields (may be more if using different IC) |
|
|
Mobility |
|
|
Phase field \(\mu\) |
|
|
Phase field \(\gamma\) |
|
|
Initial GB energy if not using GB anisotropy |
|
|
Mobility |
|
|
Determine whether to use elastic driving force |
|
|
Multiplier of elastic energy |
|
|
Elastic threshold (\(\phi_0\)) |
|
|
Maximum AMR level |
|
|
Phase field refinement threshold |
|
|
Elasticity |
|
|
By default, read in the model specified by “mechanics.model” |
|
|
Lagrange multiplier method for enforcing volumes Turn on |
|
|
Lagrange multiplier value |
|
|
Prescribed volume |
|
|
Time to start enforcing Lagrange multipler |
|
|
Anisotropic grain boundary energy parameters Turn on |
|
|
Regularization param |
|
|
Time to turn on anisotropy |
|
|
Modify timestep when turned on |
|
|
Modify plot_int when turned on |
|
|
Modify plot_dt when turned on |
|
|
Modify thermo int when turned on |
|
|
Modify thermo plot int when turned on |
|
|
Frequency of elastic calculation |
|
|
Type of regularization to use |
|
|
Set the anisotropic GB model Type of GB energy to use |
|
|
Type (constnat) |
|
|
IC Type |
|
|
||
|
Diffusivity |
|
|
AMR refinement criterion |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Read IC type for the eta field |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Read parameters for Solver::Nonlocal::Newton solver |
|
|
||
|
Determine the boundary condition type (contant, tension_test, expression) |
|
|
||
|
Initializer for RHS |
|
|
Timestep interval for elastic solves (default - solve every time) |
|
|
Maximum multigrid coarsening level (default - none, maximum coarsening) |
|
|
||
|
Whether to refine based on elastic solution |
|
|
Set this to true to zero out the displacement before each solve. (This is a temporary fix - we need to figure out why this is needed.) |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
convert degrees into radians |
|
|
||
|
||
|
||
|
convert degrees into radians |
|
|
||
|
||
|
||
|
convert degrees into radians |
|
|
convert degrees into radians |
|
|
||
|
||
|
Eigenstrain |
|
|
Original, undegraded \(\mathbb{C}_{11}\) |
|
|
Original, undegraded \(\mathbb{C}_{12}\) |
|
|
Original, undegraded \(\mathbb{C}_{44}\) |
|
|
Bunge Euler angles \(\phi_1\) |
|
|
Bunge Euler angles \(\Phi\) |
|
|
Bunge Euler angles \(\phi_2\) |
|
|
Eigenstrain |
|
|
||
|
||
|
||
|
||
|
Lame modulus |
|
|
Shear modulus |
|
|
Elastic modulus |
|
|
Poisson’s ratio |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Eigendeformation gradient |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
J2 Yield criterion |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Elastic constant (default: 1.68) |
|
|
Elastic constant (default: 1.21) |
|
|
Elastic constant (default: 0.75) |
|
|
Bunge Euler angle \(\phi_1\) |
|
|
Bunge Euler angle \(\Phi\) |
|
|
Bunge Euler angle \(\phi_2\) |
|
|
Elastic constant (default: 1.68) |
|
|
Elastic constant (default: 1.21) |
|
|
Elastic constant (default: 0.75) |
|
|
Bunge Euler angle \(\phi_1\) |
|
|
Bunge Euler angle \(\Phi\) |
|
|
Bunge Euler angle \(\phi_2\) |
|
|
Elastic constant |
|
|
Elastic constant |
|
|
Elastic constant |
|
|
Elastic constant |
|
|
Elastic constant |
|
|
Bunge Euler angle \(\phi_1\) |
|
|
Bunge Euler angle \(\Phi\) |
|
|
Bunge Euler angle \(\phi_2\) |
|
|
||
|
||
|
||
|
||
|
Whether or not to use the plane stress approximation. |
|
|
Lame parameter |
|
|
Shear modulus (redundant with “mu”) |
|
|
Lame parameter |
|
|
Shear modulus (redundant with “shear”) |
|
|
Elastic modulus |
|
|
Poisson’s ratio |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
Interpolator string used when Parsed from queryclass. |
|
|
||
|
Max number of iterations to perform before erroring out |
|
|
Max number of iterations on the bottom solver |
|
|
Max number of F-cycle iterations to perform |
|
|
Number of fixed iterations to perform before exiting gracefully |
|
|
Verbosity of the solver (1-5) |
|
|
Number of smoothing operations before bottom solve (2) |
|
|
Number of smoothing operations after bottom solve (2) |
|
|
Number of final smoothing operations when smoother is used as bottom solver (8) |
|
|
Additional smoothing after bottom CG solver (0) |
|
|
The method that is used for the multigrid bottom solve (cg, bicgstab, smoother) |
|
|
Relative tolerance on bottom solver |
|
|
Absolute tolerance on bottom solver |
|
|
Relative tolerance |
|
|
Absolute tolerance |
|
|
Omega (used in gauss-seidel solver) |
|
|
Whether to average down coefficients or use the ones given. (Setting this to true is important for fracture.) |
|
|
Whether to normalize DDW when calculating the diagonal. This is primarily used when DDW is near-singular - like when there is a “void” region or when doing phase field fracture. |
|
|
[false]
If set to true, output diagnostic multifab information
whenever the MLMG solver fails to converge.
(Note: you must also set |
|
|
[true]
If set to false, MLMG will not die if convergence criterion
is not reached.
(Note: you must also set |
|
|
Number of newton-raphson iterations. |
|
|
Developer Guide
Step-by-step development guide
This is a quick tutorial intended for new Alamo developers to get up to speed with contributing to the Alamo code base.
- Create Github credentials.
If you do not have one already, create a new GitHub account, and email your username to brunnels@iastate.edu to request push access
Follow these Github instructions to add an SSH key to your account.
important Make sure your repository points to the SSH version of Alamo. You can check this with the command
git remote show origin
If the output begins with
Fetch URL: git@github.com:solidsgroup/alamo.git Push URL: git@github.com:solidsgroup/alamo.git
then you have configured correctly check. However, if the output begins with
Fetch URL: https://github.com/solidsuccs/alamo.git Push URL: https://github.com/solidsuccs/alamo.git
this means that you are using HTTPS authentication, which will not allow you to push. To fix, run
git remote remove origin git remote add origin git@github.com:solidsgroup/alamo.git
Run a quick
git pull
to make sure that you still have access. If you get an authentication error, this likely means that your SSH key is not configured correctly.
Create a new branch. You can create a branch from the terminal, or you can use the Github online interface. Follow these guidlines when naming your branch
Use combinations of lowercase letters and hyphens, avoid mixed case, numbers, and underscores (
gas-combustion
good,GasCombustion2
bad).Be as descriptive as possible and avoid overly general names (
gb-damage-model
good,model1
/mymodel
/foo
bad). Long is ok.Keep it professional. No profanity or excessive whimsy in branch names.
If you have created a branch (e.g.
mytestbranch
) locally, make sure to rungit push --set-upstream origin mytestbranch
to make pushing easier.
Create a capability input file. This is an input file that is designed to demonstrate the functionality of your new code. The capability input file should always be located in the alamo root directory. The
plot_file
should always beoutput
. Once you are ready to merge your code into development, convert your input file to a regression test and remove it from the root. (See the Autodoc and Autotest section).Use an EditorConfig-compliant text editor. Alamo uses EditorConfig to maintain code formatting standards. VS Code is recommended, as it supports multiple keybinding schemes and automatically supports editorconfig.
Write your code. As you are writing, keep the following in mind:
always
Commit your code - at least once per day you are coding, even if the code is not working. There are multiple great tutorials if you are not sure how to commit your code.
always
Write meaningful commit messages. This will help you more than you may realize when you are trying to debug your code later.
always
Follow the development guide below and stick to the specified convention.
regularly
Merge the latest development into your code (see below for more details). The more frequently you do this, the less painful your life will be later.
regularly
Run the regression test suite with
make test
. This helps to ensure that you are not breaking your (or someone else’s) code.regularly
Ensure that your commits pass the commit tests. Sometimes this is not possible, especially if your code is in active development, but the more you keep your code up to standard, the easier your life will be later.
regularly
Document your code. Use the autodoc system to ensure a base level of documentation.
rarely
Break backwards compatibility. If you are implementing an improved version of a model that is better than the legacy model, leave the option to run using the existing model. This is important because publications may have used the legacy model, and may need the legacy model to reproduce important results. Backwards compatibility should only be broken when implementing fundamental new features. Even then, changes required to reproduce legacy results should be kept minimal.
never
Modify the GitHub actions to get your branch to pass the tests. Email failure notifications may be annoying, but they are there for a reason.
never
Commit large or unnecessary files to the repository. Use
git status
liberally, before and aftergit commit
, before you push. Edit your gitignore file as needed.never
Commit sensitive content to the repository. This is usually an issue only if your project is export controlled, which is rare. But when in doubt, ask.
Merge your branch into development To include your changes into the development branch, submit a pull request from your branch into development. This will trigger a review before the merge can be approved. (Note that all tests must pass before the merge will be reviewed.) The more frequently you merge in the latest from development, the easier your merge will be.
How do I know my code is ready to merge? You should always merge your code once you know that it works, but sometimes this is a gray area. You should always merge your code if you are submitting a publication, or if you are a PhD student about to graduate.
Tutorial: A new Integrator
Integrators are the basic workhorse in Alamo. They are called Integrators because they usually (although not always) are intended to integrate a PDE in time. In this tutorial, we will create a new integrator based on the existing HeatConduction integrator.
Create a copy of
./src/Integrator/HeatConduction.H
inside the same directory, called MyPDE.H (We will use the working name “MyPDE” here - you can replace with your own name.)Rename all instances of HeatConduction with MyPDE inside
./src/Integrator/MyPDE.H
. This includes the names throughout the code as well as the include guard in the first two lines.Include the file in
./src/alamo.cc
#include "Integrator/MyPDE.H"
and add a caller inside the main function:
//existing else if (program == "thermoelastic")integrator = new Integrator::ThermoElastic(pp); //new else if (program == "mypde") integrator = new Integrator::MyPDE(pp);
Finally copy the Heat Conduction example file to the root directory
cp ./tests/HeatConduction/input ./input
In the input file change the
plot_file
to output andalamo.program
tomypde
.You should now be able to compile and run the code. The result will be the same as for the heat conduction example, but will be based on the newly copied integrator.
You can now begin alternating the code to achieve different outputs. The HeatConduction integrator has extensive, line-by-line documentation.
Conventions
Namespaces
Classes and structures are organized using namespaces.
Namespaces should be brief but descriptive, and two nested namespaces should correspond to two nested subsets.
For instance Shape::Polygon::Triangle
is acceptable whereas Shape::Circle::Round
is not (since “round” is not a subset of “Circle”).
The directory structure must reflect the namespace structure.
For instance Shape::Polygon::Triangle
must be declared in src/Shape/Polygon/Triangle.H
.
Regular and Pure Virtual classes
Pure virtual classes must have the same name as the namespace in which they are contained.
For instance Model::Elastic::Elastic
is pure virtual, whereas Model::Elastic::Isotropic
must inherit from Model::Elastic::Elastic
and is not pure virtual.
Include Guards
Include guards should be all uppercase, and should be the same as the path (relative to src/) with / replaced by underscores. For instance: a file called src/Integrator/Integrator.H should have the include guard
#ifndef INTEGRATOR_INTEGRATOR_H
#define INTEGRATOR_INTEGRATOR_H
...
#endif
Member and Argument Variable Names
Members of a class should have names beginning with m_
; argument variables should begin with a_
.
For instance:
class MyClass
{
public:
MyClass(a_myvariable) : m_myvariable(a_myvariable)
{}
private:
m_myvariable;
}
Python (In development)
Alamo supports a (currently limited) Python interface. It can be run as simply as
python alamo.py
where alamo.py
is a python script that you write.
An example (that currently works) is
import alamo
alamo.Util.Initialize()
mytest = alamo.Test.Operator.Elastic()
mytest.setBounds([1.0,1.0,1.0])
for lev in [1,2,3]:
print("Levels of refinement: " + str(lev))
mytest.Define([32,32,32],lev,1,mytest.Grid.XYZ)
failed = mytest.TrigTest(0,0,1,"")
if failed: print("Test failed")
else: print ("Test passed")
alamo.Util.Finalize()
Note that the C++ namespace structure is mirrored in the Python bindings.
Warning
Note that object constructors require ()
, e.g. test = alamo.Test.Operator.Elastic()
.
If you forget the ()
the python interpreter will not complain!
Instead, it will give you an extremely cryptic message about member methods not having the right number of arguments.
A typical error message might look like this:
Traceback (most recent call last):
File "alamo.py", line 7, in <module>
mytest.setBounds([1.0,1.0,1.0])
TypeError: unbound method Boost.Python.function object must be called with Elastic instance as first argument (got list instance instead)
Compiling Alamo Python interface
The python interface requires all code to be compiled using the -fPIC
flag.
To compile AMReX,
./compile [whatever flags you would normally use
make USE_COMPILE_PIC=TRUE
make install
To compile Alamo, you need the Boost python library. On ubuntu, install with
sudo apt install libboost-python-dev
Then to compile Alamo,
./configure [whatever flags you would normally use] --python
make python
This will create a file called alamo.so
in the Alamo root directory.
(Note that this file must be in your python path (or your current directory) to use.)
Extending the Alamo Python interface
Python bindings are currently limited and you will likely need to add them if you want them for a specific component.
Alamo uses the Boost Python library to create the Python bindings.
All of this code is located in the py/
directory, and mimics the directory structure of src/
.
These are all C++ files, but use the .cpy
extension.
To add bindings (e.g. to an object) you must
Create an appropriately named file (e.g.
py/Test/Operator/Elastic.cpy
to bindTest::Operator::Elastic
).Define a function that encapsulates the bindings (e.g.
void exportTestOperatorElastic
).Write the Boost Python bindings in the function. Keep in mind that you need to specify namespace explicitly.
Include the file in
py/alamo.cpy
Call the function in
py/alamo.cpy
Restart files
You can restart a simulation from any point at which you have dumped an output file. For instance, suppose you have run alamo with this command
./bin/alamo-2d-g++ input
and it produced the following output.
./output
00000cell 00000node
00010cell 00010node
00020cell 00020node
00030cell 00030node
00040cell 00040node
00050cell 00050node
00060cell 00060node
00070cell 00070node
celloutput.visit
nodeoutput.visit
metadata
You may wish to restart the simulation without starting from the beginning.
Perhaps the simulation was fine at 00060
but became unstable at 00070
, and you want to continue from that point with a different parameter value.
To do that, you can simply run:
./bin/alamo-2d-g++ input restart=./output/00060cell
for the simulation to pick up where it left off, but with updated values (or updated code) that may have changed since you first ran it.
It is important to distinguish what the restart function does and does not do.
- The restart function DOES:
Import all of the data from fields named “XXX” “YYY” etc into corresponding fields with the same names in the new simulation.
Set the clock equal to the time corresponding to the output file.
Set the current timestep equal to that corresponding to the output file.
- The restart function DOES NOT:
Set any other simulation parameters. The input file is responsible for setting all simulation parameters. It is up to you to use them (or change them) as needed.
Initialize non-matching data. If you try to restart using data containing fields “AAA” and “BBB” but your simulation expects fields “BBB” and “CCC”, only “BBB” will be initialized - the rest is undefined.
Continue to output to the same directory. A different directory will be created. Only the metadata file will record where the restard data came from.