GithubHelp home page GithubHelp logo

llnl / serac Goto Github PK

View Code? Open in Web Editor NEW
178.0 13.0 31.0 20.12 MB

Serac is a high order nonlinear thermomechanical simulation code

License: BSD 3-Clause "New" or "Revised" License

CMake 7.77% Shell 2.41% Python 3.35% C++ 81.15% Lua 1.84% Cuda 2.20% Mathematica 1.27%
math-physics finite-elements proxy-application simulation cpp

serac's Introduction

Serac

Build Status Documentation Status codecov License

Serac is a 3D implicit nonlinear thermal-structural simulation code. Its primary purpose is to investigate multiphysics abstraction strategies and implicit finite element-based algorithm development for emerging computing architectures. It also serves as a proxy-app for LLNL's Smith code and heavily leverages the MFEM finite element library.

This project is under heavy development and is currently a pre-alpha release. Functionality and interfaces may change rapidly as development progresses.

Documentation

Build, run, and design documentation can be found at readthedocs.

Source documentation can be found here.

Contributions

We welcome all kinds of contributions: new features, bug fixes, and documentation edits.

For more information, see the contributing guide.

License

Copyright (c) 2019-2024, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory.

Copyrights and patents in the Serac project are retained by contributors. No copyright assignment is required to contribute to Serac.

See LICENSE for details.

Unlimited Open Source - BSD 3-clause Distribution
LLNL-CODE-805541

SPDX usage

Individual files contain SPDX tags instead of the full license text. This enables machine processing of license information based on the SPDX License Identifiers that are available here: https://spdx.org/licenses/

Files that are licensed as BSD 3-Clause contain the following text in the license header:

SPDX-License-Identifier: (BSD-3-Clause)

External Packages

Serac bundles some of its external dependencies in its repository. These packages are covered by various permissive licenses. A summary listing follows. See the license included with each package for full details.

PackageName: Axom
PackageHomePage: https://github.com/LLNL/axom
PackageLicenseDeclared: BSD-3-Clause

PackageName: BLT
PackageHomePage: https://github.com/LLNL/blt
PackageLicenseDeclared: BSD-3-Clause

PackageName: MFEM
PackageHomePage: https://github.com/mfem/mfem
PackageLicenseDeclared: BSD-3-Clause

PackageName: radiuss-spack-configs
PackageHomePage: https://github.com/LLNL/radiuss-spack-configs
PackageLicenseDeclared: MIT License

PackageName: uberenv
PackageHomePage: https://github.com/LLNL/uberenv
PackageLicenseDeclared: BSD-3-Clause

serac's People

Contributors

adayton1 avatar adrienbernede avatar bendudson avatar bradwhitlock avatar btalamini avatar chapman39 avatar ebchin avatar goxberry avatar jamiebramwell avatar jandrej avatar johnbowen42 avatar jonwong12 avatar joshessman-llnl avatar kswartz92 avatar pate7 avatar rmferencz avatar samuelpmishllnl avatar tepperly avatar tupek2 avatar white238 avatar zarahm avatar zatkins-work avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serac's Issues

Make "bank" overridable by environment variable

Most pipelines should be run with the project bank. But when triggering a pipeline from the outside (multi-project) or manually, the bank may not be accessible.

A solution would be to make the bank overridable by environment variable.

*Solver objects unsafe

There's a lot of use of raw pointers in the BaseSolver and related classes. Aside from being ambiguous about ownership, it also means that something as simple as passing one of these objects to a function will segfault.

template < typename T >
T do_anything(T foo) {
  ...
}

DynamicSolver oper(...);
do_anything(oper); // $ Segmentation fault (core dumped)

My vote is to just avoid raw pointers as much as is practical (in favor or std::shared_ptr or reference variables), but we could also disable some copy constructors and make these objects move-only.

Move away from mfem::Array types

When possible, I think it would be best to go to std::Vector or std::map instead of mfem::Array types. This reduces the dependency on MFEM from a user perspective.

Problem with building serac

I'm trying to build serac on my computer. I get the following Checksum error both in building developer's tools and dependencies.

Error: ChecksumError: sha256 checksum failed for /home/saman/serac/uberenv_libs/builds/spack-stage-rz4d952n/4075.patch

and follows by

    Expected 3387faf4a71efe81c0fa17410b270ca7d352081ac88d2322df3da9bb6a6a3f2d but got 42d8b2163a2f37a745800ec13a96c08a3a20d5e67af51031e51f63313d0dedd1

/home/saman/serac/uberenv_libs/spack/lib/spack/spack/package.py:1088, in do_fetch:
       1085
       1086        self.stage.cache_local()
       1087
  >>   1088        for patch in self.spec.patches:
       1089            patch.fetch(self.stage)
       1090            if patch.cache():
       1091                patch.cache().cache_local()

anyone knows how to resolve this? Thanks.

Rename variables used to emulate master workflow

BUILD_DEPS is the name of the variable that will trigger the master pipeline, useful to test and debug the CI itself.
But the variable name is not well chosen. Let’s name it "MASTER_WORKFLOW".

Create a user parameter for number of test MPI tasks

Where in the serac building workflow the MPI fix should be added?

I'm not really sure. I'll open a new ticket for this because it would be nice for it to be a user configurable parameter. @white238 would probably be the one who knows best. The one test that is still failing is a BLT one as well, so it might need to be a setting there.

Originally posted by @jamiebramwell in #43 (comment)

Define and audit doxgen style

I was a bad developer and started this project without clearly defined doxygen use guides. We should decide on a style and push it to the repo.

Audit const correctness

I am sure in my rush to get initial functionality out, I missed some things which could (and should) be marked const.

issues building on WSL

I'm having some problems building the TPLs on a Windows subsystem for Linux (ubuntu 18.04).

sam@provolone:~/serac$ python3 scripts/uberenv/uberenv.py --spec=+debug

...
linalg/superlu.cpp: In destructor ‘virtual mfem::SuperLUSolver::~SuperLUSolver()’:
linalg/superlu.cpp:235:4: error: ‘ScalePermstruct_t’ was not declared in this scope
    ScalePermstruct_t * SPstruct     = (ScalePermstruct_t*)ScalePermstructPtr_;
    ^~~~~~~~~~~~~~~~~
linalg/superlu.cpp:235:4: note: suggested alternative: ‘dScalePermstruct_t’
    ScalePermstruct_t * SPstruct     = (ScalePermstruct_t*)ScalePermstructPtr_;
    ^~~~~~~~~~~~~~~~~
    dScalePermstruct_t
linalg/superlu.cpp:235:24: error: ‘SPstruct’ was not declared in this scope
    ScalePermstruct_t * SPstruct     = (ScalePermstruct_t*)ScalePermstructPtr_;
                        ^~~~~~~~
linalg/superlu.cpp:235:24: note: suggested alternative: ‘struct’
    ScalePermstruct_t * SPstruct     = (ScalePermstruct_t*)ScalePermstructPtr_;
                        ^~~~~~~~
                        struct
linalg/superlu.cpp:235:58: error: expected primary-expression before ‘)’ token
    ScalePermstruct_t * SPstruct     = (ScalePermstruct_t*)ScalePermstructPtr_;
                                                          ^
linalg/superlu.cpp:236:4: error: ‘LUstruct_t’ was not declared in this scope
    LUstruct_t        * LUstruct     = (LUstruct_t*)LUstructPtr_;
    ^~~~~~~~~~

Could one of the recent changes to the dependencies and build system in the last few days be responsible? I confess to approving those PRs without actually rebuilding the TPLs myself. That being said, it took more than 2 hours for python3 scripts/uberenv/uberenv.py --spec=+debug to produce the error above, which makes it challenging to test if a PR breaks something or not.

Potential mishandling of boundary conditions

The most recent change to the boundary condition data structures now involves iterating over
each of the members of m_ess_bdr to do things like elimination of essential degrees of freedom:

void ThermalSolver::CompleteSetup(){
  ...
  // Eliminate the essential DOFs from the stiffness matrix
  for (auto &ess_bc_data : m_ess_bdr) {
    m_K_e_mat.reset(m_K_mat->EliminateRowsCols(ess_bc_data->true_dofs));
  }
  ...
}

void ThermalSolver::QuasiStaticSolve(){
  ...
  // Apply the boundary conditions
  *m_bc_rhs = *m_rhs;
  for (auto &ess_bc_data : m_ess_bdr) {
    ess_bc_data->scalar_coef->SetTime(m_time);
    temperature.gf->ProjectBdrCoefficient(*ess_bc_data->scalar_coef, ess_bc_data->bc_markers);
    temperature.gf->GetTrueDofs(temperature.true_vec);
    mfem::EliminateBC(*m_K_mat, *m_K_e_mat, ess_bc_data->true_dofs, temperature.true_vec, *m_bc_rhs);
  }
  ...
}

It seems like m_K_e_mat is just being overwritten on each loop iteration, so it's not obvious to me that this is really handling the separate entries of m_ess_bdr correctly.

Changing the thermal test from

TEST(thermal_solver, static_solve){
  ...
  // Initialize the temperature boundary condition
  std::vector<int> temp_bdr(pmesh->bdr_attributes.Max(), 1);
  auto u_0 = std::make_shared<StdFunctionCoefficient>([](const auto & x){
    return x.Norml2();
  });
  therm_solver.SetTemperatureBCs(temp_bdr, u_0);
  ...
}

to

TEST(thermal_solver, static_solve){
  ...
  // Initialize the temperature boundary condition
  std::vector<int> temp_bdr(pmesh->bdr_attributes.Max(), 1);
  auto u_0 = std::make_shared<StdFunctionCoefficient>([](const auto & x){
    return 2 * x.Norml2();
  });
  therm_solver.SetTemperatureBCs(temp_bdr, u_0);

  // whoops, that first function was wrong--  
  // let me try to correct it by setting the right values!
  u_0 = std::make_shared<StdFunctionCoefficient>([](const auto & x){
    return x.Norml2();
  });
  therm_solver.SetTemperatureBCs(temp_bdr, u_0);
  ...
}

makes the test fail (incorrect answer).

I don't really understand the implementation of boundary conditions in MFEM well enough to do much more, can anyone else comment on this? Do we need to have a separate m_K_e_mat for each BoundaryConditionData?

Add simple testing integration

I think we're at a state now where we can add some simple tests using our ctest framework via either Azure pipelines or Travis. Any takers?

Document style guide

Write a minimal "style guide" that will probably be amendments to the Google C++ style guide located here.

Move to MFEM 4.1

Upgrade the MFEM dependency to the newly released v4.1. This should happen sooner rather than later as it greatly improves GPU support.

Switch Gitlab scripts to use build_tpls.py

We should limit the duplication of build scripts we have. This requires some copying of work that I did on Axom to allow build_tpls.py to allow "--spec=%somecompilerspec" on the command line. Then removing the part of build_and_test.sh that build the TPLs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.