Tamaas — A high-performance library for periodic rough surface contact
Tamaas (from تماس meaning “contact” in Arabic and Farsi) is a high-performance rough-surface periodic contact code based on boundary and volume integral equations. The clever mathematical formulation of the underlying numerical methods (see e.g. doi:10.1007/s00466-017-1392-5 and arxiv:1811.11558) allows the use of the fast-Fourier Transform, a great help in achieving peak performance: Tamaas is consistently two orders of magnitude faster (and lighter) than traditional FEM! Tamaas is aimed at researchers and practitioners wishing to compute realistic contact solutions for the study of interface phenomena.
You can see Tamaas in action with our interactive tutorials.
Library overview
Tamaas is mainly composed of three components:
Random surface generation procedures
Model state objects and operators
Contact solving procedures
These parts are meant to be independent as well as inter-operable. The first one
provides an interface to several stochastic surface generation algorithms
described in Random rough surfaces. The second provides an interface to a state
object Model
(and C++ class
tamaas::Model
) as well as integral operators based on the state
object (see Model and integral operators). Finally, the third part provides contact solving
routines that make use of the integral operators for performance (see
Solving contact).
Tutorials
The following tutorial notebooks can also be used to learn about Tamaas:
Elastic Contact (live notebook, notebook viewer)
Rough Surfaces (live notebook, notebook viewer)
Citations
Tamaas is the fruit of a research effort. To give proper credit to its creators
and the scientists behind the methods it implements, you can use the
tamaas.utils.publications()
function at the end of your python scripts.
This function scans global variables and prints the relevant citations for the
different capabilities of Tamaas used. Note that it may miss citations if some
objects are not explicitly stored in named variables, so please examine the
relevant publications in doi:10.21105/joss.02121.
Changelog
The changelog can be consulted here.
Seeking help
You can ask your questions on gitlab using this form. If you do not have an account, you can create one on this page.
Contribution
Contributions to Tamaas are welcome, whether they are code, bug, or documentation related.
Code
Please fork Tamaas and submit your patch as a merge request.
Bug reports
You can also contribute to Tamaas by reporting any bugs you find here if you have an account on gitlab. Please read the FAQ before posting.
Quickstart
Here is a quick introduction to get you started with Tamaas.
Installation from PyPI
If you have a Linux system, or have installed the Windows Subsystem for Linux,
you can simply run python3 -m pip install tamaas
. This installs the latest
stable version of Tamaas from PyPI. You
can get the latest cutting-edge build of Tamaas with:
python3 -m pip install \
--extra-index-url https://gitlab.com/api/v4/projects/19913787/packages/pypi/simple \
tamaas
Note
To limit the number of statically linked dependencies in the wheel package, the builds that can be installed via PyPI or the GitLab package registery do not include parallelism or architecture specific optimizations. If you want to execute Tamaas in parallel, or want to improve performance, it is highly recommanded that you install with Spack or compile from source with the instructions below.
Installation with Spack
If you have Spack installed (e.g. in an HPC environment), you can install Tamaas with the following:
spack install tamaas
This will install an MPI-enabled version of tamaas with Scipy solvers. The
command spack info tamaas
shows the build variants. To disable MPI, you
should disable MPI in the FFTW variant:
spack install tamaas ^fftw~mpi
The Spack package for Tamaas allows installation from the repository with
spack install tamaas@master
.
You can also use Spack to create container recipes with spack containerize
.
Here’s an example spack.yaml
for Tamaas which creates an image with OpenMPI
and NetCDF so that Tamaas can be executed in parallel within the container with
Singularity:
spack:
config:
build_jobs: 2
specs:
- matrix:
- [py-mpi4py, py-netcdf4, tamaas@master+solvers]
- ["^openmpi@4 fabrics=ofi,psm2,ucx schedulers=none"]
concretizer:
unify: true
container:
format: singularity
images:
os: ubuntu:20.04
spack: develop
os_packages:
final:
- gfortran
Docker image
We provide Docker images that are automatically built and pused to the Gitlab registry for compatibility reasons (mainly with macOS). To get the latest image simply run:
docker pull registry.gitlab.com/tamaas/tamaas
# to rename for convenience
docker tag registry.gitlab.com/tamaas/tamaas tamaas
Then you can run scripts directly:
docker run -v $PWD:/app -t tamaas python3 /app/your_script.py
# or
docker run tamaas tamaas surface --sizes 16 16 --cutoffs 4 4 8 --hurst 0.8 | docker run -i tamaas tamaas contact 0.1 > results.npy
Warning
The provided Docker image and Dockerfile offer limited customization options and are hard-wired to use OpenMPI. If the use case/goal is to run in HPC environements, containers generated with Spack should be preferred, as they allow greater flexibility in the dependency selection and installed packages.
The Dockerfile
at the root of the Tamaas repository can be used to build an
image containing Tamaas with a full set of dependencies and customize the build
options. Simply run:
docker build -t tamaas .
Tip
The following arguments can be passed to docker to customize the Tamaas
build (with the --build-arg
flag for docker build
):
BACKEND
: parallelism model for loopsFFTW_THREADS
: parallelism model for FFTW3USE_MPI
: compile an MPI-parallel version of Tamaas
See below for explanations.
Singularity container
A singularity container can be created from the docker image with:
singularity build tamaas.sif docker://registry.gitlab.com/tamaas/tamaas
To run the image with MPI:
mpirun singularity exec --home=$PWD tamaas.sif python3 <your_script>
Installation from source
First make sure the following dependencies are installed for Tamaas:
a C++ compiler with full C++14 and OpenMP support
SCons (python build system)
FFTW3
thrust (1.9.2+)
boost (pre-processor)
python 3+ with numpy
pybind11 (included as submodule)
expolit (included as submodule)
Optional dependencies are:
an MPI implementation
FFTW3 with MPI/threads/OpenMP (your pick) support
scipy (for nonlinear solvers)
uvw, h5py, netCDF4 (for dumpers)
googletest and pytest (for tests)
Doxygen and Sphinx (for documentation)
Tip
On a HPC environment, use the following variables to specify where the dependencies are located:
FFTW_ROOT
THRUST_ROOT
BOOST_ROOT
PYBIND11_ROOT
GTEST_ROOT
Note
You can use the provided Dockerfile to build an image with the external dependencies installed.
You should first clone the git repository with the submodules that are dependencies to tamaas (pybind11 and googletest):
git clone --recursive https://gitlab.com/tamaas/tamaas.git
The build system uses SCons. In order to compile Tamaas with the default options:
scons
After compiling a first time, you can edit the compilation options in the file
build-setup.conf
, or alternatively supply the options directly in the
command line:
scons option=value [...]
To get a list of all build options and their possible values, you can run
scons -h
. You can run scons -H
to see the SCons-specific options (among
them -j n
executes the build with n
threads and -c
cleans the
build). Note that the build is aware of the CXX
and CXXFLAGS
environment
variables.
Once compiled, you can install the python module with:
scons install prefix=/your/prefix
The above command automatically calls pip
if it is installed. If want to
install an editable package for development, the best practice is to run the
following in a virtual environment:
scons dev
This is equivalent to running pip install -e build-release/python[all]
. You
can check that everything is working fine with:
python3 -c 'import tamaas; print(tamaas)'
Important build options
Here are a selected few important compilation options:
build_type
Controls the type of build, which essentially changes the optimisation level (
-O0
fordebug
,-O2
forprofiling
and-O3
forrelease
) and the amount of debug information. Default type isrelease
. Accepted values are:release
debug
profiling
CXX
Compiler (uses the environment variable
CXX
by default).CXXFLAGS
Compiler flags (uses the environment variable
CXXFLAGS
by default). Useful to add tuning flags (e.g.-march=native -mtune=native
for GCC or-xHOST
for Intel), or additional optimisation flags (e.g.-flto
for link-time optimization).backend
Controls the Thrust parallelism backend. Defaults to
omp
for OpenMP. Accepted values are:omp
: OpenMPcpp
: Sequentialtbb
(unsupported): Threading Building Blocks
fftw_threads
Controls the FFTW thread model. Defaults to
omp
for OpenMP. Accepted values are:omp
: OpenMPthreads
: PThreadsnone
: Sequential
use_mpi
Activates MPI-parallelism (boolean value).
More details on the above options can be found in Performance.
Building the docs
Documentation is built using scons doc
. Make sure to have the correct
dependencies installed (they are already provided in the Docker image).
Running the contact pipe tools
Once installed, the python package provides a tamaas command, which defines three subcommands that can be used to explore the mechanics of elastic rough contact:
surface
generates randomly rough surfaces (see Random rough surfaces)contact
solves an elastic contact problem with a surface read fromstdin
(see Solving contact)plot
plots the surface tractions and displacements read fromstdin
Here’s a sample command line for you to try out:
tamaas surface --cutoffs 2 4 64 --size 512 512 --hurst 0.8 | tamaas contact 1 | tamaas plot
Check out the help of each command (e.g. tamaas surface -h
) for a description
of the arguments.
Running the tests
You need to activate the build_tests
option to compile the tests:
scons build_tests=True
Tests can then be run with the scons test
command. Make sure you have
pytest installed.
Random rough surfaces
The generation of stochatsticly rough surfaces is controlled in Tamaas by two abstract classes: tamaas::SurfaceGenerator
and tamaas::Filter
. The former provides access lets the user set the surface sizes and random seed, while the latter encodes the information of the spectrum of the surface. Two surface generation methods are provided:
tamaas::SurfaceGeneratorFilter
implements a Fourier filtering algorithm (see Hu & Tonder),tamaas::SurfaceGeneratorRandomPhase
implements a random phase filter.
Both of these rely on a tamaas::Filter
object to provided the filtering information (usually power spectrum density coefficients). Tamaas provides two such classes and allows for Python subclassing:
tamaas::Isopowerlaw
provides a roll-off powerlaw,tamaas::RegularizedPowerlaw
provides a powerlaw with a regularized rolloff.
Tamaas also provided routines for surface statistics.
Generating a surface
Let us now see how to generate a surface. Frist create a filter object and set the surface sizes:
import tamaas as tm
# Create spectrum object
spectrum = tm.Isopowerlaw2D()
# Set spectrum parameters
spectrum.q0 = 4
spectrum.q1 = 4
spectrum.q2 = 32
spectrum.hurst = 0.8
The spectrum
object can be queried for information, such as the root-mean-square of heights, the various statistical moments, the spectrum bandwidth, etc. Then we create a generator object and build the random surface:
generator = tm.SurfaceGeneratorFilter2D([128, 128])
generator.spectrum = spectrum
generator.random_seed = 0
surface = generator.buildSurface()
Important
The surface
object is a numpy.ndarray
wrapped
around internal memory in the generator
object, so a subsequent call to
buildSurface
may
change its content. Note that if generator
goes out of scope its memory
will not be freed if there is still a live reference to the surface data.
Important
If ran in an MPI context, the constructor of
SurfaceGeneratorFilter2D
(and others) expects the global
shape of the surface. The shape can also be changed with generator.shape =
[64, 64]
.
It is common to normalize a surface after it has been generated so that one can scale the surface to a desired stastistic, e.g. to specify the root-mean-square of slopes:
rms_slopes = 0.25
surface /= iso.rmsSlopes()
surface *= rms_slopes
# Compute root-mean-square of slopes in Fourier domain
print(tm.Statistics2D.computeSpectralRMSSlope(surface))
# Compute root-mean-square of slopes with finite differences
# (introduces discretization error)
print(tm.Statistics2D.computeFDRMSSlope(surface))
Note
The spectrum object gives the expected value of surface statistics, but the
corresponding value for a surface realization can differ (particularily if
the SurfaceGeneratorFilter2D
is used). One could normalize a
surface with the actual statistic, but this leads to biased quantities
when a representative sample of surfaces is used.
Custom filter
Tamaas provides several classes that can be derived directly with Python classes, and tamaas::Filter
is one of them. Since it provides a single pure virtual method computeFilter
, it is easy to write a sub-class. Here we implement a class that takes a user-defined auto-correlation function and implements the computeFilter
virtual function:
import numpy
class AutocorrelationFilter(tm.Filter2D):
def __init__(self, autocorrelation):
tm.Filter2D.__init__(self)
self.autocorrelation = autocorrelation.copy()
def computeFilter(self, filter_coefficients):
shifted_ac = numpy.fft.ifftshift(self.autocorrelation)
# Fill in the PSD coefficients
filter_coefficients[...] = numpy.sqrt(np.fft.rfft2(shifted_ac))
# Normalize
filter_coefficients[...] *= 1 / numpy.sqrt(self.autocorrelation.size)
Here filter_coefficients
is also a numpy.ndarray
and is therefore easily manipulated. The creation of the surface then follows the same pattern as previously:
# Create spectrum object
autocorrelation = ... # set your desired autocorrelation
spectrum = AutocorrelationFilter(autocorrelation)
generator = tm.SurfaceGenerator2D()
generator.shape = autocorrelation.shape
generator.spectrum = spectrum
surface = generator.buildSurface()
The lifetime of the spectrum
object is associated to the generator
when setSpectrum
is called.
Surface Satistics
Tamaas provides the C++ class tamaas::Statistics
and its wrapper Statistics2D
to compute statistics on surfaces, including:
power spectrum density
autocorrelation
spectrum moments
root-mean-square of heights \(\sqrt{\langle h^2 \rangle}\)
root-mean-square of slopes (computed in Fourier domain) \(\sqrt{\langle |\nabla h|^2\rangle}\)
All these quantities are computed in a discretization-independent manner: increasing the number of points in the surface should not drastically change the computed values (for a given spectrum). This allows to refine the discretization as much as possible to approximate a continuum. Note that the autocorrelation and PSD are fft-shifted. Here is a sample code plotting the PSD and autocorrelation:
psd = tm.Statistics2D.computePowerSpectrum(surface)
psd = numpy.fft.fftshift(psd, axes=0) # Shifting only once axis because of R2C transform
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
plt.imshow(psd.real, norm=LogNorm())
acf = tm.Statistics2D.computeAutocorrelation(surface)
acf = numpy.fft.fftshift(acf)
plt.figure()
plt.imshow(acf)
plt.show()
See examples/statistics.py
for more usage examples of statistics.
Model and integral operators
The class tamaas::Model
(and its counterpart Model
) is both a central class in Tamaas and one of the simplest. It mostly serves as holder for material properties, fields and integral operators, and apart from a linear elastic behavior does not perform any computation on its own.
Units in Tamaas
All quantities in Tamaas are unitless. To put real units onto them, one can use the following equation, which must have a consistent set of units:
It relates the surface displacement \(u\) to the pressure \(p\), with
the Young’s modulus \(E\), the Poisson coefficient \(\nu\) and the
horizontal physical size of the system \(L\) (i.e. the horizontal
period of the system). The wavenumber \(k\) is adimensional. This means
that \(L\) is the natural unit for lengths (which can be specified when
creating the Model
object), and \(E^* := E / (1 - \nu^2)\) is the
natural unit for pressures (which can be accessed with model.E_star
). All
other units (areas, forces, energies, etc.) are derived from these two units.
In general, it is a good idea to work with a unit set that gives numerical values of the same order of magnitude to minimize floating point errors in algebraic operations. While this is not always possible, because in elastic contact we have \(u \sim h_\mathrm{rms}\) and \(p \sim h'_\mathrm{rms} E^*\), which are dependent, one should avoid using meters if expected lengths are nanometers for example.
Model types
tamaas::Model
has a concrete subclass tamaas::ModelTemplate
which implements the model function for a given tamaas::model_type
:
tamaas::basic_2d
Model type used in normal frictionless contact: traction and displacement are 2D fields with only one component.
tamaas::surface_2d
Model type used in frictional contact: traction and displacement are 2D fields with three components.
tamaas::volume_2d
Model type used in elastoplastic contact: tractions are the same as with
tamaas::surface_2d
but the displacement is a 3D field.
The enumeration values suffixed with _1d
are the one dimensional (line contact) counterparts of the above model types. The domain physical dimension and number of components are encoded in the class tamaas::model_type_traits
.
Model creation and basic functionality
The instanciation of a Model
requires the
model type, the physical size of the system, and the number of points in each direction:
physical_size = [1., 1.]
discretization = [512, 512]
model = tm.Model(tm.model_type.basic_2d, physical_size, discretization)
Warning
For models of type volume_*d
, the first component of the
physical_size
and discretization
arrays corresponds to the depth
dimension (\(z\) in most cases). For example:
tm.Model(tm.model_type.basic_2d, [0.3, 1, 1], [64, 81, 81])
creates a model of depth 0.3 and surface size 12, while the number of points is 64 in depth and 812 on the surface. This is done for data contiguity reasons, as we do discrete Fourier transforms in the horizontal plane.
Note
If ran in an MPI context, the constructor to Model
expects the global system sizes
and discretization of the model.
Tip
Deep copies of model objects can be done with the copy.deepcopy()
function:
import copy
model_copy = copy.deepcopy(model)
Note that it only copies fields, not operators or dumpers.
Model properties
The properties E
and nu
can be used to set the Young’s modulus and Poisson ratio respectively:
model.E = 1
model.nu = 0.3
Fields
Fields can be easlily accessed with the []
operator, similar to Python’s dictionaries:
surface_traction = model['traction']
# surface_traction is a numpy array
To know what fields are available, you can call the list
function on
a model (list(model)
). You can add new fields to a model object with the
[]
operator:model['new_field'] = new_field
, which is convenient for
dumping fields that are computed outside of Tamaas.
Note
The fields traction
and displacement
are always registered in models,
and are accessible via model.traction
and model.displacement
.
A model can also be used to compute stresses from a strain field:
import numpy
strain = numpy.zeros(model.shape + [6]) # Mandel--Voigt notation
stress = numpy.zeros_like(strain)
model.applyElasticity(stress, strain)
Tip
print(model)
gives a lot of information about the model: the model type,
shape, registered fields, and more!
Integral operators
Integral operators are a central part of Tamaas: they are carefully designed for
performance in periodic system. When a Model
object is used with contact solvers or with a residual object (for plasticty),
the objects using the model register integral operators with the model, so the
user typically does not have to worry about creating integral operators.
Integral operators are accessed through the operators
property of a model object. The []
operator gives access to the operators, and list(model.operators)
gives the
list of registered operators:
# Accessing operator
elasticity = model.operators['hooke']
# Applying operator
elasticity(strain, stress)
# Print all registered operators
print(list(model.operators))
Note
At model creation, these operators are automatically registered:
hooke
: Hooke’s elasticity lawvon_mises
: computes Von Mises stressesdeviatoric
: computes the deviatoric part of a stress tensoreigenvalues
: computes the eigenvalues of a symetric tensor field
Westergaard
operators are automatically
registered when solveNeumann
or solveDirichlet
are called.
Model dumpers
The submodule tamaas.dumpers contains a number of classes to save model data into different formats:
UVWDumper
Dumps a model to VTK format. Requires the UVW python package which you can install with pip:
pip install uvw
This dumper is made for visualization with VTK based software like Paraview.
NumpyDumper
Dumps a model to a compressed Numpy file.
H5Dumper
Dumps a model to a compressed HDF5 file. Requires the h5py package. Saves separate files for each dump of a model.
NetCDFDumper
Dumps a model to a compressed NetCDF file. Requires the netCDF4 package. Saves sequential dumps of a model into a single file, with the
frame
dimension containing the model dumps.
The dumpers are initialzed with a basename and the fields that you wish to write to file (optionally you can set all_fields
to True
to dump all fields in the model). By default, each write operation creates a new file in a separate directory (e.g. UVWDumper
creates a paraview
directory). To write to a specific file you can use the dump_to_file method. Here is a usage example:
from tamaas.dumpers import UVWDumper, H5Dumper
# Create dumper
uvw_dumper = UVWDumper('rough_contact_example', 'stress', 'plastic_strain')
# Dump model
uvw_dumper << model
# Or alternatively
model.addDumper(H5Dumper('rough_contact_archive', all_fields=True))
model.addDumper(uvw_dumper)
model.dump()
The last model.dump()
call will trigger all dumpers. The resulting files will have the following hierachy:
./paraview/rough_contact_example_0000.vtr
./paraview/rough_contact_example_0001.vtr
./hdf5/rough_contact_archive_0000.h5
Important
Currently, only H5Dumper
and
NetCDFDumper
support
parallel output with MPI.
Solving contact
The resolution of contact problems is done with classes that inherit from tamaas::ContactSolver
. These usually take as argument a tamaas::Model
object, a surface described by a tamaas::Grid
or a 2D numpy array, and a tolerance. We will see the specificities of the different solver objects below.
Elastic contact
The most common case is normal elastic contact, and is most efficiently solved with tamaas::PolonskyKeerRey
. The advantage of this class is that it combines two algorithms into one. By default, it considers that the contact pressure field is the unknown, and tries to minimize the complementary energy of the system under the constraint that the mean pressure should be equal to the value supplied by the user, for example:
# ...
solver = tm.PolonskyKeerRey(model, surface, 1e-12)
solver.solve(1e-2)
Here the average pressure is 1e-2
. The solver can also be instanciated by specifying the the constraint should be on the mean gap instead of mean pressure:
solver = tm.PolonskyKeerRey(model, surface, 1e-12, constraint_type=tm.PolonskyKeerRey.gap)
solver.solve(1e-2)
The contact problem is now solved for a mean gap of 1e-2
. Note that the choice of constraint affects the performance of the algorithm.
Computing solutions for loading sequence
The module tamaas.utils
defines a convenience function
load_path
, which generates solution models
for a sequence of loads. This allows lazy evalution and reduces boiler-plate:
from tamaas.utils import load_path
loads = np.linspace(0.01, 0.1, 10)
for model in load_path(solver, loads):
... # do some computation on model, e.g. compute contact clusters
The function load_path
accepts the following
optional arguments:
verbose
Prints solver output (i.e. iteration, cost function and error)
callback
A function to call after each solve, before the next load step. Useful for dumping model in generator expressions.
Contact with adhesion
The second algorithm hidden in tamaas::PolonskyKeerRey
considers the gap to be the unknown. The constaint on the mean value can be chosen as above:
solver = tm.PolonskyKeerRey(model, surface, 1e-12,
primal_type=tm.PolonskyKeerRey.gap,
constraint_type=tm.PolonskyKeerRey.gap)
solver.solve(1e-2)
The advantage of this formulation is to be able to solve adhesion problems (Rey et al.). This is done by adding a term to the potential energy functional that the solver tries to minimize:
adhesion_params = {
"rho": 2e-3,
"surface_energy": 2e-5
}
adhesion = tm.ExponentialAdhesionFunctional(surface)
adhesion.setParameters(adhesion)
solver.addFunctionalterm(adhesion)
solver.solve(1e-2)
Custom classes can be used in place of the example term here. One has to inherit from tamaas::Functional
:
import numpy
class AdhesionPython(tm.Functional):
"""
Functional class that extends a C++ class and implements the virtual
methods
"""
def __init__(self, rho, gamma):
super().__init__(self)
self.rho = rho
self.gamma = gamma
def computeF(self, gap, pressure):
return -self.gamma * numpy.sum(np.exp(-gap / self.rho))
def computeGradF(self, gap, gradient):
gradient += self.gamma * numpy.exp(-gap / self.rho) / self.rho
This example is actually equivalent to tamaas::functional::ExponentialAdhesionFunctional
.
Tangential contact
For frictional contact, several solver classes are available. Among them, tamaas::Condat
is able to solve a coupled normal/tangential contact problem regardless of the material properties. It however solves an associated version of the Coulomb friction law. In general, the Coulomb friction used in contact makes the problem ill-posed.
Solving a tangential contact problem is not much different from normal contact:
mu = 0.3 # Friction coefficient
solver = tm.Condat(model, surface, 1e-12, mu)
solver.max_iter = 5000 # The default of 1000 may be too little
solver.solve([1e-2, 0, 1e-2]) # 3D components of applied mean pressure
Elasto-plastic contact
For elastic-plastic contact, one needs three different solvers: an elastic contact solver like the ones described above, a non-linear solver and a coupling solver. The non-linear solvers available in Tamaas are implemented in python and inherit from the C++ class tamaas::EPSolver
. They make use of the non-linear solvers available in scipy:
DFSANESolver
Implements an interface to
scipy.optimize.root()
wiht the DFSANE method.NewtonKrylovSolver
Implements an interface to
scipy.optimize.newton_krylov()
.
These solvers require a residual vector to cancel, the creation of which is handled with tamaas::ModelFactory
. Then, an instance of tamaas::EPICSolver
is needed to couple the contact and non-linear solvers for the elastic-plastic contact problem:
import tamaas as tm
from tamaas.nonlinear_solvers import DFSANESolver
# Definition of modeled domain
model_type = tm.model_type.volume_2d
discretization = [32, 51, 51] # Order: [z, x, y]
flat_domain = [1, 1]
system_size = [0.5] + flat_domain
# Setup for plasticity
material = tm.materials.IsotropicHardening(model,
sigma_y=0.1 * model.E,
hardening=0.01 * model.E)
residual = tm.Residual(model, material)
epsolver = DFSANESolver(residual)
# ...
csolver = tm.PolonskyKeerRey(model, surface, 1e-12)
epic = tm.EPICSolver(csolver, epsolver, 1e-7, relaxation=0.3)
epic.solve(1e-3)
# or use an accelerated scheme (which can sometimes not converge)
epic.acceleratedSolve(1e-3)
By default, tamaas::EPICSolver::solve()
uses a relaxed fixed point. It can be tricky to make it converge: you need to decrease the relaxation parameter passed as argument of the constructor, but this also hinders the convergence rate. The function tamaas::EPICSolver::acceleratedSolve()
does not require the tweaking of a relaxation parameter, so it can be faster if the latter does not have an optimal value. However, it is not guaranteed to converge.
Finally, during the first iterations, the fixed point error will be large compared to the error of the non-linear solver. It can improve performance to have the tolerance of the non-linear solver (which is the most expensive step of the fixed point solve) decrease over the iterations. This can be achieved with the decorator class ToleranceManager
:
from tamaas.nonlinear_solvers import ToleranceManager, DFSANESolver
@ToleranceManager(start=1e-2,
end=1e-9,
rate=1 / 3)
class Solver(DFSANESolver):
pass
# ...
epsolver = Solver(residual)
# or
epsolver = ToleranceManager(1e-2, 1e-9, 1/3)(DFSANESolver)(residual)
Custom Contact Solvers
The tamaas::ContactSolver
class can be derived in Python so that
users can interface with Scipy’s scipy.optimize.minimize()
function or
PETSc’s solvers accessible in the Python interface. See
examples/scipy_penalty.py
for an example on how to proceed.
Working with MPI
Distributed memory parallelism in Tamaas is implemented with MPI. Due to the bottleneck role of the fast-Fourier
transform in Tamaas’ core routines, the data layout of Tamaas is that of FFTW.
Tamaas is somewhat affected by limitations of FFTW, and MPI only works on
systems with a 2D boundary, i.e. basic_2d
, surface_2d
and volume_2d
model types (which are the most important anyways, since rough contact mechanics
can yield different scaling laws in 1D).
MPI support in Tamaas is still experimental, but the following parts are tested:
Rough surface generation
Surface statistics computation
Elastic normal contact
Elastic-plastic contact (with
DFSANECXXSolver
)Dumping models with
H5Dumper
andNetCDFDumper
.
Tip
One can look at examples/plasticity.py
for a full example of an
elastic-plastic contact simulation that can run in MPI.
Transparent MPI context
Some parts of Tamaas work transparently with MPI and no additional work or logic is needed.
Warning
MPI_Init()
is automatically called when importing the
tamaas
module in Python. While this works transparently most of the time,
in some situations, e.g. in Singularity containers, the program can hang if
tamaas
is imported first. It is therefore advised to run from mpi4py
import MPI
before import tamaas
to avoid issues.
Creating a model
The following snippet creates a model whose global shape is [16, 2048, 2048]
:
import tamaas as tm
model = tm.Model(tm.model_type.volume_2d,
[0.1, 1, 1], [16, 2048, 2048])
print(model.shape, model.global_shape)
Running this code with mpirun -np 3
will print the following (not necessarily
in this order):
[16, 683, 2048] [16, 2048, 2048]
[16, 682, 2048] [16, 2048, 2048]
[16, 683, 2048] [16, 2048, 2048]
Note that the partitioning occurs on the x dimension of the model (see below for more information on the data layout imposed by FFTW).
Creating a rough surface
Similarly, rough surface generators expect a global shape and return the partionned data:
iso = tm.Isopowerlaw2D()
iso.q0, iso.q1, iso.q2, iso.hurst = 4, 4, 32, .5
gen = tm.SurfaceGeneratorRandomPhase2D([2048, 2048])
gen.spectrum = iso
surface = gen.buildSurface()
print(surface.shape, tm.mpi.global_shape(surface.shape))
With mpirun -np 3
this should print:
(682, 2048) [2048, 2048]
(683, 2048) [2048, 2048]
(683, 2048) [2048, 2048]
Handling partitioning edge cases
Under certain conditions, FFTW may assign to one or more processes a size of zero to the x dimension of the model. If that happens, the surface generator will raise a runtime error, which causes a deadlock because it does not exit the processes with zero data. The correct way to handle this edge case is:
from mpi4py import MPI
try:
gen = tm.SurfaceGeneratorRandomPhase2D([128, 128])
except RuntimeError as e:
print(e)
MPI.COMM_WORLD.Abort(1)
This will correctly kill all processes. Alternatively, os._exit()
can be used,
but one should avoid sys.exit()
, as it kills the process by raising an
exception, which still results in a deadlock.
Computing statistics
With a model’s data distributed among independent process, computing global
properties, like the true contact area, must be done in a collective fashion.
This is transparently handled by the Statistics
class, e.g. with:
contact = tm.Statistics2D.contact(model.traction)
This gives the correct contact fraction, whereas something like
np.mean(model.traction > 0)
will give a different result on each processor.
Nonlinear solvers
The only nonlinear solver (for plastic contact) that works with MPI is
DFSANECXXSolver
, which is
a C++ implementation of DFSANESolver
that works in an MPI context.
Note
Scipy and Numpy use optimized BLAS routines for array operations, while Tamaas does not, which results in serial performance of the C++ implementation of the DF-SANE algorithm being lower than the Scipy version.
Dumping models
The only dumpers that properly works in MPI are the H5Dumper
and NetCDFDumper
. Output is then as simple as:
from tamaas.dumpers import H5Dumper
H5Dumper('output', all_fields=True) << model
This is useful for doing post-processing separately from the main simulation: the post-processing can then be done in serial.
MPI convenience methods
Not every use case can be handled transparently, but although adapting existing
scripts to work in an MPI context can require some work, especially if said
scripts rely on numpy and scipy for pre- and post-processing (e.g. constructing
a parabolic surface for hertzian contact, computing the total contact area), the
module mpi
provides some convenience functions to
make that task easier. The functions mpi.scatter
and mpi.gather
can be used to scatter/gather 2D data using the
partitioning scheme expected from FFTW (see figure below). The functions
mpi.rank
and mpi.size
are used to determine the local process rank and the
total number of processes respectively.
If finer control is needed, the function mpi.local_shape
gives the 2D shape of the local data if given
the global 2D shape (its counterpart mpi.global_shape
does the exact opposite), while
mpi.local_offset
gives the offset
of the local data in the global \(x\) dimension. These two functions mirror
FFTW’s own data distribution functions.
2D Data distribution scheme from FFTW. N0
and N1
are the
number of points in the \(x\) and \(y\) directions
respectively. The array local_N0
, indexed by the process rank,
give the local size of the \(x\) dimension. The
local_offset
function
gives the offset in \(x\) for each process rank.
The mpi
module also contains a function
sequential
whose return value is
meant to be used as a context manager. Within the sequential context the default
communicator is MPI_COMM_SELF
instead of MPI_COMM_WORLD
.
For other MPI functionality not covered by Tamaas that may be required, one can
use mpi4py, which in conjunction with the
methods in mpi
should handle just about any use
case.
Examples
The directory examples/
in Tamaas’ root repository contains example scripts
dedicated to various aspects of Tamaas:
statistics.py
This script generates a rough surface and computes its power spectrum density as well as its autocorrelation function.
rough_contact.py
This script generates a rough surface and solves an adhesion-less elastic contact problem.
adhesion.py
This script solves a rough contact problem with an exponential energy functional for adhesion. It also shows how to derive an energy functional in python.
saturation.py
This script solves a saturated contact problem (i.e. pseudo-plasticity) with a rough surface.
stresses.py
This script solves an equilibrium problem with an eigenstrain distribution and a surface traction distribution and writes the output to a VTK file. It demonstrates how the integral operators that Tamaas uses internally for elastic-plastic contact can be used directly in Python.
plasticity.py
This script solves an elastoplastic Hertz contact problem with three load steps and writes the result to VTK files.
scipy_penalty.py
This script shows how to implement a contact solver in python that uses the contact functionals of Tamaas. Here we use Scipy’s
scipy.optimize.minimize()
function to solve a contact problem with penalty.
Performance
Parallelism
Tamaas implements shared-memory parallelism using thrust. The Thrust backend can be controlled with
the following values of the backend
build option:
omp
Thrust uses its OpenMP backend (the default). The number of threads is controlled by OpenMP.
cpp
Thurst does not run in threads (i.e. sequential). This is the recommanded option if running multiple MPI tasks.
tbb
Thrust uses its TBB backend. Note that this option is not fully supported by Tamaas.
Tip
When using the OpenMP or TBB backend, the number of threads can be
manually controlled by the initialize
function. When OpenMP is selected for the backend, the environment variable
OMP_NUM_THREADS
can also be used to set the number of threads.
FFTW has its own system for thread-level parallelism, which can be controlled
via the fftw_threads
option:
none
FFTW does not use threads.
threads
FFTW uses POSIX/Win32 threads for parallelism.
omp
FFTW uses OpenMP.
Note
As with the Thrust backend, the number of threads for FFTW can be
controlled with initialize
.
Finally, the boolean variable use_mpi
controls wheter Tamaas is compiled
with MPI-parallelism. If yes, Tamaas will be linked against libfftw3_mpi
regardless of the thread model.
Important
Users wary of performance should use MPI, as it yields remarkably better scaling properties than the shared memory parallelism models. Care should also be taken when compiling with both OpenMP and MPI support: setting the number of threads to more than one in an MPI context can decrease performance.
Integration algorithm
In its implementation of the volume integral operators necessary for elastic-plastic solutions, Tamaas differenciates two way of computing the intermediate integral along \(z\) in the partial Fourier domain:
Cutoff integration: because the intermediate integral involves kernels of the form \(\exp(q(x-y))\), it is easy to truncate the integral when \(x\) and \(y\) are far apart, especially for large values of \(q\). This changes the complexity of the intermediate integral from \(O(N_1N_2N_3^2)\) (the naive implementation) to \(O(\sqrt{N_1^2 + N_2^2}N_3^2)\).
Linear integration: this method relies on a separation of variables \(\exp(q(x-y)) = \exp(qx)\cdot\exp(-qy)\). This allows to break the dependency in \(N_3^2\) of the number of operations, so that the overall complexity of the intermediate integral is \(O(N_1N_2N_3)\).
Details on both algorithms can be found in 1. Tamaas uses linear integration by default because it is faster in many cases without introducing a truncation error. Unfortunatly, it has a severe drawback when considering systems with a fine surface discretization: due to \(q\) increasing with the number of points on the surface, the separated terms \(\exp(qx)\) and \(\exp(-qy)\) may overflow and underflow respectively. Tamaas will warn if that is the case, and users have two options to remedy the situation:
Change the integration method by calling
setIntegrationMethod
with the desiredintegration_method
on theModel
object you use in the computation.Compile Tamaas with the option
real_type='long double'
. To make manipulation of numpy arrays easier, adtype
is provided in thetamaas
module which can be used to create numpy arrays compatible with Tamaas’ floating point type (e.g.x = np.linspace(0, 1, dtype=tamaas.dtype)
)
Both these options negatively affect the performance, and it is up to the user to select the optimal solution for their particular use case.
Computational methods & Citations
Tamaas uses specialized numerical methods to efficiently solve elastic and elastoplastic periodic contact problems. Using a boundary integral formulation and a half-space geometry for the former allow (a) the focus of computational power to the contact interface since the bulk response can be represented exactly, (b) the use of the fast-Fourier transform for the computation of convolution integrals. In conjunction with a boundary integral formulation of the bulk state equations, a conjugate gradient approach is used to solve the contact problem.
Note
The above methods are state-of-the-art in the domain of rough surface contact. Below are selected publications detailing the methods used in elastic contact with and without adhesion:
Boundary integral formulation:
Stanley and Kato (J. of Tribology, 1997)
Conjugate Gradient:
Polonsky and Keer (Wear, 1999)
Rey, Anciaux and Molinari (Computational Mechanics, 2017)
Frictional contact:
For elastic-plastic contact, Tamaas uses a similar approach by implementing a volume integral formulation of the bulk equilibrium equations. Thanks to kernel expressions that are directly formulated in the Fourier domain, the method reduces the algorithmic complexity, memory requirements and sampling errors compared to traditional volume integral methods (Frérot, Bonnet, Anciaux and Molinari, Computer Methods in Applied Mechanics and Engineering, 2019, arxiv:1811.11558). The figure below shows a comparison of run times for an elasticity problem (only a single solve step) between Tamaas and Akantu, a high-performance FEM code using the direct solver MUMPS.
Comparison of run times between the volume integral implementation (with cutoff integration) of Tamaas and an FEM solve step with a Cholesky factorization performed by Akantu+MUMPS. \(N\) is the total number of points.
Further discussion about the elastic-plastic solver implemented in Tamaas can be found in Frérot, Bonnet, Anciaux and Molinari, (Computer Methods in Applied Mechanics and Engineering, 2019, arxiv:1811.11558).
- 1
L. Frérot, “Bridging scales in wear modeling with volume integral methods for elastic-plastic contact,” École Polytechnique Fédérale de Lausanne, 2020 (Section 2.3.2). doi:10.5075/epfl-thesis-7640.
Frequently Asked Questions
Importing tamaas
module gives a circular import error on Windows
(Similar to this issue)
Installing with pip install tamaas
does not work on Windows, as binary
distributions are only built for Linux. To use Tamaas in Windows, use the
Windows subsystem for Linux, then use pip
to install Tamaas, or use the provided Docker images.
What are the units in Tamaas?
All quantities in Tamaas are unitless. To choose a consistent set of units, see Units in Tamaas.
Do contact solvers solve for a total force or an average pressure?
Solvers consider that the argument to the solve()
method is an average
apparent pressure (or average gap in some cases), i.e. the total force divided
by the total system area (in the reference configuration). This means that
doubling the system size and solving for the same argument to the solver
increases the total load by a factor 4 (for a 2D surface).
scons dev
fails to install Tamaas with externally-managed-environment
error
Pip now refuses refuses to install a package outside of virtual environments
(see PEP 668), even with the --user
flag on. This encourages the use of virtual environments, either with venv or virtualenv, which works nicely with scons
dev
.
However, if one really needs an editable installation outside of a virtual
environment, the PIPFLAGS
option can be used to circumvent pip’s protections
(not recommended):
scons dev PIPFLAGS="--user --break-system-packages"
Warning
If misused this can break your system’s Python packages. Use virtual environments instead!
API Reference
Python API
Tamaas root module
A high-performance library for periodic rough surface contact
See __author__, __license__, __copyright__ for extra information about Tamaas.
User documentation: https://tamaas.readthedocs.io
Bug Tracker: https://gitlab.com/tamaas/tamaas/-/issues
Source Code: https://gitlab.com/tamaas/tamaas
Tamaas C++ bindings
Compiled component of Tamaas
- class tamaas._tamaas.AdhesionFunctional
Bases:
Functional
- __init__(*args, **kwargs)
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- property parameters
Parameters dictionary
- setParameters(self: tamaas._tamaas.AdhesionFunctional, arg0: Dict[str, float]) None
- class tamaas._tamaas.AndersonMixing
Bases:
EPICSolver
Fixed-point scheme with fixed memory size and Anderson mixing update to help and accelerate convergence. See doi:10.1006/jcph.1996.0059 for reference.
- __init__(self: tamaas._tamaas.AndersonMixing, contact_solver: tamaas._tamaas.ContactSolver, elasto_plastic_solver: tamaas._tamaas.EPSolver, tolerance: float = 1e-10, memory: int = 5) None
- acceleratedSolve(self: tamaas._tamaas.EPICSolver, normal_pressure: float) float
Solves the EP contact with an accelerated fixed-point scheme. May not converge!
- property max_iter
- property model
- property relaxation
- solve(self: tamaas._tamaas.EPICSolver, normal_pressure: float) float
Solves the EP contact with a relaxed fixed-point scheme. Adjust the relaxation parameter to help convergence.
- property tolerance
- exception tamaas._tamaas.AssertionError
Bases:
AssertionError
- __init__(*args, **kwargs)
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class tamaas._tamaas.BEEngine
Bases:
pybind11_object
- __init__(*args, **kwargs)
- getModel(self: tamaas._tamaas.BEEngine) tamaas::Model
- property model
- registerDirichlet(self: tamaas._tamaas.BEEngine) None
- registerNeumann(self: tamaas._tamaas.BEEngine) None
- solveDirichlet(self: tamaas._tamaas.BEEngine, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
- solveNeumann(self: tamaas._tamaas.BEEngine, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
- class tamaas._tamaas.BeckTeboulle
Bases:
ContactSolver
- __init__(self: tamaas._tamaas.BeckTeboulle, model: tamaas._tamaas.Model, surface: GridBaseWrap<T>, tolerance: float, mu: float) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- computeCost(self: tamaas._tamaas.BeckTeboulle, arg0: bool) float
- property dump_freq
Frequency of displaying solver info
- property functional
- property max_iter
Maximum number of iterations
- property model
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(self: tamaas._tamaas.BeckTeboulle, p0: GridBaseWrap<T>) float
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.Cluster1D
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.Cluster1D) None
- property area
Area of cluster
- property bounding_box
Compute the bounding box of a cluster
- property extent
Compute the extents of a cluster
- getArea(self: tamaas._tamaas.Cluster1D) int
- getPerimeter(self: tamaas._tamaas.Cluster1D) int
- getPoints(self: tamaas._tamaas.Cluster1D) List[List[int[1]]]
- property perimeter
Get perimeter of cluster
- property points
Get list of points of cluster
- class tamaas._tamaas.Cluster2D
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.Cluster2D) None
- property area
Area of cluster
- property bounding_box
Compute the bounding box of a cluster
- property extent
Compute the extents of a cluster
- getArea(self: tamaas._tamaas.Cluster2D) int
- getPerimeter(self: tamaas._tamaas.Cluster2D) int
- getPoints(self: tamaas._tamaas.Cluster2D) List[List[int[2]]]
- property perimeter
Get perimeter of cluster
- property points
Get list of points of cluster
- class tamaas._tamaas.Cluster3D
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.Cluster3D) None
- property area
Area of cluster
- property bounding_box
Compute the bounding box of a cluster
- property extent
Compute the extents of a cluster
- getArea(self: tamaas._tamaas.Cluster3D) int
- getPerimeter(self: tamaas._tamaas.Cluster3D) int
- getPoints(self: tamaas._tamaas.Cluster3D) List[List[int[3]]]
- property perimeter
Get perimeter of cluster
- property points
Get list of points of cluster
- class tamaas._tamaas.Condat
Bases:
ContactSolver
Main solver for frictional contact problems. It has no restraint on the material properties or friction coefficient values, but solves an associated version of the Coulomb friction law, which differs from the traditional Coulomb friction in that the normal and tangential slip components are coupled.
- __init__(self: tamaas._tamaas.Condat, model: tamaas._tamaas.Model, surface: GridBaseWrap<T>, tolerance: float, mu: float) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- computeCost(self: tamaas._tamaas.Condat, arg0: bool) float
- property dump_freq
Frequency of displaying solver info
- property functional
- property max_iter
Maximum number of iterations
- property model
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(self: tamaas._tamaas.Condat, p0: GridBaseWrap<T>, grad_step: float = 0.9) float
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.ContactSolver
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Model, arg1: GridBaseWrap<T>, arg2: float) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- property dump_freq
Frequency of displaying solver info
- property functional
- property max_iter
Maximum number of iterations
- property model
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(*args, **kwargs)
Overloaded function.
solve(self: tamaas._tamaas.ContactSolver, target_force: std::vector<double, std::allocator<double> >) -> float
Solve the contact for a mean traction/gap vector
solve(self: tamaas._tamaas.ContactSolver, target_normal_pressure: float) -> float
Solve the contact for a mean normal pressure/gap
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.EPICSolver
Bases:
pybind11_object
Main solver class for elastic-plastic contact problems
- __init__(self: tamaas._tamaas.EPICSolver, contact_solver: tamaas._tamaas.ContactSolver, elasto_plastic_solver: tamaas._tamaas.EPSolver, tolerance: float = 1e-10, relaxation: float = 0.3) None
- acceleratedSolve(self: tamaas._tamaas.EPICSolver, normal_pressure: float) float
Solves the EP contact with an accelerated fixed-point scheme. May not converge!
- property max_iter
- property model
- property relaxation
- solve(self: tamaas._tamaas.EPICSolver, normal_pressure: float) float
Solves the EP contact with a relaxed fixed-point scheme. Adjust the relaxation parameter to help convergence.
- property tolerance
- class tamaas._tamaas.EPSolver
Bases:
pybind11_object
Mother class for nonlinear plasticity solvers
- __init__(self: tamaas._tamaas.EPSolver, residual: tamaas._tamaas.Residual) None
- beforeSolve(self: tamaas._tamaas.EPSolver) None
- getResidual(self: tamaas._tamaas.EPSolver) tamaas._tamaas.Residual
- getStrainIncrement(self: tamaas._tamaas.EPSolver) GridBaseWrap<T>
- setToleranceManager(self: tamaas._tamaas.EPSolver, arg0: tamaas._tamaas._tolerance_manager) None
- solve(self: tamaas._tamaas.EPSolver) None
- property tolerance
- updateState(self: tamaas._tamaas.EPSolver) None
- class tamaas._tamaas.ElasticFunctionalGap
Bases:
Functional
- __init__(self: tamaas._tamaas.ElasticFunctionalGap, arg0: tamaas::IntegralOperator, arg1: GridBaseWrap<T>) None
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- class tamaas._tamaas.ElasticFunctionalPressure
Bases:
Functional
- __init__(self: tamaas._tamaas.ElasticFunctionalPressure, arg0: tamaas::IntegralOperator, arg1: GridBaseWrap<T>) None
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- class tamaas._tamaas.ExponentialAdhesionFunctional
Bases:
AdhesionFunctional
Potential of the form F = -γ·exp(-g/ρ)
- __init__(self: tamaas._tamaas.ExponentialAdhesionFunctional, surface: GridBaseWrap<T>) None
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- property parameters
Parameters dictionary
- setParameters(self: tamaas._tamaas.AdhesionFunctional, arg0: Dict[str, float]) None
- class tamaas._tamaas.FieldContainer
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.FieldContainer) None
- getField(self: tamaas::Model, field_name: str) GridVariant
- getFields(self: tamaas::Model) List[str]
Return fields list
- registerField(self: tamaas::Model, field_name: str, field: numpy.ndarray[numpy.float64]) None
- class tamaas._tamaas.Filter1D
Bases:
pybind11_object
Mother class for Fourier filter objects
- __init__(self: tamaas._tamaas.Filter1D) None
- computeFilter(self: tamaas._tamaas.Filter1D, arg0: GridWrap<T, dim>) None
Compute the Fourier coefficient of the surface
- class tamaas._tamaas.Filter2D
Bases:
pybind11_object
Mother class for Fourier filter objects
- __init__(self: tamaas._tamaas.Filter2D) None
- computeFilter(self: tamaas._tamaas.Filter2D, arg0: GridWrap<T, dim>) None
Compute the Fourier coefficient of the surface
- exception tamaas._tamaas.FloatingPointError
Bases:
FloatingPointError
- __init__(*args, **kwargs)
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class tamaas._tamaas.FloodFill
Bases:
pybind11_object
- __init__(*args, **kwargs)
- static getClusters(contact: GridWrap<T, dim>, diagonal: bool) List[tamaas._tamaas.Cluster2D]
Return a list of clusters from boolean map
- static getSegments(contact: GridWrap<T, dim>) List[tamaas._tamaas.Cluster1D]
Return a list of segments from boolean map
- static getVolumes(map: GridWrap<T, dim>, diagonal: bool) List[tamaas._tamaas.Cluster3D]
Return a list of volume clusters
- class tamaas._tamaas.Functional
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.Functional) None
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- class tamaas._tamaas.IntegralOperator
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.IntegralOperator, arg0: tamaas._tamaas.Model) None
- apply(self: tamaas._tamaas.IntegralOperator, arg0: numpy.ndarray[numpy.float64], arg1: numpy.ndarray[numpy.float64]) None
- dirac = <kind.dirac: 2>
- dirichlet = <kind.dirichlet: 1>
- getKind(self: tamaas._tamaas.IntegralOperator) tamaas._tamaas.IntegralOperator.kind
- getModel(self: tamaas._tamaas.IntegralOperator) tamaas._tamaas.Model
- getType(self: tamaas._tamaas.IntegralOperator) tamaas._tamaas.model_type
- property kind
- matvec(self: tamaas._tamaas.IntegralOperator, arg0: numpy.ndarray[numpy.float64]) GridBaseWrap<T>
- property model
- neumann = <kind.neumann: 0>
- property shape
- property type
- updateFromModel(self: tamaas._tamaas.IntegralOperator) None
Resets internal persistent variables from the model
- class tamaas._tamaas.Isopowerlaw1D
Bases:
Filter1D
Isotropic powerlaw spectrum with a rolloff plateau
- __init__(self: tamaas._tamaas.Isopowerlaw1D) None
- alpha(self: tamaas._tamaas.Isopowerlaw1D) float
Nayak’s bandwidth parameter
- computeFilter(self: tamaas._tamaas.Filter1D, arg0: GridWrap<T, dim>) None
Compute the Fourier coefficient of the surface
- elasticEnergy(self: tamaas._tamaas.Isopowerlaw1D) float
Computes full contact energy (adimensional)
- property hurst
Hurst exponent
- moments(self: tamaas._tamaas.Isopowerlaw1D) List[float]
Theoretical first 3 moments of spectrum
- property q0
Long wavelength cutoff
- property q1
Rolloff wavelength
- property q2
Short wavelength cutoff
- radialPSDMoment(self: tamaas._tamaas.Isopowerlaw1D, arg0: float) float
Computes ∫ k^q ɸ(k) k dk from 0 to ∞
- rmsHeights(self: tamaas._tamaas.Isopowerlaw1D) float
Theoretical RMS of heights
- rmsSlopes(self: tamaas._tamaas.Isopowerlaw1D) float
Theoretical RMS of slopes
- class tamaas._tamaas.Isopowerlaw2D
Bases:
Filter2D
Isotropic powerlaw spectrum with a rolloff plateau
- __init__(self: tamaas._tamaas.Isopowerlaw2D) None
- alpha(self: tamaas._tamaas.Isopowerlaw2D) float
Nayak’s bandwidth parameter
- computeFilter(self: tamaas._tamaas.Filter2D, arg0: GridWrap<T, dim>) None
Compute the Fourier coefficient of the surface
- elasticEnergy(self: tamaas._tamaas.Isopowerlaw2D) float
Computes full contact energy (adimensional)
- property hurst
Hurst exponent
- moments(self: tamaas._tamaas.Isopowerlaw2D) List[float]
Theoretical first 3 moments of spectrum
- property q0
Long wavelength cutoff
- property q1
Rolloff wavelength
- property q2
Short wavelength cutoff
- radialPSDMoment(self: tamaas._tamaas.Isopowerlaw2D, arg0: float) float
Computes ∫ k^q ɸ(k) k dk from 0 to ∞
- rmsHeights(self: tamaas._tamaas.Isopowerlaw2D) float
Theoretical RMS of heights
- rmsSlopes(self: tamaas._tamaas.Isopowerlaw2D) float
Theoretical RMS of slopes
- class tamaas._tamaas.Kato
Bases:
ContactSolver
- __init__(self: tamaas._tamaas.Kato, model: tamaas._tamaas.Model, surface: GridBaseWrap<T>, tolerance: float, mu: float) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- computeCost(self: tamaas._tamaas.Kato, use_tresca: bool = False) float
- property dump_freq
Frequency of displaying solver info
- property functional
- property max_iter
Maximum number of iterations
- property model
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(self: tamaas._tamaas.Kato, p0: GridBaseWrap<T>, proj_iter: int = 50) float
- solveRegularized(self: tamaas._tamaas.Kato, p0: GridBaseWrap<T>, r: float = 0.01) float
- solveRelaxed(self: tamaas._tamaas.Kato, g0: GridBaseWrap<T>) float
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.KatoSaturated
Bases:
PolonskyKeerRey
Solver for pseudo-plasticity problems where the normal pressure is constrained above by a saturation pressure “pmax”
- __init__(self: tamaas._tamaas.KatoSaturated, model: tamaas._tamaas.Model, surface: GridBaseWrap<T>, tolerance: float, pmax: float) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- computeError(self: tamaas._tamaas.PolonskyKeerRey) float
- property dump_freq
Frequency of displaying solver info
- property functional
- gap = <type.gap: 0>
- property max_iter
Maximum number of iterations
- property model
- property pmax
Saturation normal pressure
- pressure = <type.pressure: 1>
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setIntegralOperator(self: tamaas._tamaas.PolonskyKeerRey, arg0: str) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(*args, **kwargs)
Overloaded function.
solve(self: tamaas._tamaas.ContactSolver, target_force: std::vector<double, std::allocator<double> >) -> float
Solve the contact for a mean traction/gap vector
solve(self: tamaas._tamaas.ContactSolver, target_normal_pressure: float) -> float
Solve the contact for a mean normal pressure/gap
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.LogLevel
Bases:
pybind11_object
Members:
debug
info
warning
error
- __init__(self: tamaas._tamaas.LogLevel, value: int) None
- debug = <LogLevel.debug: 0>
- error = <LogLevel.error: 3>
- info = <LogLevel.info: 1>
- property name
- property value
- warning = <LogLevel.warning: 2>
- class tamaas._tamaas.Logger
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.Logger) None
- get(self: tamaas._tamaas.Logger, arg0: tamaas._tamaas.LogLevel) tamaas._tamaas.Logger
Get a logger object for a log level
- class tamaas._tamaas.MaugisAdhesionFunctional
Bases:
AdhesionFunctional
Cohesive zone potential F = H(g - ρ)·γ/ρ
- __init__(self: tamaas._tamaas.MaugisAdhesionFunctional, surface: GridBaseWrap<T>) None
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- property parameters
Parameters dictionary
- setParameters(self: tamaas._tamaas.AdhesionFunctional, arg0: Dict[str, float]) None
- class tamaas._tamaas.Model
Bases:
FieldContainer
- property E
Young’s modulus
- property E_star
Contact (Hertz) modulus
- __init__(self: tamaas._tamaas.Model, arg0: tamaas._tamaas.model_type, arg1: List[float], arg2: List[int]) None
Create a new model of a given type, physical size and global discretization.
- Parameters
model_type – the type of desired model
system_size – the physical size of the domain in each direction
global_discretization – number of points in each direction
- addDumper(self: tamaas._tamaas.Model, dumper: tamaas::ModelDumper) None
Register a dumper
- applyElasticity(self: tamaas._tamaas.Model, arg0: numpy.ndarray[numpy.float64], arg1: numpy.ndarray[numpy.float64]) None
Apply Hooke’s law
- property be_engine
Boundary element engine
- property boundary_fields
- property boundary_shape
Number of points on boundary
- property boundary_system_size
Physical size of surface
- property displacement
Displacement field
- dump(self: tamaas._tamaas.Model) None
Write model data to registered dumpers
- getBEEngine(self: tamaas._tamaas.Model) tamaas._tamaas.BEEngine
- getBoundaryDiscretization(self: tamaas._tamaas.Model) List[int]
- getBoundarySystemSize(self: tamaas._tamaas.Model) List[float]
- getDiscretization(self: tamaas._tamaas.Model) List[int]
- getDisplacement(self: tamaas._tamaas.Model) GridBaseWrap<T>
- getField(self: tamaas::Model, field_name: str) GridVariant
- getFields(self: tamaas::Model) List[str]
Return fields list
- getHertzModulus(self: tamaas._tamaas.Model) float
- getIntegralOperator(self: tamaas._tamaas.Model, operator_name: str) tamaas::IntegralOperator
- getPoissonRatio(self: tamaas._tamaas.Model) float
- getShearModulus(self: tamaas._tamaas.Model) float
- getSystemSize(self: tamaas._tamaas.Model) List[float]
- getTraction(self: tamaas._tamaas.Model) GridBaseWrap<T>
- getYoungModulus(self: tamaas._tamaas.Model) float
- property global_shape
Global discretization (in MPI environement)
- property mu
Shear modulus
- property nu
Poisson’s ratio
- property operators
Returns a dict-like object allowing access to the model’s integral operators
- registerField(self: tamaas::Model, field_name: str, field: numpy.ndarray[numpy.float64]) None
- setElasticity(self: tamaas._tamaas.Model, E: float, nu: float) None
- setIntegrationMethod(self: tamaas._tamaas.Model, arg0: tamaas::integration_method, arg1: float) None
- property shape
Discretization (local in MPI environment)
- solveDirichlet(self: tamaas._tamaas.Model) None
Solve surface displacemnts -> tractions
- solveNeumann(self: tamaas._tamaas.Model) None
Solve surface tractions -> displacements
- property system_size
Size of physical domain
- property traction
Surface traction field
- property type
- class tamaas._tamaas.ModelDumper
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.ModelDumper) None
- dump(self: tamaas._tamaas.ModelDumper, model: tamaas._tamaas.Model) None
Dump model
- class tamaas._tamaas.ModelFactory
Bases:
pybind11_object
- __init__(*args, **kwargs)
- static createModel(*args, **kwargs)
Overloaded function.
createModel(model_type: tamaas._tamaas.model_type, system_size: List[float], global_discretization: List[int]) -> tamaas._tamaas.Model
Create a new model of a given type, physical size and global discretization.
- Parameters
model_type – the type of desired model
system_size – the physical size of the domain in each direction
global_discretization – number of points in each direction
createModel(model: tamaas._tamaas.Model) -> tamaas._tamaas.Model
Create a deep copy of a model.
- static createResidual(model: tamaas._tamaas.Model, sigma_y: float, hardening: float = 0.0) tamaas::Residual
Create an isotropic linear hardening residual. :param model: the model on which to define the residual :param sigma_y: the (von Mises) yield stress :param hardening: the hardening modulus
- static registerHookeField(model: tamaas._tamaas.Model, name: str) None
Register a HookeField operator
- static registerNonPeriodic(model: tamaas._tamaas.Model, name: str) None
Register non-periodic Boussinesq operator
- static registerVolumeOperators(model: tamaas._tamaas.Model) None
Register Boussinesq and Mindlin operators to model.
- static setIntegrationMethod(operator: tamaas::IntegralOperator, method: tamaas::integration_method, cutoff: float) None
Set the integration method (linear or cutoff) for a volume integral operator
- exception tamaas._tamaas.ModelTypeError
Bases:
TypeError
- __init__(*args, **kwargs)
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception tamaas._tamaas.NotImplementedError
Bases:
NotImplementedError
- __init__(*args, **kwargs)
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class tamaas._tamaas.PolonskyKeerRey
Bases:
ContactSolver
Main solver class for normal elastic contact problems. Its functional can be customized to add an adhesion term, and its primal variable can be set to either the gap or the pressure.
- __init__(self: tamaas._tamaas.PolonskyKeerRey, model: tamaas._tamaas.Model, surface: GridBaseWrap<T>, tolerance: float, primal_type: tamaas._tamaas.PolonskyKeerRey.type = <type.pressure: 1>, constraint_type: tamaas._tamaas.PolonskyKeerRey.type = <type.pressure: 1>) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- computeError(self: tamaas._tamaas.PolonskyKeerRey) float
- property dump_freq
Frequency of displaying solver info
- property functional
- gap = <type.gap: 0>
- property max_iter
Maximum number of iterations
- property model
- pressure = <type.pressure: 1>
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setIntegralOperator(self: tamaas._tamaas.PolonskyKeerRey, arg0: str) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(*args, **kwargs)
Overloaded function.
solve(self: tamaas._tamaas.ContactSolver, target_force: std::vector<double, std::allocator<double> >) -> float
Solve the contact for a mean traction/gap vector
solve(self: tamaas._tamaas.ContactSolver, target_normal_pressure: float) -> float
Solve the contact for a mean normal pressure/gap
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.PolonskyKeerTan
Bases:
ContactSolver
- __init__(self: tamaas._tamaas.PolonskyKeerTan, model: tamaas._tamaas.Model, surface: GridBaseWrap<T>, tolerance: float, mu: float) None
- addFunctionalTerm(self: tamaas._tamaas.ContactSolver, arg0: tamaas._tamaas.Functional) None
Add a term to the contact functional to minimize
- computeCost(self: tamaas._tamaas.PolonskyKeerTan, use_tresca: bool = False) float
- property dump_freq
Frequency of displaying solver info
- property functional
- property max_iter
Maximum number of iterations
- property model
- setDumpFrequency(self: tamaas._tamaas.ContactSolver, dump_freq: int) None
- setMaxIterations(self: tamaas._tamaas.ContactSolver, max_iter: int) None
- solve(self: tamaas._tamaas.PolonskyKeerTan, p0: GridBaseWrap<T>) float
- solveTresca(self: tamaas._tamaas.PolonskyKeerTan, p0: GridBaseWrap<T>) float
- property surface
- property tolerance
Solver tolerance
- class tamaas._tamaas.RegularizedPowerlaw1D
Bases:
Filter1D
Isotropic regularized powerlaw with a plateau extending to the size of the system
- __init__(self: tamaas._tamaas.RegularizedPowerlaw1D) None
- computeFilter(self: tamaas._tamaas.Filter1D, arg0: GridWrap<T, dim>) None
Compute the Fourier coefficient of the surface
- property hurst
Hurst exponent
- property q1
Rolloff wavelength
- property q2
Short wavelength cutoff
- class tamaas._tamaas.RegularizedPowerlaw2D
Bases:
Filter2D
Isotropic regularized powerlaw with a plateau extending to the size of the system
- __init__(self: tamaas._tamaas.RegularizedPowerlaw2D) None
- computeFilter(self: tamaas._tamaas.Filter2D, arg0: GridWrap<T, dim>) None
Compute the Fourier coefficient of the surface
- property hurst
Hurst exponent
- property q1
Rolloff wavelength
- property q2
Short wavelength cutoff
- class tamaas._tamaas.Residual
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.Residual, model: tamaas._tamaas.Model, material: tamaas::Material) None
Create a residual object with a material. Defines the following residual equation:
ɛ - ∇N[σ(ɛ)] - ∇M[t] = 0
Where σ(ɛ) is the eigenstress associated with the constitutive law.
- Parameters
model – the model on which to define the residual
material – material object which defines a constitutive law
- applyTangent(self: tamaas._tamaas.Residual, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>, arg2: GridBaseWrap<T>) None
- computeResidual(self: tamaas._tamaas.Residual, arg0: GridBaseWrap<T>) None
- computeResidualDisplacement(self: tamaas._tamaas.Residual, arg0: GridBaseWrap<T>) None
- getStress(self: tamaas._tamaas.Residual) GridWrap<T, dim>
- getVector(self: tamaas._tamaas.Residual) GridBaseWrap<T>
- property material
- property model
- setIntegrationMethod(self: tamaas._tamaas.Residual, arg0: tamaas::integration_method, arg1: float) None
- updateState(self: tamaas._tamaas.Residual, arg0: GridBaseWrap<T>) None
- property vector
- class tamaas._tamaas.SquaredExponentialAdhesionFunctional
Bases:
AdhesionFunctional
Potential of the form F = -γ·exp(-0.5·(g/ρ)²)
- __init__(self: tamaas._tamaas.SquaredExponentialAdhesionFunctional, surface: GridBaseWrap<T>) None
- computeF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) float
Compute functional value
- computeGradF(self: tamaas._tamaas.Functional, arg0: GridBaseWrap<T>, arg1: GridBaseWrap<T>) None
Compute functional gradient
- property parameters
Parameters dictionary
- setParameters(self: tamaas._tamaas.AdhesionFunctional, arg0: Dict[str, float]) None
- class tamaas._tamaas.Statistics1D
Bases:
pybind11_object
- __init__(*args, **kwargs)
- static computeAutocorrelation(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Compute autocorrelation of surface
- static computeFDRMSSlope(arg0: GridWrap<T, dim>) float
Compute hrms’ with finite differences
- static computeMoments(arg0: GridWrap<T, dim>) List[float]
Compute spectral moments
- static computePowerSpectrum(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Compute PSD of surface
- static computeRMSHeights(arg0: GridWrap<T, dim>) float
Compute hrms
- static computeSpectralRMSSlope(arg0: GridWrap<T, dim>) float
Compute hrms’ in Fourier space
- static contact(tractions: GridWrap<T, dim>, perimeter: int = 0) float
Compute the (corrected) contact area. Permieter is the total contact perimeter in number of segments.
- static graphArea(zdisplacement: GridWrap<T, dim>) float
Compute area defined by function graph.
- class tamaas._tamaas.Statistics2D
Bases:
pybind11_object
- __init__(*args, **kwargs)
- static computeAutocorrelation(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Compute autocorrelation of surface
- static computeFDRMSSlope(arg0: GridWrap<T, dim>) float
Compute hrms’ with finite differences
- static computeMoments(arg0: GridWrap<T, dim>) List[float]
Compute spectral moments
- static computePowerSpectrum(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Compute PSD of surface
- static computeRMSHeights(arg0: GridWrap<T, dim>) float
Compute hrms
- static computeSpectralRMSSlope(arg0: GridWrap<T, dim>) float
Compute hrms’ in Fourier space
- static contact(tractions: GridWrap<T, dim>, perimeter: int = 0) float
Compute the (corrected) contact area. Permieter is the total contact perimeter in number of segments.
- static graphArea(zdisplacement: GridWrap<T, dim>) float
Compute area defined by function graph.
- class tamaas._tamaas.SurfaceGenerator1D
Bases:
pybind11_object
- __init__(*args, **kwargs)
- buildSurface(self: tamaas._tamaas.SurfaceGenerator1D) GridWrap<T, dim>
Generate a surface and return a reference to it
- property random_seed
Random generator seed
- setRandomSeed(self: tamaas._tamaas.SurfaceGenerator1D, arg0: int) None
- setSizes(self: tamaas._tamaas.SurfaceGenerator1D, arg0: List[int[1]]) None
- property shape
Global shape of surfaces
- class tamaas._tamaas.SurfaceGenerator2D
Bases:
pybind11_object
- __init__(*args, **kwargs)
- buildSurface(self: tamaas._tamaas.SurfaceGenerator2D) GridWrap<T, dim>
Generate a surface and return a reference to it
- property random_seed
Random generator seed
- setRandomSeed(self: tamaas._tamaas.SurfaceGenerator2D, arg0: int) None
- setSizes(self: tamaas._tamaas.SurfaceGenerator2D, arg0: List[int[2]]) None
- property shape
Global shape of surfaces
- class tamaas._tamaas.SurfaceGeneratorFilter1D
Bases:
SurfaceGenerator1D
Generates a rough surface with Gaussian noise in the PSD
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: tamaas._tamaas.SurfaceGeneratorFilter1D) -> None
Default constructor
__init__(self: tamaas._tamaas.SurfaceGeneratorFilter1D, arg0: List[int[1]]) -> None
Initialize with global surface shape
- buildSurface(self: tamaas._tamaas.SurfaceGenerator1D) GridWrap<T, dim>
Generate a surface and return a reference to it
- property random_seed
Random generator seed
- setFilter(self: tamaas._tamaas.SurfaceGeneratorFilter1D, filter: tamaas._tamaas.Filter1D) None
Set PSD filter
- setRandomSeed(self: tamaas._tamaas.SurfaceGenerator1D, arg0: int) None
- setSizes(self: tamaas._tamaas.SurfaceGenerator1D, arg0: List[int[1]]) None
- setSpectrum(self: tamaas._tamaas.SurfaceGeneratorFilter1D, filter: tamaas._tamaas.Filter1D) None
Set PSD filter
- property shape
Global shape of surfaces
- property spectrum
Power spectrum object
- class tamaas._tamaas.SurfaceGeneratorFilter2D
Bases:
SurfaceGenerator2D
Generates a rough surface with Gaussian noise in the PSD
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: tamaas._tamaas.SurfaceGeneratorFilter2D) -> None
Default constructor
__init__(self: tamaas._tamaas.SurfaceGeneratorFilter2D, arg0: List[int[2]]) -> None
Initialize with global surface shape
- buildSurface(self: tamaas._tamaas.SurfaceGenerator2D) GridWrap<T, dim>
Generate a surface and return a reference to it
- property random_seed
Random generator seed
- setFilter(self: tamaas._tamaas.SurfaceGeneratorFilter2D, filter: tamaas._tamaas.Filter2D) None
Set PSD filter
- setRandomSeed(self: tamaas._tamaas.SurfaceGenerator2D, arg0: int) None
- setSizes(self: tamaas._tamaas.SurfaceGenerator2D, arg0: List[int[2]]) None
- setSpectrum(self: tamaas._tamaas.SurfaceGeneratorFilter2D, filter: tamaas._tamaas.Filter2D) None
Set PSD filter
- property shape
Global shape of surfaces
- property spectrum
Power spectrum object
- class tamaas._tamaas.SurfaceGeneratorRandomPhase1D
Bases:
SurfaceGeneratorFilter1D
Generates a rough surface with uniformly distributed phases and exact prescribed PSD
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: tamaas._tamaas.SurfaceGeneratorRandomPhase1D) -> None
Default constructor
__init__(self: tamaas._tamaas.SurfaceGeneratorRandomPhase1D, arg0: List[int[1]]) -> None
Initialize with global surface shape
- buildSurface(self: tamaas._tamaas.SurfaceGenerator1D) GridWrap<T, dim>
Generate a surface and return a reference to it
- property random_seed
Random generator seed
- setFilter(self: tamaas._tamaas.SurfaceGeneratorFilter1D, filter: tamaas._tamaas.Filter1D) None
Set PSD filter
- setRandomSeed(self: tamaas._tamaas.SurfaceGenerator1D, arg0: int) None
- setSizes(self: tamaas._tamaas.SurfaceGenerator1D, arg0: List[int[1]]) None
- setSpectrum(self: tamaas._tamaas.SurfaceGeneratorFilter1D, filter: tamaas._tamaas.Filter1D) None
Set PSD filter
- property shape
Global shape of surfaces
- property spectrum
Power spectrum object
- class tamaas._tamaas.SurfaceGeneratorRandomPhase2D
Bases:
SurfaceGeneratorFilter2D
Generates a rough surface with uniformly distributed phases and exact prescribed PSD
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: tamaas._tamaas.SurfaceGeneratorRandomPhase2D) -> None
Default constructor
__init__(self: tamaas._tamaas.SurfaceGeneratorRandomPhase2D, arg0: List[int[2]]) -> None
Initialize with global surface shape
- buildSurface(self: tamaas._tamaas.SurfaceGenerator2D) GridWrap<T, dim>
Generate a surface and return a reference to it
- property random_seed
Random generator seed
- setFilter(self: tamaas._tamaas.SurfaceGeneratorFilter2D, filter: tamaas._tamaas.Filter2D) None
Set PSD filter
- setRandomSeed(self: tamaas._tamaas.SurfaceGenerator2D, arg0: int) None
- setSizes(self: tamaas._tamaas.SurfaceGenerator2D, arg0: List[int[2]]) None
- setSpectrum(self: tamaas._tamaas.SurfaceGeneratorFilter2D, filter: tamaas._tamaas.Filter2D) None
Set PSD filter
- property shape
Global shape of surfaces
- property spectrum
Power spectrum object
- class tamaas._tamaas.TamaasInfo
Bases:
pybind11_object
- __init__(*args, **kwargs)
- backend = 'cpp'
- branch = ''
- build_type = 'release'
- commit = ''
- diff = ''
- has_mpi = False
- remotes = ''
- version = '2.7.0+5.g7767124'
- tamaas._tamaas.finalize() None
- tamaas._tamaas.get_log_level() tamaas._tamaas.LogLevel
- tamaas._tamaas.initialize(num_threads: int = 0) None
Initialize tamaas with desired number of threads. Automatically called upon import of the tamaas module, but can be manually called to set the desired number of threads.
- class tamaas._tamaas.integration_method
Bases:
pybind11_object
Integration method used for the computation of volumetric Fourier operators
Members:
linear : No approximation error, O(N₁·N₂·N₃) time complexity, may cause float overflow/underflow
cutoff : Approximation, O(sqrt(N₁²+N₂²)·N₃²) time complexity, no overflow/underflow risk
- __init__(self: tamaas._tamaas.integration_method, value: int) None
- cutoff = <integration_method.cutoff: 0>
- linear = <integration_method.linear: 1>
- property name
- property value
- class tamaas._tamaas.model_type
Bases:
pybind11_object
Members:
basic_1d : Normal contact with 1D interface
basic_2d : Normal contact with 2D interface
surface_1d : Normal & tangential contact with 1D interface
surface_2d : Normal & tangential contact with 2D interface
volume_1d : Contact with volumetric representation and 1D interface
volume_2d : Contact with volumetric representation and 2D interface
- __init__(self: tamaas._tamaas.model_type, value: int) None
- basic_1d = <model_type.basic_1d: 0>
- basic_2d = <model_type.basic_2d: 1>
- property name
- surface_1d = <model_type.surface_1d: 2>
- surface_2d = <model_type.surface_2d: 3>
- property value
- volume_1d = <model_type.volume_1d: 4>
- volume_2d = <model_type.volume_2d: 5>
- tamaas._tamaas.set_log_level(arg0: tamaas._tamaas.LogLevel) None
- tamaas._tamaas.to_voigt(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Convert a 3D tensor field to voigt notation
- class tamaas._tamaas._DFSANESolver
Bases:
EPSolver
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: tamaas._tamaas._DFSANESolver, residual: tamaas._tamaas.Residual) -> None
__init__(self: tamaas._tamaas._DFSANESolver, residual: tamaas._tamaas.Residual, model: tamaas._tamaas.Model) -> None
- beforeSolve(self: tamaas._tamaas.EPSolver) None
- getResidual(self: tamaas._tamaas.EPSolver) tamaas._tamaas.Residual
- getStrainIncrement(self: tamaas._tamaas.EPSolver) GridBaseWrap<T>
- property max_iter
- setToleranceManager(self: tamaas._tamaas.EPSolver, arg0: tamaas._tamaas._tolerance_manager) None
- solve(self: tamaas._tamaas.EPSolver) None
- property tolerance
- updateState(self: tamaas._tamaas.EPSolver) None
Module defining convenience MPI routines.
- tamaas._tamaas.mpi.gather(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Gather 2D surfaces
- tamaas._tamaas.mpi.global_shape(local_shape: List[int]) List[int]
Gives the global shape of a 1D/2D local shape
- tamaas._tamaas.mpi.local_offset(global_shape: List[int]) int
Gives the local offset of a 1D/2D global shape
- tamaas._tamaas.mpi.local_shape(global_shape: List[int]) List[int]
Gives the local size of a 1D/2D global shape
- tamaas._tamaas.mpi.rank() int
Returns the rank of the local process
- tamaas._tamaas.mpi.scatter(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Scatter 2D surfaces
- class tamaas._tamaas.mpi.sequential
Bases:
pybind11_object
- __init__(self: tamaas._tamaas.mpi.sequential) None
- tamaas._tamaas.mpi.size() int
Returns the number of MPI processes
Module defining basic computations on fields.
- tamaas._tamaas.compute.deviatoric(model_type: tamaas._tamaas.model_type, deviatoric: GridWrap<T, dim>, field: GridWrap<T, dim>) None
Compute the deviatoric part of a tensor field
- tamaas._tamaas.compute.eigenvalues(model_type: tamaas._tamaas.model_type, eigenvalues_out: GridWrap<T, dim>, field: GridWrap<T, dim>) None
Compute eigenvalues of a tensor field
- tamaas._tamaas.compute.from_voigt(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Convert a 3D tensor field to voigt notation
- tamaas._tamaas.compute.to_voigt(arg0: GridWrap<T, dim>) GridWrap<T, dim>
Convert a 3D tensor field to voigt notation
- tamaas._tamaas.compute.von_mises(model_type: tamaas._tamaas.model_type, von_mises: GridWrap<T, dim>, field: GridWrap<T, dim>) None
Compute the Von Mises invariant of a tensor field
Tamaas Dumpers for Model
Dumpers for the class Model
.
- class tamaas.dumpers.JSONDumper(file_descriptor: Union[str, PathLike[str], IOBase])[source]
Bases:
ModelDumper
Dumper to JSON.
- class tamaas.dumpers.FieldDumper(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Bases:
ModelDumper
Abstract dumper for python classes using fields.
- extension = ''
- name_format = '{basename}{postfix}.{extension}'
- __init__(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Construct with desired fields.
- property file_path
Get the default filename.
- class tamaas.dumpers.NumpyDumper(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Bases:
FieldDumper
Dumper to compressed numpy files.
- extension = 'npz'
- classmethod read(file_descriptor: Union[str, PathLike[str], IOBase])[source]
Create model from Numpy file.
- __init__(basename: Union[str, PathLike[str]], *fields, **kwargs)
Construct with desired fields.
- add_field(field: str)
Add another field to the dump.
- property file_path
Get the default filename.
- name_format = '{basename}{postfix}.{extension}'
- classmethod read_sequence(glob_pattern)
Read models from a file sequence.
- class tamaas.dumpers.H5Dumper(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Bases:
FieldDumper
Dumper to HDF5 file format.
- extension = 'h5'
- __init__(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Construct with desired fields.
- classmethod read(file_descriptor: Union[str, PathLike[str], IOBase])[source]
Create model from HDF5 file.
- add_field(field: str)
Add another field to the dump.
- property file_path
Get the default filename.
- name_format = '{basename}{postfix}.{extension}'
- classmethod read_sequence(glob_pattern)
Read models from a file sequence.
- class tamaas.dumpers.UVWDumper(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Bases:
FieldDumper
Dumper to VTK files for elasto-plastic calculations.
- extension = 'vtr'
- __init__(basename: Union[str, PathLike[str]], *fields, **kwargs)
Construct with desired fields.
- add_field(field: str)
Add another field to the dump.
- property file_path
Get the default filename.
- name_format = '{basename}{postfix}.{extension}'
- classmethod read(file_descriptor: Union[str, PathLike[str], IOBase])
Read model from file.
- classmethod read_sequence(glob_pattern)
Read models from a file sequence.
- class tamaas.dumpers.UVWGroupDumper(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Bases:
FieldDumper
Dumper to ParaViewData files.
- extension = 'pvd'
- __init__(basename: Union[str, PathLike[str]], *fields, **kwargs)[source]
Construct with desired fields.
- add_field(field: str)
Add another field to the dump.
- property file_path
Get the default filename.
- name_format = '{basename}{postfix}.{extension}'
- classmethod read(file_descriptor: Union[str, PathLike[str], IOBase])
Read model from file.
- classmethod read_sequence(glob_pattern)
Read models from a file sequence.
Tamaas Nonlinear solvers
Nonlinear solvers for plasticity problems.
Solvers in this module use scipy.optimize
to solve the implicit
non-linear equation for plastic deformations with fixed contact pressures.
- exception tamaas.nonlinear_solvers.NLNoConvergence[source]
Bases:
RuntimeError
Convergence not reached exception.
- __init__(*args, **kwargs)
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class tamaas.nonlinear_solvers.DFSANESolver(residual, model=None, callback=None)[source]
Bases:
ScipySolver
Solve using a spectral residual jacobianless method.
See doi:10.1090/S0025-5718-06-01840-0 for details on method and the relevant Scipy documentation for details on parameters.
- __init__(residual, model=None, callback=None)
Construct nonlinear solver with residual.
- Parameters
residual – plasticity residual object
model – Deprecated
callback – passed on to the Scipy solver
- beforeSolve(self: tamaas._tamaas.EPSolver) None
- getResidual(self: tamaas._tamaas.EPSolver) tamaas._tamaas.Residual
- getStrainIncrement(self: tamaas._tamaas.EPSolver) GridBaseWrap<T>
- reset()
Set solution vector to zero.
- setToleranceManager(self: tamaas._tamaas.EPSolver, arg0: tamaas._tamaas._tolerance_manager) None
- solve()
Solve R(δε) = 0 using a Scipy function.
- property tolerance
- updateState(self: tamaas._tamaas.EPSolver) None
- tamaas.nonlinear_solvers.DFSANECXXSolver
alias of
_DFSANESolver
- class tamaas.nonlinear_solvers.NewtonKrylovSolver(residual, model=None, callback=None)[source]
Bases:
ScipySolver
Solve using a finite-difference Newton-Krylov method.
- __init__(residual, model=None, callback=None)
Construct nonlinear solver with residual.
- Parameters
residual – plasticity residual object
model – Deprecated
callback – passed on to the Scipy solver
- beforeSolve(self: tamaas._tamaas.EPSolver) None
- getResidual(self: tamaas._tamaas.EPSolver) tamaas._tamaas.Residual
- getStrainIncrement(self: tamaas._tamaas.EPSolver) GridBaseWrap<T>
- reset()
Set solution vector to zero.
- setToleranceManager(self: tamaas._tamaas.EPSolver, arg0: tamaas._tamaas._tolerance_manager) None
- solve()
Solve R(δε) = 0 using a Scipy function.
- property tolerance
- updateState(self: tamaas._tamaas.EPSolver) None
Tamaas utilities
Convenience utilities.
- tamaas.utils.log_context(log_level: LogLevel)[source]
Context manager to easily control Tamaas’ logging level.
- tamaas.utils.publications(format_str='{pub.citation}\n\t{pub.doi}')[source]
Print publications associated with objects in use.
- tamaas.utils.load_path(solver: ContactSolver, loads: Iterable[Union[float, ndarray]], verbose: bool = False, callback=None) Iterable[Model] [source]
Generate model objects solutions for a sequence of applied loads.
- Parameters
solver – a contact solver object
loads – an iterable sequence of loads
verbose – print info output of solver
callback – a callback executed after the yield
- tamaas.utils.seeded_surfaces(generator: Union[SurfaceGenerator1D, SurfaceGenerator2D], seeds: Iterable[int]) Iterable[ndarray] [source]
Generate rough surfaces with a prescribed seed sequence.
- Parameters
generator – surface generator object
seeds – random seed sequence
- tamaas.utils.hertz_surface(system_size: Iterable[float], shape: Iterable[int], radius: float) ndarray [source]
Construct a parabolic surface.
- Parameters
system_size – size of the domain in each direction
shape – number of points in each direction
radius – radius of surface
- tamaas.utils.radial_average(x: ndarray, y: ndarray, values: ndarray, r: ndarray, theta: ndarray, method: str = 'linear', endpoint: bool = False) ndarray [source]
Compute the radial average of a 2D field.
Averages radially for specified r values. See
scipy.interpolate.RegularGridInterpolator
for more details.
C++ API
-
template<typename Iterator>
struct acc_range - #include <accumulator.hh>
Range for convenience.
-
template<model_type type, typename Source, typename = std::enable_if_t<is_proxy<Source>::value>>
class Accumulator - #include <accumulator.hh>
Accumulation integral manager.
Public Functions
-
inline Accumulator()
Constructor.
-
inline acc_range<iterator<direction::forward>> forward(std::vector<BufferType> &nvalues, const Grid<Real, trait::boundary_dimension> &wvectors)
Prepare forward loop.
-
inline acc_range<iterator<direction::backward>> backward(std::vector<BufferType> &nvalues, const Grid<Real, trait::boundary_dimension> &wvectors)
Prepare backward loop.
-
inline void reset(std::vector<BufferType> &nvalues, const Grid<Real, trait::boundary_dimension> &wvectors)
-
inline std::vector<BufferType> &nodeValues()
-
inline auto elements()
Create a range over the elements in the mesh.
Private Types
-
using trait = model_type_traits<type>
-
using BufferType = GridHermitian<Real, trait::boundary_dimension>
-
inline Accumulator()
-
class AdhesionFunctional : public tamaas::functional::Functional
- #include <adhesion_functional.hh>
Functional class for adhesion energy.
Subclassed by tamaas::functional::ExponentialAdhesionFunctional, tamaas::functional::MaugisAdhesionFunctional, tamaas::functional::SquaredExponentialAdhesionFunctional
Public Functions
-
class AndersonMixing : public tamaas::EPICSolver
- #include <anderson.hh>
Public Functions
-
AndersonMixing(ContactSolver &csolver, EPSolver &epsolver, Real tolerance = 1e-10, UInt memory = 5)
-
AndersonMixing(ContactSolver &csolver, EPSolver &epsolver, Real tolerance = 1e-10, UInt memory = 5)
-
template<size_t nargs>
struct Apply - #include <apply.hh>
Helper function for application of a functor on a thrust::tuple.
-
template<typename Functor, typename ret_type = void>
class ApplyFunctor - #include <apply.hh>
Helper class for functor application in thrust.
Public Functions
-
inline ApplyFunctor(const ApplyFunctor &o)
-
inline ApplyFunctor(const ApplyFunctor &o)
-
template<typename T>
class arange - #include <loop.hh>
Helper class to count iterations within lambda-loop.
Public Types
Public Functions
-
template<typename T>
struct Array - #include <array.hh>
Generic storage class with wrapping capacities.
-
class BeckTeboulle : public tamaas::Kato
- #include <beck_teboulle.hh>
Public Functions
Private Functions
-
template<model_type type>
Real solveTmpl(GridBase<Real> &g0) Template for solve function.
-
template<model_type type>
-
class BEEngine
- #include <be_engine.hh>
Boundary equation engine class. Solves the Neumann/Dirichlet problem This class should be dimension and model-type agnostic.
Subclassed by tamaas::BEEngineTmpl< type >
Public Functions
-
virtual ~BEEngine() = default
Destructor.
-
virtual void solveNeumann(GridBase<Real> &neumann, GridBase<Real> &dirichlet) const = 0
Solve Neumann problem (expects boundary data)
-
virtual void solveDirichlet(GridBase<Real> &dirichlet, GridBase<Real> &neumann) const = 0
Solve Dirichlet problem (expects boundary data)
-
virtual void registerNeumann() = 0
Register neumann operator.
-
virtual void registerDirichlet() = 0
Register dirichlet operator.
Protected Attributes
-
std::map<IntegralOperator::kind, std::shared_ptr<IntegralOperator>> operators
-
virtual ~BEEngine() = default
-
template<model_type type>
class BEEngineTmpl : public tamaas::BEEngine - #include <be_engine.hh>
Public Functions
-
virtual void solveNeumann(GridBase<Real> &neumann, GridBase<Real> &dirichlet) const override
Solve Neumann problem (expects boundary data)
-
virtual void solveDirichlet(GridBase<Real> &dirichlet, GridBase<Real> &neumann) const override
Solve Dirichlet problem (expects boundary data)
-
virtual void registerNeumann() override
Register neumann operator.
-
virtual void registerDirichlet() override
Register dirichlet operator.
-
virtual void solveNeumann(GridBase<Real> &neumann, GridBase<Real> &dirichlet) const override
-
template<model_type type, UInt derivative>
class Boussinesq : public tamaas::VolumePotential<type> - #include <boussinesq.hh>
Boussinesq tensor.
Public Functions
-
template<UInt dim, UInt derivative_order>
class Boussinesq - #include <influence.hh>
Class for the Boussinesq tensor.
-
template<>
class Boussinesq<3, 0> - #include <influence.hh>
Subclassed by tamaas::influence::Boussinesq< 3, 1 >
-
template<>
class Boussinesq<3, 1> : protected tamaas::influence::Boussinesq<3, 0> - #include <influence.hh>
Boussinesq first gradient.
Public Functions
Protected Types
-
using parent = Boussinesq<3, 0>
-
using parent = Boussinesq<3, 0>
-
template<model_type type, typename boussinesq_t>
struct BoussinesqHelper - #include <boussinesq_helper.hh>
Public Types
-
using trait = model_type_traits<type>
-
using BufferType = GridHermitian<Real, bdim>
-
using source_t = typename KelvinTrait<boussinesq_t>::source_t
-
using out_t = typename KelvinTrait<boussinesq_t>::out_t
Public Functions
-
template<bool apply_q_power>
inline void apply(BufferType &tractions, std::vector<BufferType> &out, const Grid<Real, bdim> &wavevectors, Real domain_size, const boussinesq_t &boussinesq)
-
template<bool apply_q_power>
inline void apply(BufferType &tractions, BufferType &out, UInt layer, const Grid<Real, bdim> &wavevectors, UInt discretization, Real domain_size, const boussinesq_t &boussinesq)
-
inline void makeFundamentalModeGreatAgain(BufferType&, std::vector<BufferType>&, influence::ElasticHelper<dim>&)
-
template<typename ST>
inline void makeFundamentalModeGreatAgain(StaticVector<Complex, ST, dim>&, out_t&, influence::ElasticHelper<dim>&)
Public Static Attributes
-
using trait = model_type_traits<type>
-
template<UInt dim>
class Cluster - #include <flood_fill.hh>
Public Functions
-
Cluster(Point start, const Grid<bool, dim> &map, Grid<bool, dim> &visited, bool diagonal)
Constructor.
-
Cluster() = default
Default constructor.
-
inline const auto &getPoints() const
Get contact points.
Private Types
-
Cluster(Point start, const Grid<bool, dim> &map, Grid<bool, dim> &visited, bool diagonal)
-
struct comm
- #include <mpi_interface.hh>
-
template<class Compute_t>
class ComputeOperator : public tamaas::IntegralOperator Public Functions
-
inline virtual IntegralOperator::kind getKind() const override
Kind.
-
inline virtual model_type getType() const override
Type.
-
inline virtual void updateFromModel() override
Update any data dependent on model parameters.
-
inline virtual IntegralOperator::kind getKind() const override
-
class ContactSolver
- #include <contact_solver.hh>
Subclassed by tamaas::Kato, tamaas::PolonskyKeerRey
Public Functions
-
virtual ~ContactSolver() = default
Destructor.
-
inline auto getMaxIterations() const
Get maximum number of iterations.
-
inline auto getDumpFrequency() const
Get dump_frequency.
Add term to functional.
-
inline const functional::Functional &getFunctional() const
Returns functional object.
Sets functional sum to a single term.
-
virtual ~ContactSolver() = default
-
class CuFFTEngine : public tamaas::FFTEngine
- #include <cufft_engine.hh>
Public Functions
-
inline explicit CuFFTEngine(unsigned int flags = FFTW_ESTIMATE) noexcept
Initialize with flags.
-
inline virtual void forward(const Grid<Real, 1> &real, GridHermitian<Real, 1> &spectral) override
Execute a forward plan on real and spectral 1D.
-
inline virtual void forward(const Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) override
Execute a forward plan on real and spectral 2D.
-
inline virtual void backward(Grid<Real, 1> &real, GridHermitian<Real, 1> &spectral) override
Execute a backward plan on real and spectral 1D.
-
inline virtual void backward(Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) override
Execute a backward plan on real and spectral 2D.
-
inline unsigned int flags() const
Public Static Functions
Protected Attributes
-
unsigned int _flags
FFTW flags.
-
inline explicit CuFFTEngine(unsigned int flags = FFTW_ESTIMATE) noexcept
-
template<bool upper>
struct cutoff_functor - #include <kelvin_helper.hh>
Public Functions
-
inline void operator()(VectorProxy<const Real, bdim> qv, source_t wj0, source_t wj1, out_t out_i) const
-
inline void operator()(VectorProxy<const Real, bdim> qv, source_t wj0, source_t wj1, out_t out_i) const
-
class DCFFT : public tamaas::Westergaard<model_type::basic_2d, IntegralOperator::neumann>
- #include <dcfft.hh>
Non-periodic Boussinesq operator, computed with padded FFT.
Public Functions
Private Types
-
using trait = model_type_traits<model_type::basic_2d>
Private Functions
-
void initInfluence()
Init influence with real-space square patch solution.
-
using trait = model_type_traits<model_type::basic_2d>
-
template<UInt derivative>
struct derivative_traits - #include <volume_potential.hh>
Trait type for component management.
-
template<>
struct derivative_traits<0> - #include <volume_potential.hh>
Public Static Attributes
-
template<model_type type>
static constexpr UInt source_components = model_type_traits<type>::components
-
template<model_type type>
static constexpr UInt out_components = model_type_traits<type>::components
-
template<model_type type>
-
template<>
struct derivative_traits<1> - #include <volume_potential.hh>
Public Static Attributes
-
template<model_type type>
static constexpr UInt source_components = model_type_traits<type>::voigt
-
template<model_type type>
static constexpr UInt out_components = model_type_traits<type>::components
-
template<model_type type>
-
template<>
struct derivative_traits<2> - #include <volume_potential.hh>
Public Static Attributes
-
template<model_type type>
static constexpr UInt source_components = model_type_traits<type>::voigt
-
template<model_type type>
static constexpr UInt out_components = model_type_traits<type>::voigt
-
template<model_type type>
-
struct Deviatoric
- #include <computes.hh>
Compute deviatoric of tensor field.
-
class DFSANESolver : public tamaas::EPSolver
- #include <dfsane_solver.hh>
Derivative-free non-linear solver.
This algorithm is based on W. La Cruz, J. Martínez, and M. Raydan, “Spectral residual method without gradient information for solving large-scale nonlinear systems of equations,” Math. Comp., vol. 75, no. 255, pp. 1429–1448, 2006, doi: 10.1090/S0025-5718-06-01840-0.
The same algorithm is available in scipy.optimize, but this version is robustly parallel by default (i.e. does not depend on BLAS’s parallelism and is future-proof for MPI parallelism).
Public Functions
-
virtual void solve() override
-
TAMAAS_ACCESSOR(max_iterations, UInt, MaxIterations)
Protected Functions
Protected Attributes
-
virtual void solve() override
-
struct Eigenvalues
- #include <computes.hh>
Compute eigenvalues of a symmetric matrix field.
-
class ElasticFunctional : public tamaas::functional::Functional
- #include <elastic_functional.hh>
Generic functional for elastic energy.
Subclassed by tamaas::functional::ElasticFunctionalGap, tamaas::functional::ElasticFunctionalPressure
Public Functions
-
inline ElasticFunctional(const IntegralOperator &op, const GridBase<Real> &surface)
-
inline ElasticFunctional(const IntegralOperator &op, const GridBase<Real> &surface)
-
class ElasticFunctionalGap : public tamaas::functional::ElasticFunctional
- #include <elastic_functional.hh>
Functional with gap as primal field.
Public Functions
-
virtual Real computeF(GridBase<Real> &gap, GridBase<Real> &dual) const override
Compute functional with input gap.
-
virtual void computeGradF(GridBase<Real> &gap, GridBase<Real> &gradient) const override
Compute functional gradient with input gap.
-
inline ElasticFunctional(const IntegralOperator &op, const GridBase<Real> &surface)
-
virtual Real computeF(GridBase<Real> &gap, GridBase<Real> &dual) const override
-
class ElasticFunctionalPressure : public tamaas::functional::ElasticFunctional
- #include <elastic_functional.hh>
Functional with pressure as primal field.
Public Functions
-
virtual Real computeF(GridBase<Real> &pressure, GridBase<Real> &dual) const override
Compute functional with input pressure.
-
virtual void computeGradF(GridBase<Real> &pressure, GridBase<Real> &gradient) const override
Compute functional gradient with input pressure.
-
inline ElasticFunctional(const IntegralOperator &op, const GridBase<Real> &surface)
-
virtual Real computeF(GridBase<Real> &pressure, GridBase<Real> &dual) const override
-
template<UInt dim>
struct ElasticHelper - #include <influence.hh>
Functor to apply Hooke’s tensor.
-
class EPICSolver
- #include <epic.hh>
Subclassed by tamaas::AndersonMixing
Public Functions
-
EPICSolver(ContactSolver &csolver, EPSolver &epsolver, Real tolerance = 1e-10, Real relaxation = 0.3)
Constructor.
-
void fixedPoint(GridBase<Real> &result, const GridBase<Real> &x, const GridBase<Real> &initial_surface, std::vector<Real> load)
-
template<model_type type>
void setViews()
-
TAMAAS_ACCESSOR(relaxation, Real, Relaxation)
-
TAMAAS_ACCESSOR(max_iterations, UInt, MaxIterations)
Protected Attributes
-
ContactSolver &csolver
-
EPICSolver(ContactSolver &csolver, EPSolver &epsolver, Real tolerance = 1e-10, Real relaxation = 0.3)
-
class EPSolver
- #include <ep_solver.hh>
Subclassed by tamaas::DFSANESolver
-
class Exception : public exception
- #include <tamaas.hh>
Generic exception class.
Public Functions
-
inline Exception(std::string mesg)
Constructor.
-
inline const char *what() const noexcept override
-
~Exception() override = default
Private Members
-
std::string msg
message of exception
-
inline Exception(std::string mesg)
-
class ExponentialAdhesionFunctional : public tamaas::functional::AdhesionFunctional
- #include <adhesion_functional.hh>
Exponential adhesion functional.
-
template<UInt interpolation_order>
struct ExponentialElement - #include <element.hh>
-
template<>
struct ExponentialElement<1> - #include <element.hh>
-
class FFTEngine
- #include <fft_engine.hh>
Subclassed by tamaas::CuFFTEngine, tamaas::FFTWEngine
Public Functions
-
virtual ~FFTEngine() noexcept = default
-
virtual void forward(const Grid<Real, 1> &real, GridHermitian<Real, 1> &spectral) = 0
Execute a forward plan on real and spectral 1D.
-
virtual void forward(const Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) = 0
Execute a forward plan on real and spectral 2D.
-
virtual void backward(Grid<Real, 1> &real, GridHermitian<Real, 1> &spectral) = 0
Execute a backward plan on real and spectral 1D.
-
virtual void backward(Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) = 0
Execute a backward plan on real and spectral 2D.
Public Static Functions
-
template<typename T, UInt dim, bool hermitian>
static Grid<T, dim> computeFrequencies(const std::array<UInt, dim> &sizes) Fill a grid with wavevector values in appropriate ordering.
-
template<UInt dim>
static std::vector<std::array<UInt, dim>> realCoefficients(const std::array<UInt, dim> &sizes) Return the grid indices that contain real coefficients (see R2C transform)
-
static std::unique_ptr<FFTEngine> makeEngine(unsigned int flags = FFTW_ESTIMATE)
Instanciate an appropriate FFTEngine subclass.
-
virtual ~FFTEngine() noexcept = default
-
template<typename T>
struct FFTWAllocator - #include <fftw_allocator.hh>
Class allocating SIMD aligned memory
-
class FFTWEngine : public tamaas::FFTEngine
- #include <fftw_engine.hh>
Subclassed by tamaas::FFTWMPIEngine
Public Functions
-
inline explicit FFTWEngine(unsigned int flags = FFTW_ESTIMATE) noexcept
Initialize with flags.
-
inline virtual void forward(const Grid<Real, 1> &real, GridHermitian<Real, 1> &spectral) override
Execute a forward plan on real and spectral 1D.
-
inline virtual void forward(const Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) override
Execute a forward plan on real and spectral 2D.
-
inline virtual void backward(Grid<Real, 1> &real, GridHermitian<Real, 1> &spectral) override
Execute a backward plan on real and spectral 1D.
-
inline virtual void backward(Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) override
Execute a backward plan on real and spectral 2D.
-
inline unsigned int flags() const
Public Static Functions
Protected Types
-
inline explicit FFTWEngine(unsigned int flags = FFTW_ESTIMATE) noexcept
-
class FFTWMPIEngine : public tamaas::FFTWEngine
- #include <fftw_mpi_engine.hh>
Public Functions
-
inline virtual void forward(const Grid<Real, 1>&, GridHermitian<Real, 1>&) override
Execute a forward plan on real and spectral 1D.
-
inline virtual void backward(Grid<Real, 1>&, GridHermitian<Real, 1>&) override
Execute a backward plan on real and spectral 1D.
-
virtual void forward(const Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) override
FFTW/MPI forward (r2c) transform.
-
virtual void backward(Grid<Real, 2> &real, GridHermitian<Real, 2> &spectral) override
FFTW/MPI backward (c2r) transform.
-
inline explicit FFTWEngine(unsigned int flags = FFTW_ESTIMATE) noexcept
Initialize with flags.
Protected Functions
-
plan_t &getPlans(key_t key)
Return the plans pair for a given transform signature.
Protected Attributes
-
inline virtual void forward(const Grid<Real, 1>&, GridHermitian<Real, 1>&) override
-
struct FieldContainer
- #include <field_container.hh>
Subclassed by tamaas::IntegralOperator, tamaas::Model
Public Types
-
using Key = std::string
-
using Value = boost::variant<GridBasePtr<Real>, GridBasePtr<UInt>, GridBasePtr<Int>, GridBasePtr<Complex>, GridBasePtr<bool>>
Public Functions
-
virtual ~FieldContainer() = default
Destructor.
-
template<class T>
inline const auto &field(const Key &name) const Access field of given type (const)
-
inline decltype(auto) fields() const
Return field keys.
-
inline const auto &fields_map() const
Return pointer map to fields.
Return a field with given dimension, create if not in container.
-
template<bool boundary, typename T, typename Container>
inline decltype(auto) request(const Key &name, model_type type, Container &&n, UInt nc) Return a field with given dimension, create if not in container.
-
using Key = std::string
-
template<UInt dim>
class Filter - #include <filter.hh>
Subclassed by tamaas::Isopowerlaw< dim >, tamaas::RegularizedPowerlaw< dim >
Public Functions
-
Filter() = default
Default constructor.
-
virtual ~Filter() = default
Destructor.
-
virtual void computeFilter(GridHermitian<Real, dim> &filter_coefficients) const = 0
Compute Filter coefficients.
Protected Functions
-
template<typename T>
void computeFilter(T &&f, GridHermitian<Real, dim> &filter) const Compute filter coefficients using lambda.
-
Filter() = default
-
class FloodFill
- #include <flood_fill.hh>
-
template<template<typename> class Trait, typename ...T>
struct fold_trait : public tamaas::detail::fold_trait_tail_rec<true, Trait, T...> - #include <tamaas.hh>
-
template<bool acc, template<typename> class Trait, typename Head, typename ...Tail>
struct fold_trait_tail_rec : public std::integral_constant<bool, fold_trait_tail_rec<acc and Trait<Head>::value, Trait, Tail...>::value> - #include <tamaas.hh>
-
template<bool acc, template<typename> class Trait, typename Head>
struct fold_trait_tail_rec<acc, Trait, Head> : public std::integral_constant<bool, acc and Trait<Head>::value> - #include <tamaas.hh>
-
class Functional
- #include <functional.hh>
Generic functional class for the cost function of the optimization problem.
Subclassed by tamaas::functional::AdhesionFunctional, tamaas::functional::ElasticFunctional, tamaas::functional::MetaFunctional
-
template<UInt N, UInt... ns>
struct get : public detail::get_rec<N, ns...> - #include <static_types.hh>
-
template<UInt n, UInt... ns>
struct get_rec<0, n, ns...> : public std::integral_constant<UInt, n> - #include <static_types.hh>
-
template<typename T, UInt dim>
class Grid : public tamaas::GridBase<T> - #include <grid.hh>
Multi-dimensional & multi-component array class.
This class is a container for multi-component data stored on a multi- dimensional grid.
The access function is the parenthesis operator. For a grid of dimension d, the operator takes d+1 arguments: the first d arguments are the position on the grid and the last one is the component of the stored data.
It is also possible to use the access operator with only one argument, it is then considering the grid as a flat array, accessing the given cell of the array.
Public Functions
-
Grid()
Constructor by default (empty array)
-
template<typename RandomAccessIterator>
Grid(RandomAccessIterator begin, RandomAccessIterator end, UInt nb_components) Constructor with shape from iterators.
-
template<typename RandomAccessIterator>
Grid(RandomAccessIterator begin, RandomAccessIterator end, UInt nb_components, span<value_type> data) Construct with shape from iterators on data view.
-
template<typename Container>
inline Grid(Container &&n, UInt nb_components) Constructor with container as shape.
-
template<typename Container>
inline Grid(Container &&n, UInt nb_components, span<value_type> data) Constructor with shape and wrapped data.
-
inline Grid(const std::initializer_list<UInt> &n, UInt nb_components)
Constructor with initializer list.
-
~Grid() override = default
Destructor.
-
template<typename ForwardIt>
void resize(ForwardIt begin, ForwardIt end) Resize array (from iterators)
-
void computeStrides()
Compute strides.
-
virtual void printself(std::ostream &str) const
Print.
-
template<typename ...T1>
inline std::enable_if_t<is_valid_index<T1...>::value, T&> operator()(T1... args) Variadic access operator (non-const)
-
template<typename ...T1>
inline std::enable_if_t<is_valid_index<T1...>::value, const T&> operator()(T1... args) const Variadic access operator.
Protected Attributes
Private Types
-
template<typename ...D>
using is_valid_index = fold_trait<std::is_integral, D...>
Private Functions
-
template<typename Container>
void init(const Container &n, UInt nb_components) Init from standard container.
-
template<typename ...T1>
inline UInt unpackOffset(UInt offset, UInt index_pos, UInt index, T1... rest) const Unpacking the arguments of variadic ()
-
Grid()
-
template<typename T>
class GridBase - #include <grid_base.hh>
Dimension agnostic grid with components stored per points.
Subclassed by tamaas::Grid< T, dim >
Public Types
-
using reference = value_type&
Public Functions
-
GridBase() = default
Constructor by default.
-
virtual ~GridBase() = default
Destructor.
-
inline virtual const_iterator begin(UInt n = 1) const
-
inline virtual const_iterator end(UInt n = 1) const
-
inline decltype(auto) view() const
-
template<typename DT, typename ST, UInt size>
GridBase &operator+=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase &operator-=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase &operator*=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase &operator/=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase &operator=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase<T> &operator+=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase<T> &operator-=(const StaticArray<DT, ST, size> &b)
-
template<typename DT, typename ST, UInt size>
GridBase<T> &operator*=(const StaticArray<DT, ST, size> &b)
-
using reference = value_type&
-
template<typename T, UInt dim>
class GridHermitian : public tamaas::Grid<complex<T>, dim> - #include <grid_hermitian.hh>
Multi-dimensional, multi-component herimitian array.
This class represents an array of hermitian data, meaning it has dimensions of: n1 * n2 * n3 * … * (nx / 2 + 1)
However, it acts as a fully dimensioned array, returning a dummy reference for data outside its real dimension, allowing one to write full (and inefficient) loops without really worrying about the reduced dimension.
It would however be better to just use the true dimensions of the surface for all intents and purposes, as it saves computation time.
Public Functions
-
GridHermitian() = default
-
GridHermitian(const GridHermitian &o) = default
-
GridHermitian(GridHermitian &&o) noexcept = default
Public Static Functions
-
GridHermitian() = default
-
template<template<typename, UInt> class Base, typename T, UInt base_dim, UInt dim>
class GridView : public Base<T, dim> - #include <grid_view.hh>
View type on grid This is a view on a contiguous chunk of data defined by a grid.
Public Types
Public Functions
-
GridView(GridBase<typename Base<T, dim>::value_type> &grid_base, const std::vector<UInt> &multi_index, Int component = -1)
Constructor.
-
~GridView() override = default
Destructor.
-
inline const_iterator begin(UInt = 1) const override
-
inline const_iterator end(UInt = 1) const override
-
GridView(GridBase<typename Base<T, dim>::value_type> &grid_base, const std::vector<UInt> &multi_index, Int component = -1)
-
template<typename T>
struct helper - #include <interface_impl.hh>
Allocation helper for different float types.
-
template<>
struct helper<double> - #include <interface_impl.hh>
-
template<>
struct helper<float> - #include <interface_impl.hh>
-
template<>
struct helper<long double> - #include <interface_impl.hh>
-
template<model_type type>
class Hooke : public tamaas::IntegralOperator - #include <hooke.hh>
Applies Hooke’s law of elasticity.
Subclassed by tamaas::HookeField< type >
Public Functions
-
inline virtual model_type getType() const override
Type of underlying model.
-
inline virtual IntegralOperator::kind getKind() const override
Operator is local in real space.
-
inline virtual void updateFromModel() override
Does not update.
-
inline virtual model_type getType() const override
-
template<UInt dim>
struct HookeFieldHelper Public Functions
Public Members
-
influence::ElasticHelper<dim> elasticity = {0, 0}
-
influence::ElasticHelper<dim> elasticity = {0, 0}
-
class IntegralOperator : public tamaas::FieldContainer
- #include <integral_operator.hh>
Generic class for integral operators.
Subclassed by tamaas::detail::ComputeOperator< Compute_t >, tamaas::Hooke< type >, tamaas::VolumePotential< type >, tamaas::Westergaard< mtype, otype >, tamaas::Westergaard< model_type::basic_2d, IntegralOperator::neumann >
Public Types
Public Functions
-
virtual void apply(GridBase<Real> &input, GridBase<Real> &output) const = 0
Apply operator on input.
-
inline virtual void applyIf(GridBase<Real> &input, GridBase<Real> &output, const std::function<bool(UInt)>&) const
Apply operator on filtered input.
-
inline virtual void updateFromModel()
Update any data dependent on model parameters.
-
virtual model_type getType() const
Type.
-
virtual void apply(GridBase<Real> &input, GridBase<Real> &output) const = 0
-
template<UInt interpolation_order>
class Integrator - #include <integrator.hh>
Public Static Functions
-
template<bool upper, UInt shape>
static inline Real G0(Real q, Real r, Real xc) Standard integral of \(\exp(\pm qy) \phi(y)\) over an element of radius \(r\) and center \(x_c\)
Private Types
-
using element = ExponentialElement<interpolation_order>
-
template<bool upper, UInt shape>
-
template<typename T, UInt dim>
struct Internal - #include <internal.hh>
Public Functions
-
inline void initialize()
Initialize previous field.
-
inline void update()
Update the field previous state.
-
inline void reset()
Reset the current field.
- inline decltype(field) ::element_type & operator* ()
Dereference the field pointer.
- inline const decltype(field) ::element_type & operator* () const
Dereference the field pointer (const version)
Upcast to GridBase pointer.
-
inline void initialize()
-
template<typename T>
struct is_arithmetic : public std::is_arithmetic<T> - #include <static_types.hh>
-
template<typename T>
struct is_arithmetic<thrust::complex<T>> : public true_type - #include <static_types.hh>
-
template<class Type>
struct is_proxy : public false_type - #include <static_types.hh>
-
template<typename T, UInt n, UInt m>
struct is_proxy<MatrixProxy<T, n, m>> : public true_type - #include <static_types.hh>
-
template<typename T, UInt n>
struct is_proxy<SymMatrixProxy<T, n>> : public true_type - #include <static_types.hh>
-
template<template<typename, typename, UInt...> class StaticParent, typename T, UInt... dims>
struct is_proxy<TensorProxy<StaticParent, T, dims...>> : public true_type - #include <static_types.hh>
-
template<typename T, UInt n>
struct is_proxy<VectorProxy<T, n>> : public true_type - #include <static_types.hh>
-
template<typename Container>
struct is_valid_container : public std::is_same<std::remove_cv_t<std::decay_t<Container>::value_type>, std::remove_cv_t<ValueType>> - #include <ranges.hh>
-
template<UInt dim>
class Isopowerlaw : public tamaas::Filter<dim> - #include <isopowerlaw.hh>
Class representing an isotropic power law spectrum.
Public Functions
-
virtual void computeFilter(GridHermitian<Real, dim> &filter_coefficients) const override
Compute filter coefficients.
-
inline Real operator()(const VectorProxy<Real, dim> &q_vec) const
Compute a point of the PSD.
-
virtual void computeFilter(GridHermitian<Real, dim> &filter_coefficients) const override
-
class IsotropicHardening : public tamaas::Material
- #include <isotropic_hardening.hh>
Public Functions
-
void computeInelasticDeformationIncrement(Field &increment, const Field &strain, const Field &strain_increment)
Compute plastic strain increment with radial return algorithm.
-
void computeStress(Field &stress, const Field &strain, const Field &strain_increment) override
Compute stress.
-
void computeEigenStress(Field &stress, const Field &strain, const Field &strain_increment) override
Compute stress due to plastic strain increment.
-
virtual void update() override
Update internal variables.
Public Static Functions
Protected Attributes
Private Types
-
using trait = model_type_traits<type>
-
using Mat = SymMatrixProxy<Real, dim>
-
using CMat = SymMatrixProxy<const Real, dim>
-
void computeInelasticDeformationIncrement(Field &increment, const Field &strain, const Field &strain_increment)
-
template<typename T>
class iterator - #include <iterator.hh>
Subclassed by tamaas::iterator_::iterator_view< T >
Public Types
-
using difference_type = std::ptrdiff_t
-
using iterator_category = thrust::random_access_device_iterator_tag
Public Functions
-
inline iterator(pointer data, difference_type step_size)
constructor
-
template<typename U, typename = std::enable_if_t<std::is_convertible<T, U>::value>>
inline iterator(const iterator<U> &o) copy from a different qualified type
-
template<typename U, typename = std::enable_if_t<std::is_convertible<T, U>::value>>
inline iterator(iterator<U> &&o) move from a different qualified type
-
inline iterator &operator+=(difference_type a)
increment with given offset
-
inline difference_type operator-(const iterator &a) const
needed for OpenMP range calculations
-
inline void setStep(difference_type s)
Friends
- friend class iterator
-
using difference_type = std::ptrdiff_t
-
class iterator : public tamaas::iterator_::iterator<ValueType>
- #include <ranges.hh>
Public Functions
-
template<direction dir>
struct iterator - #include <accumulator.hh>
Forward/Backward iterator for integration passes.
Public Types
-
using integ = Integrator<1>
Public Functions
Protected Functions
-
inline bool setup()
Update index layer and element info.
-
inline void next()
Set current layer and update element index.
Protected Attributes
-
Accumulator &acc
-
using integ = Integrator<1>
-
template<typename T>
class iterator_view : private tamaas::iterator_::iterator<T> - #include <iterator.hh>
Public Types
-
using difference_type = std::ptrdiff_t
Public Functions
-
inline iterator_view(pointer data, std::size_t start, ptrdiff_t offset, std::vector<UInt> strides, std::vector<UInt> sizes)
Constructor.
-
inline iterator_view(const iterator_view &o)
-
inline iterator_view &operator=(const iterator_view &o)
Protected Functions
-
inline void computeAccessOffset()
-
using difference_type = std::ptrdiff_t
-
class Kato : public tamaas::ContactSolver
- #include <kato.hh>
Subclassed by tamaas::BeckTeboulle, tamaas::Condat, tamaas::PolonskyKeerTan
Public Functions
-
Real computeCost(bool use_tresca = false)
Compute cost function.
Compute mean of the field taking each component separately.
-
template<model_type type>
Real solveTmpl(GridBase<Real> &p0, UInt proj_iter) Template for solve function.
-
template<model_type type>
Real solveRelaxedTmpl(GridBase<Real> &g0) Template for solveRelaxed function.
-
template<model_type type>
Real solveRegularizedTmpl(GridBase<Real> &p0, Real r) Template for solveRegularized function.
-
template<model_type type>
void initSurfaceWithComponents() Creates surfaceComp form surface.
-
template<UInt comp>
void enforcePressureConstraints(GridBase<Real> &p0, UInt proj_iter) Project pressure on friction cone.
Projects \(\vec{p}\) on \(\mathcal{C}\) and \(\mathcal{D}\). Projects \(\vec{p}\) on \(\mathcal{C}\) and \(\mathcal{D}\).
-
template<UInt comp>
Vector<Real, comp> computeMean(GridBase<Real> &field) Comupte mean value of field.
Compute mean of the field taking each component separately.
-
template<UInt comp>
void addUniform(GridBase<Real> &field, GridBase<Real> &vec) Add vector to each point of field.
-
template<model_type type>
void computeValuesForCost(GridBase<Real> &lambda, GridBase<Real> &eta, GridBase<Real> &p_N, GridBase<Real> &p_C) Compute grids of dual and primal variables.
Public Static Functions
-
Real computeCost(bool use_tresca = false)
-
class KatoSaturated : public tamaas::PolonskyKeerRey
- #include <kato_saturated.hh>
Polonsky-Keer algorithm with saturation of the pressure.
-
template<UInt dim, UInt derivative_order>
class Kelvin - #include <influence.hh>
Class for the Kelvin tensor.
-
template<model_type type, UInt derivative>
class Kelvin : public tamaas::VolumePotential<type> - #include <kelvin.hh>
Kelvin tensor.
Subclassed by tamaas::Mindlin< type, derivative >
Public Functions
-
void applyIf(GridBase<Real> &source, GridBase<Real> &out, filter_t pred) const override
Apply the Kelvin-tensor_order operator.
-
void setIntegrationMethod(integration_method method, Real cutoff)
Set the integration method for volume operator.
Protected Types
-
using KelvinInfluence = influence::Kelvin<trait::dimension, derivative>
-
using ktrait = detail::KelvinTrait<KelvinInfluence>
Private Types
-
using trait = model_type_traits<type>
-
using dtrait = derivative_traits<derivative>
-
using parent = VolumePotential<type>
Private Functions
-
void linearIntegral(GridBase<Real> &out, KelvinInfluence &kelvin) const
-
void cutoffIntegral(GridBase<Real> &out, KelvinInfluence &kelvin) const
-
void applyIf(GridBase<Real> &source, GridBase<Real> &out, filter_t pred) const override
-
template<>
class Kelvin<3, 0> - #include <influence.hh>
Kelvin base tensor See arXiv:1811.11558 for details.
Subclassed by tamaas::influence::Kelvin< 3, 1 >
-
template<>
class Kelvin<3, 1> : protected tamaas::influence::Kelvin<3, 0> - #include <influence.hh>
Kelvin first derivative.
Subclassed by tamaas::influence::Kelvin< 3, 2 >
Public Functions
Protected Static Attributes
Private Types
-
using parent = Kelvin<3, 0>
-
using parent = Kelvin<3, 0>
-
template<>
class Kelvin<3, 2> : protected tamaas::influence::Kelvin<3, 1> - #include <influence.hh>
Kelvin second derivative.
Public Functions
-
template<bool upper, bool apply_q_power = false, typename ST>
inline Matrix<Complex, dim, dim> applyU0(const VectorProxy<const Real, dim - 1> &q, const StaticMatrix<Complex, ST, dim, dim> &f) const
Private Types
-
using parent = Kelvin<3, 1>
-
template<bool upper, bool apply_q_power = false, typename ST>
-
template<model_type type, typename kelvin_t, typename = typename KelvinTrait<kelvin_t>::source_t>
struct KelvinHelper - #include <kelvin_helper.hh>
Helper to apply integral representation on output.
Public Types
-
using trait = model_type_traits<type>
-
using BufferType = GridHermitian<Real, bdim>
-
using source_t = typename KelvinTrait<kelvin_t>::source_t
-
using out_t = typename KelvinTrait<kelvin_t>::out_t
Public Functions
-
virtual ~KelvinHelper() = default
-
inline void applyIntegral(std::vector<BufferType> &source, std::vector<BufferType> &out, const Grid<Real, bdim> &wavevectors, Real domain_size, const kelvin_t &kelvin)
Apply the regular part of Kelvin to source and sum into output.
This function performs the linear integration algorithm using the accumulator.
-
inline void applyIntegral(std::vector<BufferType> &source, BufferType &out, UInt layer, const Grid<Real, bdim> &wavevectors, Real domain_size, Real cutoff, const kelvin_t &kelvin)
Apply the regular part of Kelvin to source and sum into output.
This function performs the cutoff integration algorithm. Not to be confused with its overload above.
-
inline void applyFreeTerm(std::vector<BufferType> &source, std::vector<BufferType> &out, const kelvin_t &kelvin)
Apply free term of distribution derivative.
-
inline void applyFreeTerm(BufferType&, BufferType&, const kelvin_t&)
Apply free term of distribution derivative (layer)
-
inline void makeFundamentalGreatAgain(std::vector<BufferType> &out)
Making the output free of communist NaN.
-
inline void makeFundamentalGreatAgain(BufferType&)
Making the output free of communist NaN (layer)
-
inline void applyFreeTerm(BufferType &source, BufferType &out, const influence::Kelvin<3, 2> &kelvin)
Applying free term for double gradient of Kelvin.
Public Static Attributes
-
using trait = model_type_traits<type>
-
template<typename T>
struct KelvinTrait - #include <kelvin_helper.hh>
Trait for kelvin local types.
-
template<UInt dim>
struct KelvinTrait<influence::Boussinesq<dim, 0>> - #include <kelvin_helper.hh>
-
template<UInt dim>
struct KelvinTrait<influence::Boussinesq<dim, 1>> - #include <kelvin_helper.hh>
Public Types
-
using source_t = VectorProxy<Complex, dim>
-
using out_t = SymMatrixProxy<Complex, dim>
-
using source_t = VectorProxy<Complex, dim>
-
template<UInt dim>
struct KelvinTrait<influence::Kelvin<dim, 1>> - #include <kelvin_helper.hh>
Public Types
-
using source_t = SymMatrixProxy<Complex, dim>
-
using out_t = VectorProxy<Complex, dim>
-
using source_t = SymMatrixProxy<Complex, dim>
-
template<UInt dim>
struct KelvinTrait<influence::Kelvin<dim, 2>> - #include <kelvin_helper.hh>
Public Types
-
using source_t = SymMatrixProxy<Complex, dim>
-
using out_t = SymMatrixProxy<Complex, dim>
-
using source_t = SymMatrixProxy<Complex, dim>
-
class Logger
- #include <logger.hh>
Logging class Inspired from https://www.drdobbs.com/cpp/logging-in-c/201804215 by Petru Marginean.
Public Functions
-
~Logger() noexcept
Writing to stderr.
-
inline decltype(auto) getWishLevel() const
Get wish log level.
Public Static Functions
-
static inline decltype(auto) getCurrentLevel()
Get current log level.
-
~Logger() noexcept
-
class Loop
- #include <loop.hh>
Singleton class for automated loops using lambdas.
This class is sweet candy :) It provides abstraction of the paralelism paradigm used in loops and allows simple and less error-prone loop syntax, with minimum boiler plate. I love it <3
Public Functions
-
Loop() = delete
Constructor.
Public Static Functions
-
template<typename Functor, typename ...Ranges>
static inline auto loop(Functor &&func, Ranges&&... ranges) -> typename std::enable_if<not is_policy<Functor>::value, void>::type Loop functor over ranges.
-
template<typename DerivedPolicy, typename Functor, typename ...Ranges>
static inline void loop(const thrust::execution_policy<DerivedPolicy> &policy, Functor &&func, Ranges&&... ranges) Loop over ranges with non-default policy.
-
template<operation op = operation::plus, typename Functor, typename ...Ranges>
static inline auto reduce(Functor &&func, Ranges&&... ranges) -> typename std::enable_if<not is_policy<Functor>::value, decltype(func(std::declval<reference_type<Ranges>>()...))>::type Reduce functor over ranges.
-
template<operation op = operation::plus, typename DerivedPolicy, typename Functor, typename ...Ranges>
static inline auto reduce(const thrust::execution_policy<DerivedPolicy> &policy, Functor &&func, Ranges&&... ranges) -> decltype(func(std::declval<reference_type<Ranges>>()...)) Reduce over ranges with non-default policy.
Private Static Functions
-
template<typename DerivedPolicy, typename Functor, typename ...Ranges>
static void loopImpl(const thrust::execution_policy<DerivedPolicy> &policy, Functor &&func, Ranges&&... ranges) Loop over ranges and apply functor.
-
template<operation op, typename DerivedPolicy, typename Functor, typename ...Ranges>
static auto reduceImpl(const thrust::execution_policy<DerivedPolicy> &policy, Functor &&func, Ranges&&... ranges) -> decltype(func(std::declval<reference_type<Ranges>>()...)) Loop over ranges, apply functor and reduce result.
-
Loop() = delete
-
class Material
- #include <material.hh>
Subclassed by tamaas::IsotropicHardening, tamaas::MFrontMaterial
Public Functions
-
virtual ~Material() = default
Destructor.
-
virtual void computeStress(Field &stress, const Field &strain, const Field &strain_increment) = 0
Compute the stress from total strain and strain increment.
-
virtual void computeEigenStress(Field &stress, const Field &strain, const Field &strain_increment) = 0
Compute stress due to inelastic increment.
-
virtual void update() = 0
Update internal variables.
-
virtual ~Material() = default
-
class MaugisAdhesionFunctional : public tamaas::functional::AdhesionFunctional
- #include <adhesion_functional.hh>
Constant adhesion functional.
-
class MetaFunctional : public tamaas::functional::Functional
- #include <meta_functional.hh>
Meta functional that contains list of functionals.
Public Functions
-
virtual Real computeF(GridBase<Real> &variable, GridBase<Real> &dual) const override
Compute functional.
-
virtual void computeGradF(GridBase<Real> &variable, GridBase<Real> &gradient) const override
Compute functional gradient.
Add functional to the list.
-
void clear()
Clears the functional list.
Protected Attributes
-
FunctionalList functionals
Private Types
-
using FunctionalList = std::list<std::shared_ptr<Functional>>
-
virtual Real computeF(GridBase<Real> &variable, GridBase<Real> &dual) const override
-
class MFrontMaterial : public tamaas::Material
- #include <mfront_material.hh>
Private Types
-
using trait = model_type_traits<type>
-
using trait = model_type_traits<type>
-
template<model_type type, UInt derivative>
class Mindlin : public tamaas::Kelvin<type, derivative> - #include <mindlin.hh>
Mindlin tensor.
Public Functions
Protected Functions
Protected Attributes
-
mutable GridHermitian<Real, trait::boundary_dimension> surface_tractions
-
mutable GridHermitian<Real, trait::boundary_dimension> surface_tractions
-
class Model : public tamaas::FieldContainer
- #include <model.hh>
Model containing pressure and displacement This class is a container for the model fields. It is supposed to be dimension agnostic, hence the GridBase members.
Subclassed by tamaas::ModelTemplate< type >
Public Functions
-
virtual model_type getType() const = 0
Get model type.
-
virtual std::vector<UInt> getGlobalDiscretization() const = 0
Get discretization of global MPI system.
-
void applyElasticity(GridBase<Real> &stress, const GridBase<Real> &strain) const
Apply Hooke’s law.
-
void solveNeumann()
Solve Neumann problem using default neumann operator.
-
void solveDirichlet()
Solve Dirichlet problem using default dirichlet operator.
Register a new integral operator.
Register external operator.
-
std::shared_ptr<IntegralOperator> getIntegralOperator(const std::string &name) const
Get a registerd integral operator.
-
std::vector<std::string> getIntegralOperators() const
Get list of integral operators.
-
inline const auto &getIntegralOperatorsMap() const
Get operators mapcar.
-
void updateOperators()
Tell operators to update their cache.
-
virtual void setIntegrationMethod(integration_method method, Real cutoff) = 0
Set integration method for registered volume operators.
-
template<class T>
inline bool isBoundaryField(const GridBase<T> &field) const Determine if a field is defined on boundary.
-
std::vector<std::string> getBoundaryFields() const
Return list of fields defined on boundary.
Set the dumper object.
-
void dump() const
Dump the model.
Protected Functions
Protected Attributes
-
std::unordered_map<std::string, std::shared_ptr<IntegralOperator>> operators
-
std::vector<std::shared_ptr<ModelDumper>> dumpers
-
virtual model_type getType() const = 0
-
template<model_type type>
struct model_type_traits - #include <model_type.hh>
Trait class to store physical dimension of domain, of boundary and number of components
-
template<>
struct model_type_traits<model_type::basic_1d> - #include <model_type.hh>
-
template<>
struct model_type_traits<model_type::basic_2d> - #include <model_type.hh>
-
template<>
struct model_type_traits<model_type::surface_1d> - #include <model_type.hh>
-
template<>
struct model_type_traits<model_type::surface_2d> - #include <model_type.hh>
-
template<>
struct model_type_traits<model_type::volume_1d> - #include <model_type.hh>
-
template<>
struct model_type_traits<model_type::volume_2d> - #include <model_type.hh>
-
class ModelDumper
- #include <model_dumper.hh>
-
class ModelFactory
- #include <model_factory.hh>
Factory class for model.
Public Static Functions
-
static std::unique_ptr<Model> createModel(model_type type, const std::vector<Real> &system_size, const std::vector<UInt> &discretization)
Create new model.
-
static std::unique_ptr<Residual> createResidual(Model &model, Real sigma_y, Real hardening)
Create a plasticity residual.
-
static void setIntegrationMethod(IntegralOperator &op, integration_method method, Real cutoff)
Set integration method for a volume integral operator.
-
static std::unique_ptr<Model> createModel(model_type type, const std::vector<Real> &system_size, const std::vector<UInt> &discretization)
-
template<model_type type>
class ModelTemplate : public tamaas::Model - #include <model_template.hh>
Model class templated with model type Specializations of this class should take care of dimension specific code.
Public Functions
-
inline virtual model_type getType() const override
Get model type.
-
virtual std::vector<UInt> getGlobalDiscretization() const override
Get discretization of global MPI system.
-
virtual std::vector<Real> getBoundarySystemSize() const override
Get boundary system physical size.
-
virtual void setIntegrationMethod(integration_method method, Real cutoff) override
Set integration method for registered volume operators.
Protected Functions
-
void initializeBEEngine()
Protected Attributes
Private Types
-
using trait = model_type_traits<type>
-
inline virtual model_type getType() const override
-
template<UInt dim>
struct Partitioner - #include <partitioner.hh>
Public Static Functions
-
struct plan
- #include <cufft_engine.hh>
Public Functions
-
plan() = default
-
inline ~plan() noexcept
Destroy plan.
-
inline operator cufftHandle() const
For seamless use with fftw api.
Public Members
-
cufftHandle _plan
-
plan() = default
-
template<typename T>
struct plan - #include <interface_impl.hh>
Holder type for fftw plans.
Public Functions
-
inline ~plan() noexcept
Destroy plan.
-
inline ~plan() noexcept
-
class PolonskyKeerRey : public tamaas::ContactSolver
- #include <polonsky_keer_rey.hh>
Subclassed by tamaas::KatoSaturated
Public Types
Public Functions
-
PolonskyKeerRey(Model &model, const GridBase<Real> &surface, Real tolerance, type variable_type, type constraint_type)
Constructor.
-
~PolonskyKeerRey() override = default
-
virtual Real meanOnUnsaturated(const GridBase<Real> &field) const
Mean on unsaturated constraint zone.
Computes \( \frac{1}{\mathrm{card}(\{p > 0\})} \sum_{\{p > 0\}}{f_i} \)
-
virtual Real computeSquaredNorm(const GridBase<Real> &field) const
Compute squared norm.
Computes \( \sum_{\{p > 0\}}{f_i^2} \)
-
virtual void updateSearchDirection(Real factor)
Update search direction.
Do \(\mathbf{t} = \mathbf{q}' + \delta \frac{R}{R_\mathrm{old}}\mathbf{t} \)
-
virtual Real computeCriticalStep(Real target = 0)
Compute critical step.
Computes \( \tau = \frac{ \sum_{\{p > 0\}}{q_i't_i} }{ \sum_{\{p > 0\}}{r_i' t_i} } \)
-
virtual bool updatePrimal(Real step)
Update primal and check non-admissible state.
Update steps:
\(\mathbf{p} = \mathbf{p} - \tau \mathbf{t} \)
Truncate all \(p\) negative
For all points in \(I_\mathrm{na} = \{p = 0 \land q < 0 \}\) do \(p_i = p_i - \tau q_i\)
-
virtual Real computeError() const
Compute error/stopping criterion.
Error is based on \( \sum{p_i q_i} \)
-
virtual void enforceAdmissibleState()
Enforce contact constraints on final state.
-
void setIntegralOperator(std::string name)
Set integral operator for gradient computation.
-
void setupFunctional()
Set functionals for contact.
Protected Attributes
-
model_type operation_type
-
std::unique_ptr<GridBase<Real>> projected_search_direction = nullptr
Projected CG search direction.
-
std::shared_ptr<IntegralOperator> integral_op = nullptr
Integral operator for gradient computation.
Private Functions
-
template<model_type type>
void setViews() Set correct views on normal traction and gap.
-
template<model_type type>
void defaultOperator() Set the default integral operator.
-
PolonskyKeerRey(Model &model, const GridBase<Real> &surface, Real tolerance, type variable_type, type constraint_type)
-
class PolonskyKeerTan : public tamaas::Kato
- #include <polonsky_keer_tan.hh>
-
template<UInt... ns>
struct product : public detail::product_tail_rec<1, ns...> - #include <static_types.hh>
-
template<UInt acc, UInt n>
struct product_tail_rec<acc, n> : public std::integral_constant<UInt, acc * n> - #include <static_types.hh>
-
template<typename T>
struct ptr - #include <interface_impl.hh>
RAII helper for fftw_free.
-
template<typename LocalType, typename ValueType, UInt local_size>
class Range - #include <ranges.hh>
Range class for complex iterators.
-
template<operation op, typename ReturnType>
struct reduction_helper - #include <loop_utils.hh>
-
template<typename ReturnType>
struct reduction_helper<operation::max, ReturnType> : public thrust::maximum<ReturnType> - #include <loop_utils.hh>
Public Functions
-
inline ReturnType init() const
-
inline ReturnType init() const
-
template<typename ReturnType>
struct reduction_helper<operation::min, ReturnType> : public thrust::minimum<ReturnType> - #include <loop_utils.hh>
Public Functions
-
inline ReturnType init() const
-
inline ReturnType init() const
-
template<typename ReturnType>
struct reduction_helper<operation::plus, ReturnType> : public thrust::plus<ReturnType> - #include <loop_utils.hh>
Public Functions
-
inline ReturnType init() const
-
inline ReturnType init() const
-
template<typename ReturnType>
struct reduction_helper<operation::times, ReturnType> : public thrust::multiplies<ReturnType> - #include <loop_utils.hh>
Public Functions
-
inline ReturnType init() const
-
inline ReturnType init() const
-
template<UInt dim>
class RegularizedPowerlaw : public tamaas::Filter<dim> - #include <regularized_powerlaw.hh>
Class representing an isotropic power law spectrum.
Public Functions
-
virtual void computeFilter(GridHermitian<Real, dim> &filter_coefficients) const override
Compute filter coefficients.
-
inline Real operator()(const VectorProxy<Real, dim> &q_vec) const
Compute a point of the PSD.
-
virtual void computeFilter(GridHermitian<Real, dim> &filter_coefficients) const override
-
class Residual
- #include <residual.hh>
Residual manager.
Public Functions
Constructor.
-
virtual ~Residual() = default
Destructor.
-
virtual void computeResidual(GridBase<Real> &strain_increment)
Compute the residual vector for a given strain increment.
-
virtual void computeResidualDisplacement(GridBase<Real> &strain_increment)
Compute residual surface displacement.
Protected Attributes
Private Functions
-
inline const IntegralOperator &integralOperator(const std::string &name) const
Convenience function.
Private Static Attributes
-
static constexpr auto type = model_type::volume_2d
-
static constexpr auto dim = model_type_traits<type>::dimension
-
static constexpr auto voigt = model_type_traits<type>::voigt
-
struct sequential
- #include <mpi_interface.hh>
-
struct sequential_guard
- #include <mpi_interface.hh>
-
template<typename T>
struct span - #include <span.hh>
Public Functions
-
inline const_reference operator[](size_type idx) const
-
inline const_reference operator[](size_type idx) const
-
class SquaredExponentialAdhesionFunctional : public tamaas::functional::AdhesionFunctional
- #include <adhesion_functional.hh>
Squared exponential adhesion functional.
-
template<template<typename, typename, UInt...> class StaticParent, UInt... dims>
struct static_size_helper : public tamaas::product<dims...> - #include <static_types.hh>
-
template<UInt n>
struct static_size_helper<StaticSymMatrix, n> : public tamaas::voigt_size<n> - #include <static_types.hh>
-
template<typename DataType, typename SupportType, UInt _size>
class StaticArray - #include <static_types.hh>
Static Array.
This class is meant to be a small and fast object for intermediate calculations, possibly on wrapped memory belonging to a grid. Support type show be either a pointer or a C array. It should not contain any virtual method.
Public Functions
-
StaticArray() = default
-
~StaticArray() = default
-
StaticArray(const StaticArray&) = delete
-
StaticArray(StaticArray&&) = delete
-
StaticArray &operator=(StaticArray&&) = delete
-
template<typename DT, typename ST>
inline auto dot(const StaticArray<DT, ST, size> &o) const -> T_bare Scalar product.
- template<typename DT, typename ST> inline __host__ void operator+= (const StaticArray< DT, ST, size > &o)
- template<typename DT, typename ST> inline __host__ void operator-= (const StaticArray< DT, ST, size > &o)
- template<typename DT, typename ST> inline __host__ void operator*= (const StaticArray< DT, ST, size > &o)
- template<typename DT, typename ST> inline __host__ void operator/= (const StaticArray< DT, ST, size > &o)
- template<typename T1> inline __host__ std::enable_if_t< is_arithmetic< T1 >::value, StaticArray & > operator+= (const T1 &x)
- template<typename T1> inline __host__ std::enable_if_t< is_arithmetic< T1 >::value, StaticArray & > operator-= (const T1 &x)
- template<typename T1> inline __host__ std::enable_if_t< is_arithmetic< T1 >::value, StaticArray & > operator*= (const T1 &x)
- template<typename T1> inline __host__ std::enable_if_t< is_arithmetic< T1 >::value, StaticArray & > operator/= (const T1 &x)
- template<typename T1> inline __host__ std::enable_if_t< is_arithmetic< T1 >::value, StaticArray & > operator= (const T1 &x)
-
inline StaticArray &operator=(const StaticArray &o)
Overriding the implicit copy operator.
-
template<typename DT, typename ST>
inline void operator=(const StaticArray<DT, ST, size> &o)
-
template<typename DT, typename ST>
inline StaticArray ©(const StaticArray<DT, ST, size> &o)
-
inline valid_size_t<T&> front()
-
inline valid_size_t<const T&> front() const
-
inline valid_size_t<T&> back()
-
inline valid_size_t<const T&> back() const
Protected Attributes
-
SupportType _mem
-
StaticArray() = default
-
template<typename DataType, typename SupportType, UInt n, UInt m>
class StaticMatrix : public tamaas::StaticTensor<DataType, SupportType, n, m> - #include <static_types.hh>
Public Functions
-
template<typename DT, typename ST>
std::enable_if_t<n == m> fromSymmetric(const StaticSymMatrix<DT, ST, n> &o)
-
template<typename DT1, typename ST1, typename DT2, typename ST2>
void outer(const StaticVector<DT1, ST1, n> &a, const StaticVector<DT2, ST2, m> &b) Outer product of two vectors.
-
template<typename DT, typename ST>
-
template<typename DataType, typename SupportType, UInt n>
class StaticSymMatrix - #include <static_types.hh>
Symmetric matrix in Voigt notation.
Public Functions
-
template<typename DT, typename ST>
inline void symmetrize(const StaticMatrix<DT, ST, n, n> &m) Copy values from matrix and symmetrize.
-
template<typename DT, typename ST>
inline void operator+=(const StaticMatrix<DT, ST, n, n> &m) Add values from symmetrized matrix.
-
inline auto trace() const
Private Types
-
using parent = StaticVector<DataType, SupportType, voigt_size<n>::value>
-
template<typename DT, typename ST>
-
template<typename DataType, typename SupportType = DataType*, UInt... dims>
class StaticTensor : public tamaas::StaticArray<DataType, DataType*, product<dims...>::value> - #include <static_types.hh>
Static Tensor.
This class implements a multi-dimensional tensor behavior.
Public Functions
Private Types
-
using parent = StaticArray<DataType, SupportType, product<dims...>::value>
-
using parent = StaticArray<DataType, SupportType, product<dims...>::value>
-
template<typename DataType, typename SupportType, UInt n>
class StaticVector - #include <static_types.hh>
Vector class with size determined at compile-time.
Public Functions
-
template<UInt dim>
struct Statistics - #include <statistics.hh>
Suitcase class for all statistics related functions.
Public Types
-
using PVector = VectorProxy<Real, dim>
Public Functions
-
using PVector = VectorProxy<Real, dim>
-
template<UInt dim>
class SurfaceGenerator - #include <surface_generator.hh>
Class generating random surfaces.
Subclassed by tamaas::SurfaceGeneratorFilter< dim >
-
template<UInt dim>
class SurfaceGeneratorFilter : public tamaas::SurfaceGenerator<dim> - #include <surface_generator_filter.hh>
Subclassed by tamaas::SurfaceGeneratorRandomPhase< dim >
Public Functions
-
virtual Grid<Real, dim> &buildSurface() override
Construct with surface size.
Build surface with Hu & Tonder algorithm
Set filter object.
Set spectrum.
-
virtual Grid<Real, dim> &buildSurface() override
-
template<UInt dim>
class SurfaceGeneratorRandomPhase : public tamaas::SurfaceGeneratorFilter<dim> - #include <surface_generator_random_phase.hh>
-
template<model_type type>
struct SurfaceTractionHelper - #include <kelvin_helper.hh>
Public Types
-
using trait = model_type_traits<type>
-
using BufferType = GridHermitian<Real, bdim>
-
using source_t = typename KelvinTrait<kelvin_t>::source_t
-
using out_t = typename KelvinTrait<kelvin_t>::out_t
Public Functions
-
template<bool apply_q_power>
inline void computeSurfaceTractions(std::vector<BufferType> &source, BufferType &tractions, const Grid<Real, bdim> &wavevectors, Real domain_size, const kelvin_t &kelvin, const influence::ElasticHelper<dim> &el) Compute surface tractions due to eigenstress distribution.
Public Static Attributes
-
using trait = model_type_traits<type>
-
template<UInt dim>
struct SymHookeFieldHelper Public Functions
-
inline void operator()(SymMatrixProxy<Real, dim> sigma, SymMatrixProxy<const Real, dim> epsilon, const Real &mu, const Real &nu)
Public Members
-
influence::ElasticHelper<dim> elasticity = {0, 0}
-
inline void operator()(SymMatrixProxy<Real, dim> sigma, SymMatrixProxy<const Real, dim> epsilon, const Real &mu, const Real &nu)
-
struct TamaasInfo
- #include <tamaas_info.hh>
-
template<template<typename, typename, UInt...> class StaticParent, typename T, UInt... dims>
class Tensor : public StaticParent<T, T[static_size_helper<StaticParent, dims...>::value], dims...> - #include <static_types.hh>
Public Functions
-
Tensor() = default
Default constructor.
-
template<typename DT, typename ST>
inline Tensor(const StaticParent<DT, ST, dims...> &o) Construct by copy from static tensor.
Private Static Attributes
-
static constexpr UInt size = static_size_helper<StaticParent, dims...>::value
-
Tensor() = default
-
template<template<typename, typename, UInt...> class StaticParent, typename T, UInt... dims>
class TensorProxy : public StaticParent<T, T*, dims...> - #include <static_types.hh>
Proxy type for tensor.
Public Types
-
using stack_type = Tensor<StaticParent, T, dims...>
Public Functions
-
template<typename DataType, typename SupportType>
inline TensorProxy(StaticParent<DataType, SupportType, dims...> &o) Construction from static tensor.
-
inline TensorProxy(const TensorProxy &o)
-
inline TensorProxy &operator=(const TensorProxy &o)
-
inline TensorProxy(TensorProxy &&o) noexcept
Private Types
-
using parent = StaticParent<T, T*, dims...>
-
using stack_type = Tensor<StaticParent, T, dims...>
-
struct ToleranceManager
- #include <ep_solver.hh>
-
template<typename Iterator, typename Functor, typename Value>
class transform_iterator : public thrust::iterator_adaptor<transform_iterator<Iterator, Functor, Value>, Iterator, Value, thrust::use_default, thrust::use_default, Value> - #include <loop.hh>
Replacement for thrust::transform_iterator which copies values.
Public Types
Friends
- friend class thrust::iterator_core_access
-
template<typename T>
struct UnifiedAllocator - #include <unified_allocator.hh>
Class allocating unified memory
-
template<UInt dim>
struct voigt_size - #include <static_types.hh>
-
template<>
struct voigt_size<1> : public std::integral_constant<UInt, 1> - #include <static_types.hh>
-
template<>
struct voigt_size<2> : public std::integral_constant<UInt, 3> - #include <static_types.hh>
-
template<>
struct voigt_size<3> : public std::integral_constant<UInt, 6> - #include <static_types.hh>
-
template<model_type type>
class VolumePotential : public tamaas::IntegralOperator - #include <volume_potential.hh>
Volume potential operator class. Applies the operators for computation of displacements and strains due to residual/eigen strains.
Subclassed by tamaas::Boussinesq< type, derivative >, tamaas::Kelvin< type, derivative >
Public Functions
-
inline virtual void updateFromModel() override
Update from model (does nothing)
-
inline virtual IntegralOperator::kind getKind() const override
Kind.
-
virtual model_type getType() const override
Type.
Protected Types
-
using BufferType = GridHermitian<Real, trait::boundary_dimension>
Protected Functions
Protected Attributes
-
mutable std::vector<BufferType> source_buffer
-
mutable std::vector<BufferType> out_buffer
Private Types
-
using trait = model_type_traits<type>
-
inline virtual void updateFromModel() override
-
struct VonMises
- #include <computes.hh>
Compute von Mises stress on a tensor field.
-
template<model_type mtype, IntegralOperator::kind otype>
class Westergaard : public tamaas::IntegralOperator - #include <westergaard.hh>
Operator based on Westergaard solution and the Dicrete Fourier Transform. This class is templated with model type to allow efficient storage of the influence coefficients. The integral operator is only applied to surface pressure/displacements, even for volume models.
Public Functions
-
inline const GridHermitian<Real, bdim> &getInfluence() const
Get influence coefficients.
-
virtual void apply(GridBase<Real> &input, GridBase<Real> &output) const override
Apply influence coefficients to input.
-
inline virtual void updateFromModel() override
Update the influence coefficients.
-
inline virtual IntegralOperator::kind getKind() const override
Kind.
-
inline virtual model_type getType() const override
Type.
-
void initInfluence()
Initialize influence coefficients.
Public Members
-
std::shared_ptr<GridHermitian<Real, bdim>> influence
-
mutable GridHermitian<Real, bdim> buffer
Private Types
-
using trait = model_type_traits<mtype>
-
inline const GridHermitian<Real, bdim> &getInfluence() const
-
namespace cufft
-
namespace fftw
-
namespace fftw_impl
Functions
-
inline auto init_threads()
Init FFTW with threads.
-
inline auto plan_with_nthreads(int nthreads)
Set number of threads.
-
inline auto cleanup_threads()
Cleanup threads.
-
inline auto plan_many_forward(int rank, const int *n, int howmany, double *in, const int *inembed, int istride, int idist, fftw_complex *out, const int *onembed, int ostride, int odist, unsigned flags)
-
inline auto plan_many_backward(int rank, const int *n, int howmany, fftw_complex *in, const int *inembed, int istride, int idist, double *out, const int *onembed, int ostride, int odist, unsigned flags)
-
inline auto plan_1d_forward(int n, double *in, fftw_complex *out, unsigned flags)
-
inline auto plan_1d_backward(int n, fftw_complex *in, double *out, unsigned flags)
-
inline auto plan_2d_forward(int n0, int n1, double *in, fftw_complex *out, unsigned flags)
-
inline auto plan_2d_backward(int n0, int n1, fftw_complex *out, double *in, unsigned flags)
-
inline auto execute(fftw_plan plan)
-
inline auto execute(fftw_plan plan, double *in, fftw_complex *out)
-
inline auto execute(fftw_plan plan, fftw_complex *in, double *out)
-
inline auto destroy(fftw_plan plan)
-
inline auto plan_many_forward(int rank, const int *n, int howmany, long double *in, const int *inembed, int istride, int idist, fftwl_complex *out, const int *onembed, int ostride, int odist, unsigned flags)
-
inline auto plan_many_backward(int rank, const int *n, int howmany, fftwl_complex *in, const int *inembed, int istride, int idist, long double *out, const int *onembed, int ostride, int odist, unsigned flags)
-
inline auto plan_1d_forward(int n, long double *in, fftwl_complex *out, unsigned flags)
-
inline auto plan_1d_backward(int n, fftwl_complex *in, long double *out, unsigned flags)
-
inline auto plan_2d_forward(int n0, int n1, long double *in, fftwl_complex *out, unsigned flags)
-
inline auto plan_2d_backward(int n0, int n1, fftwl_complex *out, long double *in, unsigned flags)
-
inline auto execute(fftwl_plan plan)
-
inline auto execute(fftwl_plan plan, long double *in, fftwl_complex *out)
-
inline auto execute(fftwl_plan plan, fftwl_complex *in, long double *out)
-
inline auto destroy(fftwl_plan plan)
-
inline auto plan_many_forward(int rank, const int *n, int howmany, float *in, const int *inembed, int istride, int idist, fftwf_complex *out, const int *onembed, int ostride, int odist, unsigned flags)
-
inline auto plan_many_backward(int rank, const int *n, int howmany, fftwf_complex *in, const int *inembed, int istride, int idist, float *out, const int *onembed, int ostride, int odist, unsigned flags)
-
inline auto plan_1d_forward(int n, float *in, fftwf_complex *out, unsigned flags)
-
inline auto plan_1d_backward(int n, fftwf_complex *in, float *out, unsigned flags)
-
inline auto plan_2d_forward(int n0, int n1, float *in, fftwf_complex *out, unsigned flags)
-
inline auto plan_2d_backward(int n0, int n1, fftwf_complex *out, float *in, unsigned flags)
-
inline auto execute(fftwf_plan plan)
-
inline auto execute(fftwf_plan plan, float *in, fftwf_complex *out)
-
inline auto execute(fftwf_plan plan, fftwf_complex *in, float *out)
-
inline auto destroy(fftwf_plan plan)
-
inline auto init_threads()
-
namespace mpi_dummy
-
namespace tamaas
Typedefs
-
template<typename T>
using Allocator = FFTWAllocator<T>
-
template<typename T, UInt n, UInt m>
using MatrixProxy = TensorProxy<StaticMatrix, T, n, m>
-
template<typename T, UInt n>
using SymMatrixProxy = TensorProxy<StaticSymMatrix, T, n>
-
template<typename T, UInt n>
using VectorProxy = TensorProxy<StaticVector, T, n>
-
using Real = double
default floating point type
-
using Int = int
default signed integer type
-
using random_engine = ::thrust::random::default_random_engine
Enums
-
enum class LogLevel
Log levels enumeration.
Values:
-
enumerator debug
-
enumerator info
-
enumerator warning
-
enumerator error
-
enumerator debug
-
enum class operation
Enumeration of reduction operations.
Values:
-
enumerator plus
-
enumerator times
-
enumerator min
-
enumerator max
-
enumerator plus
-
enum class integration_method
Integration method enumeration.
Values:
-
enumerator cutoff
-
enumerator linear
-
enumerator cutoff
-
enum class model_type
Types for grid dimensions and number of components.
Values:
-
enumerator basic_1d
one component line
-
enumerator basic_2d
one component surface
-
enumerator surface_1d
two components line
-
enumerator surface_2d
three components surface
-
enumerator volume_1d
two components volume
-
enumerator volume_2d
three components volume
-
enumerator basic_1d
Functions
-
template<typename Compute>
void applyCompute(model_type type, GridBase<Real> &result, const GridBase<Real> &field)
-
template<typename T, UInt dim>
inline std::ostream &operator<<(std::ostream &stream, const Grid<T, dim> &_this)
-
template<template<typename, UInt> class Base, typename T, UInt base_dim, typename ...Args>
GridView<Base, T, base_dim, base_dim - sizeof...(Args)> make_view(Base<T, base_dim> &base, Args... indices)
-
template<template<typename, UInt> class Base, typename T, UInt base_dim>
GridView<Base, T, base_dim, base_dim> make_component_view(Base<T, base_dim> &base, UInt component)
-
template<typename LocalType, class Container>
std::enable_if_t<is_proxy<LocalType>::value, Range<LocalType, typename LocalType::value_type, LocalType::size>> range(Container &&cont) Make range with proxy type.
-
template<typename LocalType, class Container>
std::enable_if_t<not is_proxy<LocalType>::value, Range<LocalType, LocalType, 1>> range(Container &&cont) Make range with standard type.
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt dim>
Vector<decltype(DT1(0) + DT2(0)), dim> operator+(const StaticVector<DT1, ST1, dim> &a, const StaticVector<DT2, ST2, dim> &b)
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt dim>
Vector<decltype(DT1(0) - DT2(0)), dim> operator-(const StaticVector<DT1, ST1, dim> &a, const StaticVector<DT2, ST2, dim> &b)
-
template<typename DT1, typename ST1, UInt dim>
Vector<decltype(DT1(0)), dim> operator-(const StaticVector<DT1, ST1, dim> &a)
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n, UInt m>
Matrix<decltype(DT1(0) + DT2(0)), n, m> operator+(const StaticMatrix<DT1, ST1, n, m> &a, const StaticMatrix<DT2, ST2, n, m> &b)
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n, UInt m>
Matrix<decltype(DT1(0) - DT2(0)), n, m> operator-(const StaticMatrix<DT1, ST1, n, m> &a, const StaticMatrix<DT2, ST2, n, m> &b)
-
template<typename DT1, typename ST1, UInt n, UInt m>
Matrix<decltype(DT1(0)), n, m> operator-(const StaticMatrix<DT1, ST1, n, m> &a)
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n>
SymMatrix<decltype(DT1(0) + DT2(0)), n> operator+(const StaticSymMatrix<DT1, ST1, n> &a, const StaticSymMatrix<DT2, ST2, n> &b)
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n>
SymMatrix<decltype(DT1(0) - DT2(0)), n> operator-(const StaticSymMatrix<DT1, ST1, n> &a, const StaticSymMatrix<DT2, ST2, n> &b)
-
template<typename DT1, typename ST1, UInt dim>
SymMatrix<decltype(DT1(0)), dim> operator-(const StaticSymMatrix<DT1, ST1, dim> &a)
-
template<typename DT, typename ST, typename T, UInt n, typename = std::enable_if_t<is_arithmetic<T>::value>>
Vector<decltype(DT(0) * T(0)), n> operator*(const StaticVector<DT, ST, n> &a, const T &b)
-
template<typename DT, typename ST, typename T, UInt n, typename = std::enable_if_t<is_arithmetic<T>::value>>
Vector<decltype(DT(0) * T(0)), n> operator*(const T &b, const StaticVector<DT, ST, n> &a)
-
template<typename DT, typename ST, typename T, UInt n, UInt m, typename = std::enable_if_t<is_arithmetic<T>::value>>
Matrix<decltype(DT(0) * T(0)), n, m> operator*(const StaticMatrix<DT, ST, n, m> &a, const T &b)
-
template<typename DT, typename ST, typename T, UInt n, UInt m, typename = std::enable_if_t<is_arithmetic<T>::value, void>>
Matrix<decltype(DT(0) * T(0)), n, m> operator*(const T &b, const StaticMatrix<DT, ST, n, m> &a)
-
template<typename DT, typename ST, typename T, UInt n, typename = std::enable_if_t<is_arithmetic<T>::value>>
SymMatrix<decltype(DT(0) * T(0)), n> operator*(const StaticSymMatrix<DT, ST, n> &a, const T &b)
-
template<typename DT, typename ST, typename T, UInt n, typename = std::enable_if_t<is_arithmetic<T>::value>>
SymMatrix<decltype(DT(0) * T(0)), n> operator*(const T &b, const StaticSymMatrix<DT, ST, n> &a)
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n, UInt m>
Vector<decltype(DT1(0) * DT2(0)), n> operator*(const StaticMatrix<DT1, ST1, n, m> &a, const StaticVector<DT2, ST2, m> &b) Matrix-vector multiplication.
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n, UInt m, UInt l>
Matrix<decltype(DT1(0) * DT2(0)), n, m> operator*(const StaticMatrix<DT1, ST1, n, l> &a, const StaticMatrix<DT2, ST2, l, m> &b) Matrix-matrix multiplication.
-
template<typename DT1, typename ST1, typename DT2, typename ST2, UInt n, UInt m>
Matrix<decltype(DT1(0) * DT2(0)), n, m> outer(const StaticVector<DT1, ST1, n> &a, const StaticVector<DT2, ST2, m> &b)
-
template<typename DT, typename ST, UInt n>
Matrix<std::remove_cv_t<DT>, n, n> dense(const StaticSymMatrix<DT, ST, n> &m)
-
template<typename DT, typename ST, UInt n>
auto dense(const StaticVector<DT, ST, n> &v) -> Vector<DT, n>
-
template<typename DT, typename ST, UInt n>
SymMatrix<std::remove_cv_t<DT>, n> symmetrize(const StaticMatrix<DT, ST, n, n> &m)
-
template<typename DT, typename ST>
Vector<std::remove_cv_t<DT>, 3> invariants(const StaticSymMatrix<DT, ST, 3> &m)
-
template<typename DT, typename ST>
Vector<std::remove_cv_t<DT>, 3> eigenvalues(const StaticSymMatrix<DT, ST, 3> &m)
-
void finalize()
cleanup tamaas
-
Real boussinesq(Real x, Real y, Real a, Real b)
Square patch pressure solution, Johnson (1985) page 54.
- BOOST_PP_SEQ_FOR_EACH (INSTANTIATE_HOOKE, ~,(model_type::basic_1d)(model_type::basic_2d)(model_type::surface_1d)(model_type::surface_2d)(model_type::volume_1d)(model_type::volume_2d))
-
std::ostream &operator<<(std::ostream &o, const IntegralOperator::kind &val)
-
template<bool boundary, typename T>
std::unique_ptr<GridBase<T>> allocateGrid(Model &model, UInt nc)
-
inline ModelDumper &operator<<(ModelDumper &dumper, Model &model)
-
template<typename Abstract, template<model_type> class Concrete, class ...Args>
decltype(auto) createFromModelType(model_type type, Args&&... args)
-
inline std::ostream &operator<<(std::ostream &o, const model_type &val)
Print function for model_type.
-
template<class Function>
constexpr decltype(auto) model_type_dispatch(Function &&function, model_type type) Static dispatch lambda to model types.
-
template<class Function>
constexpr decltype(auto) dimension_dispatch(Function &&function, UInt dim) Static dispatch lambda to dimensions.
-
template<model_type type, bool boundary, typename T, template<typename, UInt> class GridType = Grid, class Container = void>
std::unique_ptr<GridType<T, detail::dim_choice<type, boundary>::value>> allocateGrid(Container &&n, UInt nc) Allocate a Grid unique_ptr.
-
template<bool boundary, typename T, typename Container>
decltype(auto) allocateGrid(model_type type, Container &&n) Helper function for grid allocation with model type.
-
template<bool boundary, typename T, typename Container>
decltype(auto) allocateGrid(model_type type, Container &&n, UInt nc) Helper function for grid allocation with non-standard components.
-
template<std::size_t dim>
std::array<UInt, dim> wrap_pbc(const std::array<Int, dim> &t, const std::array<Int, dim> &n)
-
auto factorize(Grid<Real, 2> A)
Crout(e) (Antoine… et Daniel…) factorization from https://en.wikipedia.org/wiki/Crout_matrix_decomposition
-
template<typename T>
-
namespace [anonymous]
-
namespace [anonymous]
-
namespace [anonymous]
-
namespace [anonymous]
-
namespace compute
-
namespace detail
Typedefs
-
template<model_type type>
using model_type_t = std::integral_constant<model_type, type> Convert enum value to a type.
- model_types_t = std::tuple< BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_FOR_EACH(MAKE_MODEL_TYPE, ~,(model_type::basic_1d)(model_type::basic_2d)(model_type::surface_1d)(model_type::surface_2d)(model_type::volume_1d)(model_type::volume_2d)))>
Enumeration of model types.
- dims_t = std::tuple< BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_FOR_EACH(MAKE_DIM_TYPE, ~,(1)(2)(3)))>
Enumeration of dimension types.
Functions
-
template<typename ...Sizes>
void areAllEqual(bool, std::ptrdiff_t)
-
template<typename ...Sizes>
void areAllEqual(bool result, std::ptrdiff_t prev, std::ptrdiff_t current)
-
template<typename ...Sizes>
void areAllEqual(bool result, std::ptrdiff_t prev, std::ptrdiff_t current, Sizes... rest)
-
template<class Function, class DynamicType, class DefaultFunction, std::size_t... Is>
constexpr decltype(auto) static_switch_dispatch(const model_types_t&, Function &&function, const DynamicType &type, DefaultFunction &&default_function, std::index_sequence<Is...>) Specialized static dispatch for all model types.
-
template<class Function, class DynamicType, class DefaultFunction, std::size_t... Is>
constexpr decltype(auto) static_switch_dispatch(const dims_t&, Function &&function, const DynamicType &dim, DefaultFunction &&default_function, std::index_sequence<Is...>) Specialized static dispatch for all dimensions.
-
template<class TypeTuple, class Function, class DefaultFunction, class DynamicType>
constexpr decltype(auto) tuple_dispatch_with_default(Function &&function, DefaultFunction &&default_function, const DynamicType &type) Dispatch to tuple of types with a default case.
-
template<class TypeTuple, class Function, class DynamicType>
constexpr decltype(auto) tuple_dispatch(Function &&function, const DynamicType &type) Dispatch to tuple of types, error on default.
-
template<model_type type>
-
namespace functional
-
namespace influence
-
namespace [anonymous]
-
namespace iterator_
-
namespace mpi_dummy
Contains mock mpi functions.
Enums
Functions
-
inline bool initialized()
-
inline bool finalized()
-
inline int init(int*, char***)
-
inline int finalize()
-
inline void abort(int) noexcept
-
template<operation op = operation::plus, typename T>
inline decltype(auto) reduce(T &&val, comm = comm::world)
-
template<operation op = operation::plus, typename T>
inline decltype(auto) allreduce(T &&val, comm = comm::world)
-
template<typename T>
inline decltype(auto) gather(const T *send, T *recv, int count, comm = comm::world)
-
template<typename T>
inline decltype(auto) scatter(const T *send, T *recv, int count, comm = comm::world)
-
inline bool initialized()
- file allocator.hh
- #include “tamaas.hh”#include “fftw/fftw_allocator.hh”
- file array.hh
- #include “allocator.hh”#include “errors.hh”#include “logger.hh”#include “span.hh”#include “tamaas.hh”#include <memory>#include <thrust/copy.h>#include <thrust/fill.h>#include <utility>
- file computes.cpp
- #include “computes.hh”
- file computes.hh
- #include “grid.hh”#include “loop.hh”#include “model_type.hh”#include “ranges.hh”#include “static_types.hh”
- file cufft_engine.cpp
- #include “cufft_engine.hh”#include <algorithm>#include <functional>#include <numeric>
- file cufft_engine.hh
- #include “fft_engine.hh”#include <cufft.h>
- file unified_allocator.hh
- #include “span.hh”#include <cuda_runtime_api.h>#include <memory>
- file errors.hh
- #include <sstream>#include <stdexcept>
- file fft_engine.cpp
- #include “fft_engine.hh”#include “fftw/fftw_engine.hh”
Defines
-
inst(x)
-
inst(x)
- file fft_engine.hh
- #include “grid.hh”#include “grid_base.hh”#include “grid_hermitian.hh”#include “partitioner.hh”#include <algorithm>#include <array>#include <map>#include <memory>#include <string>
- file fftw_allocator.hh
- #include “span.hh”#include <fftw3.h>#include <memory>
- file fftw_engine.cpp
- #include “fftw_engine.hh”#include <algorithm>#include <functional>#include <numeric>
- file fftw_engine.hh
- #include “fft_engine.hh”#include “fftw/interface.hh”
- file interface.hh
- #include “mpi/interface.hh”#include “interface_impl.hh”
Defines
-
FFTW_ESTIMATE
-
FFTW_ESTIMATE
- file interface.hh
- #include “mpi_interface.hh”#include <cstdlib>#include <numeric>#include <stdexcept>#include <tuple>
- file interface_impl.hh
- #include <cstddef>#include <fftw3.h>#include <functional>#include <numeric>#include <utility>
- file fftw_mpi_engine.cpp
- #include “fftw/mpi/fftw_mpi_engine.hh”#include “fftw/interface.hh”#include “logger.hh”#include “mpi_interface.hh”#include “partitioner.hh”#include <algorithm>
- file fftw_mpi_engine.hh
- #include “fftw/fftw_engine.hh”#include “fftw/interface.hh”#include “grid.hh”#include “grid_hermitian.hh”#include <map>
- file grid.cpp
- #include “grid.hh”#include “tamaas.hh”#include <algorithm>#include <complex>#include <cstring>
Defines
-
GRID_INSTANCIATE_TYPE(type)
Class instanciation.
-
GRID_INSTANCIATE_TYPE(type)
- file grid.hh
- #include “grid_base.hh”#include “tamaas.hh”#include <array>#include <numeric>#include <utility>#include <vector>#include “grid_tmpl.hh”
- file grid_base.hh
- #include “array.hh”#include “iterator.hh”#include “loop.hh”#include “mpi_interface.hh”#include “static_types.hh”#include “tamaas.hh”#include <cstddef>#include <limits>#include <utility>#include <vector>
- file grid_hermitian.cpp
- #include “grid_hermitian.hh”
Defines
-
GRID_HERMITIAN_INSTANCIATE(type)
-
GRID_HERMITIAN_INSTANCIATE(type)
- file grid_hermitian.hh
- #include “grid.hh”#include “tamaas.hh”#include <complex>#include <type_traits>#include <vector>
- file iterator.hh
- #include “tamaas.hh”#include <cstddef>#include <iterator>#include <thrust/iterator/iterator_categories.h>#include <utility>#include <vector>
- file logger.cpp
- #include “logger.hh”#include “mpi_interface.hh”#include <cstdlib>#include <iostream>#include <map>
- file logger.hh
- #include “tamaas.hh”#include <sstream>
- file loop.hh
- #include “loops/apply.hh”#include “loops/loop_utils.hh”#include “mpi_interface.hh”#include “ranges.hh”#include “tamaas.hh”#include <thrust/execution_policy.h>#include <thrust/for_each.h>#include <thrust/iterator/counting_iterator.h>#include <thrust/iterator/zip_iterator.h>#include <thrust/transform_reduce.h>#include <thrust/tuple.h>#include <thrust/version.h>#include <type_traits>#include <utility>
- file apply.hh
- #include “tamaas.hh”#include <cstddef>#include <thrust/tuple.h>#include <utility>
- file loop_utils.hh
- #include “errors.hh”#include “tamaas.hh”#include <limits>#include <thrust/functional.h>#include <type_traits>
- file mpi_interface.cpp
- #include “mpi_interface.hh”
- file mpi_interface.hh
- #include “static_types.hh”#include “tamaas.hh”#include <cstdlib>#include <type_traits>#include <vector>
Defines
-
MPI_ERR_TOPOLOGY
-
MPI_ERR_TOPOLOGY
- file partitioner.hh
- #include “fftw/interface.hh”#include “grid.hh”#include “mpi_interface.hh”#include “tamaas.hh”#include <algorithm>#include <array>#include <cstdlib>#include <functional>
- file ranges.hh
- #include “errors.hh”#include “iterator.hh”#include “mpi_interface.hh”#include “static_types.hh”
- file span.hh
- #include “tamaas.hh”#include <cstddef>#include <iterator>#include <type_traits>
- file static_types.hh
- #include “tamaas.hh”#include <thrust/detail/config/host_device.h>#include <thrust/sort.h>#include <type_traits>
- file statistics.cpp
- #include “statistics.hh”#include “fft_engine.hh”#include “loop.hh”#include “static_types.hh”
Variables
-
std::array<UInt, dim> exponent
-
std::array<UInt, dim> exponent
- file statistics.hh
- #include “fft_engine.hh”#include “grid.hh”
- file tamaas.cpp
- #include “tamaas.hh”#include “errors.hh”#include “fftw/interface.hh”#include “logger.hh”#include “mpi_interface.hh”
Variables
-
static const entry_exit_points singleton
-
static const entry_exit_points singleton
- file tamaas.hh
- #include <exception>#include <iostream>#include <memory>#include <string>#include <type_traits>#include <thrust/complex.h>#include <thrust/random.h>
Defines
-
TAMAAS_USE_FFTW
-
TAMAAS_FFTW_BACKEND_OMP
-
TAMAAS_FFTW_BACKEND_THREADS
-
TAMAAS_FFTW_BACKEND_NONE
-
TAMAAS_LOOP_BACKEND_OMP
-
TAMAAS_LOOP_BACKEND_TBB
-
TAMAAS_LOOP_BACKEND_CPP
-
TAMAAS_LOOP_BACKEND_CUDA
-
TAMAAS_LOOP_BACKEND
-
TAMAAS_FFTW_BACKEND
-
THRUST_DEVICE_SYSTEM
-
TAMAAS_ACCESSOR(var, type, name)
Convenience macros.
-
CUDA_LAMBDA
Cuda specific definitions.
-
TAMAAS_REAL_TYPE
Common types definitions.
-
TAMAAS_INT_TYPE
-
TAMAAS_USE_FFTW
- file adhesion_functional.cpp
- #include “adhesion_functional.hh”
- file adhesion_functional.hh
- #include “functional.hh”#include <map>
- file be_engine.cpp
- #include “be_engine.hh”#include “logger.hh”#include “model.hh”
- file be_engine.hh
- #include “integral_operator.hh”#include “model_type.hh”#include “westergaard.hh”
- file boussinesq.cpp
- #include “boussinesq.hh”#include “boussinesq_helper.hh”#include “influence.hh”#include “model.hh”
- file boussinesq.hh
- #include “grid_hermitian.hh”#include “model_type.hh”#include “volume_potential.hh”
- file boussinesq_helper.hh
- #include “grid.hh”#include “grid_hermitian.hh”#include “influence.hh”#include “integration/accumulator.hh”#include “kelvin_helper.hh”#include “model.hh”#include “model_type.hh”#include <vector>
- file dcfft.hh
- #include “westergaard.hh”
- file elastic_functional.cpp
- #include “elastic_functional.hh”
- file elastic_functional.hh
- #include “functional.hh”#include “model.hh”#include “tamaas.hh”
- file field_container.hh
- #include “grid.hh”#include “model_type.hh”#include <algorithm>#include <boost/variant.hpp>#include <memory>#include <string>#include <unordered_map>
- file functional.hh
- #include “be_engine.hh”#include “tamaas.hh”
- file hooke.cpp
- #include “hooke.hh”#include “influence.hh”#include “loop.hh”#include “model.hh”#include “static_types.hh”#include <boost/preprocessor/seq.hpp>
Defines
-
INSTANTIATE_HOOKE(r, _, type)
-
INSTANTIATE_HOOKE(r, _, type)
- file hooke.hh
- #include “integral_operator.hh”#include “model_type.hh”
- file influence.hh
- #include “loop.hh”#include “static_types.hh”#include <type_traits>
- file integral_operator.cpp
- #include “integral_operator.hh”#include “model.hh”#include <map>#include <ostream>
- file integral_operator.hh
- #include “field_container.hh”#include “grid_base.hh”#include “model_type.hh”
- file accumulator.hh
- #include “grid_hermitian.hh”#include “integrator.hh”#include “model_type.hh”#include “static_types.hh”#include <array>#include <thrust/iterator/zip_iterator.h>#include <vector>
- file element.cpp
- #include “element.hh”
- file element.hh
- #include “tamaas.hh”#include <expolit/expolit>
- file integrator.hh
- #include “element.hh”#include <expolit/expolit>
Defines
-
BOUNDS
-
BOUNDS
- file kelvin.hh
- #include “grid_hermitian.hh”#include “influence.hh”#include “integration/accumulator.hh”#include “kelvin_helper.hh”#include “model_type.hh”#include “volume_potential.hh”
- file kelvin_helper.hh
- #include “grid.hh”#include “grid_hermitian.hh”#include “influence.hh”#include “integration/accumulator.hh”#include “logger.hh”#include “model.hh”#include “model_type.hh”#include <tuple>
- file internal.hh
- #include “grid.hh”#include <memory>
- file isotropic_hardening.cpp
- #include “isotropic_hardening.hh”#include “influence.hh”#include “tamaas.hh”
- file isotropic_hardening.hh
- #include “grid.hh”#include “influence.hh”#include “internal.hh”#include “material.hh”#include “model.hh”#include “model_type.hh”#include “static_types.hh”
- file material.hh
- #include “grid.hh”#include “model.hh”#include “model_type.hh”
- file mfront_material.cpp
- #include “mfront_material.hh”
- file mfront_material.hh
- #include “material.hh”#include “model_type.hh”
- file meta_functional.cpp
- #include “meta_functional.hh”
- file meta_functional.hh
- #include “functional.hh”#include “tamaas.hh”#include <list>#include <memory>
- file mindlin.cpp
- #include “mindlin.hh”#include “boussinesq_helper.hh”#include “influence.hh”#include “kelvin_helper.hh”#include “model_type.hh”
- file mindlin.hh
- #include “grid_hermitian.hh”#include “kelvin.hh”#include “model_type.hh”#include “volume_potential.hh”
- file model.cpp
- #include “model.hh”#include “be_engine.hh”#include “logger.hh”
- file model.hh
- #include “be_engine.hh”#include “field_container.hh”#include “grid_base.hh”#include “integral_operator.hh”#include “model_dumper.hh”#include “model_type.hh”#include “tamaas.hh”#include <algorithm>#include <memory>#include <vector>
- file model_dumper.hh
- file model_factory.cpp
- #include “model_factory.hh”#include “dcfft.hh”#include “materials/isotropic_hardening.hh”#include “model_template.hh”#include <functional>
Defines
-
CAST(derivative)
-
CAST(derivative)
- file model_factory.hh
- #include “be_engine.hh”#include “model.hh”#include “model_type.hh”#include “residual.hh”#include <vector>
- file model_template.cpp
- #include “model_template.hh”#include “computes.hh”#include “hooke.hh”#include “influence.hh”#include “kelvin.hh”#include “partitioner.hh”#include “westergaard.hh”
Defines
-
CAST(derivative, ptr)
-
CAST(derivative, ptr)
- file model_template.hh
- #include “grid_view.hh”#include “model.hh”#include “model_type.hh”
- file model_type.cpp
- #include “model_type.hh”
- file model_type.hh
- #include “grid.hh”#include “grid_base.hh”#include “static_types.hh”#include “tamaas.hh”#include <algorithm>#include <boost/preprocessor/cat.hpp>#include <boost/preprocessor/seq.hpp>#include <boost/preprocessor/stringize.hpp>#include <memory>
- file residual.cpp
- #include “residual.hh”#include “grid_view.hh”#include “model_factory.hh”#include “model_type.hh”#include <list>#include <memory>
- file residual.hh
- #include “boussinesq.hh”#include “materials/material.hh”#include “mindlin.hh”#include “model_type.hh”#include <unordered_set>
- file volume_potential.cpp
- #include “volume_potential.hh”#include “model.hh”#include <algorithm>
- file volume_potential.hh
- #include “fft_engine.hh”#include “grid_hermitian.hh”#include “grid_view.hh”#include “integral_operator.hh”#include “logger.hh”#include “model_type.hh”#include <functional>
- file westergaard.cpp
- #include “grid_hermitian.hh”#include “grid_view.hh”#include “influence.hh”#include “loop.hh”#include “model.hh”#include “model_type.hh”#include “static_types.hh”#include “westergaard.hh”#include <functional>#include <numeric>
- file westergaard.hh
- #include “fft_engine.hh”#include “grid_hermitian.hh”#include “integral_operator.hh”#include “model_type.hh”#include “tamaas.hh”
- file flood_fill.cpp
- #include “flood_fill.hh”#include “partitioner.hh”#include <algorithm>#include <limits>#include <queue>
- file flood_fill.hh
- #include “grid.hh”#include <list>
- file anderson.cpp
- #include “anderson.hh”#include <algorithm>#include <iomanip>
- file anderson.hh
- #include “epic.hh”#include <deque>
- file beck_teboulle.cpp
- #include “beck_teboulle.hh”#include “logger.hh”#include <iomanip>
- file beck_teboulle.hh
- #include “kato.hh”
- file condat.hh
- #include “kato.hh”
- file contact_solver.cpp
- #include “contact_solver.hh”#include “logger.hh”#include <iomanip>#include <iostream>
- file contact_solver.hh
- #include “meta_functional.hh”#include “model.hh”#include “tamaas.hh”
- file dfsane_solver.cpp
- #include “dfsane_solver.hh”
- file dfsane_solver.hh
- #include “ep_solver.hh”#include “grid_base.hh”#include “residual.hh”#include <deque>#include <functional>#include <utility>
- file ep_solver.cpp
- #include “ep_solver.hh”#include “model_type.hh”
- file ep_solver.hh
- #include “grid_base.hh”#include “residual.hh”
- file epic.hh
- #include “contact_solver.hh”#include “ep_solver.hh”#include “model.hh”
- file kato.cpp
- #include “kato.hh”#include “elastic_functional.hh”#include “logger.hh”#include “loop.hh”#include <iomanip>#include <iostream>#include <iterator>
- file kato.hh
- #include “contact_solver.hh”#include “meta_functional.hh”#include “model_type.hh”#include “static_types.hh”#include “tamaas.hh”
- file kato_saturated.cpp
- #include “kato_saturated.hh”#include “logger.hh”#include <iomanip>#include <limits>
- file kato_saturated.hh
- #include “polonsky_keer_rey.hh”#include <limits>
- file polonsky_keer_rey.cpp
- #include “polonsky_keer_rey.hh”#include “elastic_functional.hh”#include “logger.hh”#include “loop.hh”#include “model_type.hh”#include <iomanip>
- file polonsky_keer_rey.hh
- #include “contact_solver.hh”#include “grid_view.hh”#include “meta_functional.hh”#include “westergaard.hh”
Defines
-
WESTERGAARD(type, kind, desc)
-
WESTERGAARD(type, kind, desc)
- file polonsky_keer_tan.cpp
- #include “polonsky_keer_tan.hh”#include <iomanip>
- file polonsky_keer_tan.hh
- #include “kato.hh”
- file filter.hh
- #include “fft_engine.hh”#include “grid.hh”#include “grid_hermitian.hh”
- file isopowerlaw.cpp
- #include “isopowerlaw.hh”#include <map>
- file isopowerlaw.hh
- #include “filter.hh”#include “grid_hermitian.hh”#include “static_types.hh”
- file regularized_powerlaw.cpp
- #include “regularized_powerlaw.hh”
- file regularized_powerlaw.hh
- #include “filter.hh”#include “grid_hermitian.hh”#include “static_types.hh”
- file surface_generator.cpp
- #include “surface_generator.hh”#include “partitioner.hh”#include <algorithm>
- file surface_generator.hh
- #include “grid.hh”#include <array>
- file surface_generator_filter.cpp
- #include “surface_generator_filter.hh”#include <iostream>
- file surface_generator_filter.hh
- #include “fft_engine.hh”#include “filter.hh”#include “partitioner.hh”#include “surface_generator.hh”#include “tamaas.hh”
- file surface_generator_random_phase.cpp
- #include “surface_generator_random_phase.hh”#include <iostream>
- file surface_generator_random_phase.hh
- #include “filter.hh”#include “surface_generator_filter.hh”#include “tamaas.hh”
- file tamaas_info.hh
- #include <string>
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/core
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/core/cuda
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/core/fftw
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/model/integration
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/core/loops
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/model/materials
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/model
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/core/fftw/mpi
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/percolation
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/solvers
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src
- dir /home/docs/checkouts/readthedocs.org/user_builds/tamaas/checkouts/stable/src/surface
- page index
Introduction
Tamaas is a spectral-integral-equation based contact library. It is made with love to be fast and friendly!
- Author
Lucas Frérot lucas.frerot@imtek.uni-freiburg.de
- Author
Guillaume Anciaux guillaume.anciaux@epfl.ch
- Author
Valentine Rey valentine.rey@univ-nantes.fr
- Author
Son Pham-Ba son.phamba@epfl.ch
- Author
Jean-François Molinari jean-francois.molinari@epfl.ch
License
Copyright (©) 2016-2023 EPFL (École Polytechnique Fédérale de Lausanne), Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) Copyright (©) 2020-2023 Lucas Frérot
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.