Coder Social home page Coder Social logo

hpc-maths / samurai Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 10.0 18.21 MB

Intervals coupled with algebra of set to handle adaptive mesh refinement and operators on it.

Home Page: https://hpc-math-samurai.readthedocs.io

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

CMake 0.99% C++ 96.61% Python 2.40%
adaptive-mesh-refinement amr cartesian scientific-computing

samurai's People

Contributors

github-actions[bot] avatar gouarin avatar grenier avatar kivvix avatar pmatalon avatar rolanddenis avatar tbellotti 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

Watchers

 avatar  avatar  avatar  avatar  avatar

samurai's Issues

periodic conditions

The periodic boundary conditions are defined in the mesh. But is it what we want?

Shouldn't periodic boundary conditions be a boundary condition like any other?

Fix use of fmt 0.8

The fmt version was fixed to 0.7 in the conda environment because the CI failed with the 0.8 on Mac Os.

[Bug]: `INIT_BC` does not correctly capture field type

What happened?

It's not possible to name a template parameter as I want when I use INIT_BC macro.

Input code

template <class Field_t>
struct Dirichlet : public Bc<Field_t>
{
    INIT_BC(Dirichlet)

    void apply(Field_t& f, const cell_t& cell_out, const cell_t& cell_in,
               const value_t& value) const override
    {
        f[cell_out] = 2 * value - f[cell_in];
    }
};

What expected?

Give template parameter Field (or Field_t in this example) to INIT_BC macro.

#define INIT_BC(NAME, FIELD)                              \
    using base_t  = samurai::Bc<FIELD>;            \
    using cell_t  = typename base_t::cell_t;       \
    using value_t = typename base_t::value_t;      \
    using base_t::Bc;                              \
                                                   \
    std::unique_ptr<base_t> clone() const override \
    {                                              \
        return std::make_unique<NAME>(*this);      \
    }
INIT_BC(Dirichlet, Field_t)

What is your operating system?

Mac OS

How did you install our software?

from source

Software version

0.x.x

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

`update_ghost` performance

By default, the function update_ghost updates all the ghosts defined in the mesh (AMR or MRA). When you compute the new solution using a time scheme, for example, only the ghosts used by the spatial scheme need to be updated. The ghosts used to adapt the mesh are not needed.

Then, the cost can be considerably reduced if you only update the right ghosts.

Improve BC

When we add a boundary condition using for example

auto u = samurai::make_field<double, 4>("u", mesh);
samurai::make_bc<samurai::dirichlet>(u, 0., 0., 0., 0.);

we defined the boundary condition for all components of the field.

But sometimes, we don't want to split our field and we want to have several boundary conditions depending of the field component.

The BCclass must then be updated to take this case into account.

[Bug]: update_bc and UniformMesh

What happened?

IT's not possible to use update_bc function with UniformMeshsince the periodicity is not implemented for this kind of mesh.

Input code

static constexpr std::size_t dim = 1;
using config                     = UniformConfig<dim>;
auto mesh                        = UniformMesh<config>({{0}, {1}}, 4);
auto u                           = make_field<double, 1>("u", mesh);

make_bc<Dirichlet>(u);
update_bc(u);

What expected?

Have the same behaviour of MRMesh

What is your operating system?

Mac OS

How did you install our software?

from source

Software version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Fix cppcheck error

cppcheck gives some errors that are disabled in samurai. To find them, you can search the keyword cppcheck-suppress.

You have to check if these errors are false positives or not.

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.