Skip to content

sandialabs/LCM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13,935 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Albany-LCM

Albany-LCM (Laboratory for Computational Mechanics) is a fork of Albany, an implicit, unstructured grid, finite element code for the solution and analysis of multiphysics problems. Albany-LCM focuses on computational solid mechanics and thermo-mechanics, with nearly 200 regression tests demonstrating capabilities across a wide variety of problems.

Features

Analysis of complex multiphysics problems

Notched Cylinder Multi-Scale Simulation

Solid mechanics simulation of a notched cylinder using the alternating Schwarz-based multi-scale coupling capability in Albany-LCM.

Capabilities

Prerequisites

Albany-LCM requires Trilinos and the following system packages.

RHEL / Fedora

sudo dnf install \
  blas blas-devel boost boost-devel boost-openmpi boost-openmpi-devel \
  cmake gcc-c++ gcc-gfortran gtest-devel git \
  hdf5 hdf5-devel hdf5-openmpi hdf5-openmpi-devel \
  lapack lapack-devel netcdf netcdf-devel netcdf-openmpi netcdf-openmpi-devel \
  openblas openblas-devel openmpi openmpi-devel environment-modules

Optional (for clang builds):

sudo dnf install clang clang-devel

CMake 3.27+ is required. If your system cmake is older:

spack install cmake@3.27

Ubuntu

sudo apt install \
  libblas-dev libboost-dev libboost-program-options-dev \
  cmake g++ gfortran git \
  libhdf5-openmpi-dev liblapack-dev libnetcdf-dev \
  libopenmpi-dev mpi-default-bin environment-modules

Quick Start

1. Clone repositories

mkdir ~/LCM && cd ~/LCM

git clone git@github.com:trilinos/Trilinos.git
git clone git@github.com:sandialabs/LCM.git
git clone -b dtk-2.0-tpetra-static-graph git@github.com:ikalash/DataTransferKit.git
cp -r DataTransferKit Trilinos/

2. Set up environment

Add to ~/.bashrc:

export LCM_DIR=~/LCM
module use $LCM_DIR/LCM/doc/LCM/modulefiles

Log out and back in, or source ~/.bashrc.

3. Create the lcm symlink

cd ~/LCM
ln -s LCM/doc/LCM/build/lcm .

4. Build and test

cd ~/LCM
module load release           # loads serial-gcc-release environment

./lcm clean trilinos          # clean previous builds
./lcm config trilinos 16      # configure Trilinos (16 = parallel threads)
./lcm build trilinos 16       # build Trilinos

./lcm clean lcm               # clean previous LCM build
./lcm config lcm 16           # configure LCM
./lcm build lcm 16            # build LCM
./lcm test lcm                # run test suite

Or do everything at once:

./lcm all 16

5. Available commands

lcm clean   <package>        Clean build (and install for trilinos)
lcm config  <package> [N]    Configure package
lcm build   <package> [N]    Build package with N threads (default: nproc)
lcm test    <package>        Run tests
lcm all     [N]              Full pipeline: clean + config + build + test
lcm help                     Show help

Module System

Modules configure the compiler, architecture, and build type. Available configurations:

Module Compiler Build Type
serial-gcc-release GCC Release (optimized)
serial-gcc-debug GCC Debug (symbols)
serial-clang-release Clang Release
serial-clang-debug Clang Debug

The release module is an alias for serial-gcc-release.

Load a module before building:

module load serial-clang-release
./lcm all 16 --module=serial-clang-release

Build directories are named by configuration, e.g. lcm-build-serial-gcc-release. A corresponding Trilinos installation must exist for each configuration.

Running

After building, the Albany executable is in the build directory:

cd ~/LCM/lcm-build-serial-gcc-release/tests/LCM/Pressure
mpiexec -np 4 ~/LCM/lcm-build-serial-gcc-release/src/Albany input_tetra4.yaml

The module system adds build and Trilinos install directories to PATH, so after loading a module, Albany and Trilinos tools (decomp, epu, exodiff) are available directly.

Testing

The test suite is in tests/ and runs via CTest:

./lcm test lcm

Individual tests can be run from their subdirectory:

cd ~/LCM/lcm-build-serial-gcc-release/tests/LCM/Pressure
ctest

Many tests run in parallel using up to 4 MPI ranks.

Nightly Tests

The doc/LCM/build/clone-build-test.sh script clones all repositories from scratch and runs the full build and test suite. It is typically run via cron:

# In crontab:
00 00 * * 1-5 cd /home/lcm/LCM; bash -l -c "./clone-build-test.sh"

Contributing

Development discussion: https://github.com/sandialabs/LCM/issues

We follow the Google C++ Style Guide. Use clang-format with the .clang-format file in src/LCM/:

clang-format -i <source file>

Please ensure all tests pass before pushing changes.

Contact

About

Laboratory for Computational Mechanics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors