Code Monkey home page Code Monkey logo

ibamr / ibamr Goto Github PK

View Code? Open in Web Editor NEW
333.0 49.0 137.0 117.31 MB

An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method

Home Page: http://ibamr.github.io/

License: Other

Shell 2.35% C++ 76.58% MATLAB 0.03% C 0.44% Perl 0.20% Python 0.09% Makefile 14.08% M4 5.59% HTML 0.01% CMake 0.29% Cuda 0.34% Assembly 0.01%
immersed-boundary-method adaptive-mesh-refinement multiphase-flow finite-difference finite-elements c-plus-plus fortran mpi volume-penalization-method level-set-method

ibamr's Introduction

IBAMR

An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method

What Is IBAMR?

IBAMR is a distributed-memory parallel implementation of the immersed boundary (IB) method with support for Cartesian grid adaptive mesh refinement (AMR). Support for distributed-memory parallelism is via MPI, the Message Passing Interface.

Core IBAMR functionality relies upon several high-quality open-source libraries, including:

  • SAMRAI, the Structured Adaptive Mesh Refinement Application Infrastructure
  • PETSc, the Portable, Extensible Toolkit for Scientific Computation
  • libMesh, a C++ finite element library
  • hypre, a library of high performance preconditioners that features parallel multigrid methods for both structured and unstructured grid problems.

IBAMR also uses functionality provided by a number of additional third-party libraries, including: Boost; Eigen; HDF5; muParser; and Silo.

IBAMR outputs visualization files that can be read by the VisIt Visualization Tool.

What Is the IB Method?

The immersed boundary (IB) method is a general-purpose numerical method for simulating fluid-structure interaction. The IB formulation of such problems uses an Eulerian description of the fluid and a Lagrangian description of the structure. Interaction equations that couple the Eulerian and Lagrangian variables take the form of integral equations with delta function kernels.

For general information about the IB method, see math.nyu.edu/faculty/peskin. For additional information about the IBAMR software, see ibamr.github.io. We are happy to host visualizations of simulations that use IBAMR.

Getting Started

IBAMR requires a number of third-party libraries. Sample build instructions are provided for both Linux distributions and macOS.

For help with git see the summary document included with the documentation.

Documentation

Source code documentation for the IBAMR library and supporting IBTK library is available on-line. File format documentation is also available on-line. There is also list of frequently asked questions.

Support

Support for IBAMR is available via the IBAMR Users Google Group ([email protected]). Discussion related to the continued development of IBAMR is via the IBAMR Developers Google Group ([email protected]).

Bugs and Other Issues

Please use the GitHub issue tracking system to report bugs, feature requests, or other issues with IBAMR.

Writing patches

IBAMR has a core group of developers but also regularly takes contributions from our students as well as outside users. All patches undergo a peer review process and are usually accepted after some minor revisions. To ensure style uniformity, we require that users run make indent (or make the fixes indicated by the continous integration run). For more information on how this process works see scripts/formatting/README.md.

Acknowledgments

IBAMR development is supported in part by NSF Software Infrastructure for Sustained Innovation awards OAC 1450327 (to UNC-Chapel Hill), OAC 1450374 (to Northwestern University), and OAC 1607042 (to Rice University). Additional support is provided by NSF CAREER award OAC 1652541 (to UNC-Chapel Hill). Prior support was provided by NSF awards DMS 1016554 (to New York University), DMS 1460368 (to UNC-Chapel Hill), OAC 1047734 (to New York University), and OAC 1460334 (to UNC-Chapel Hill). We gratefully acknowledge this support.

ibamr's People

Contributors

abarret avatar adonev avatar alexkaiser avatar aminkolah avatar amneetb avatar bdice avatar benlvr avatar boyceg avatar colegruninger97 avatar cpuelz avatar deleeke avatar drwells avatar fbusabiaga avatar fuhuifang avatar hongk45 avatar jabrown893 avatar kallemov avatar kaustubh-khedkar avatar knepley avatar marshallrdavey avatar namupatel avatar nishantnangia avatar raamkrishnan avatar raveenak96 avatar rossisimone avatar sddelong avatar vibraphone avatar walterjunjun avatar xxjaehoxx 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  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

ibamr's Issues

Runtime error in navier_stokes example 6

examples/navier_stokes/ex6 compiles, but I get this runtime error when I try and run main2d

examples/navier_stokes/ex6$ ./main2d input2d

+++++++++++++++++++++++++++++++++++++++++++++++++++
At beginning of timestep # 7
Simulation time is 0.7

At end       of timestep # 7
Simulation time is 0.8
+++++++++++++++++++++++++++++++++++++++++++++++++++


Writing visualization files...

P=00000:Program abort called in file ``/home/deleeke/sfw/samrai/2.4.4/linux-g++-debug/include/VisItDataWriter.C'' at line 2945
P=00000:ERROR MESSAGE: 
P=00000:VisItDataWriter<DIM>:
P=00000:    hier::Patch data F_T is less than FLT_MIN 
P=00000:    level: 0  patch: 0  patch_data_id: 46  value: -inf
P=00000:    It cannot be read by VisIt.
P=00000:    Make sure data is properly initialized or
P=00000:    use scale factor to increase its size.
[deleeke-x401a:05263] *** Process received signal ***
[deleeke-x401a:05263] Signal: Aborted (6)
[deleeke-x401a:05263] Signal code:  (-6)

-------------------------------------------------------------

HierarchyMathOps::grad CC->SC,FC not behaving as expected

If I want to store
U <- alpha * grad Phi + beta * U

for constant alpha and beta, SC U and CC Phi, one can use HierarchyMathOps::grad() as seen here:
https://github.com/IBAMR/IBAMR/blob/master/src/navier_stokes/StaggeredStokesProjectionPreconditioner.cpp#L322

which works fine because the underlying Fortran code takes into account the grad Phi and beta * U together:
https://github.com/IBAMR/IBAMR/blob/master/ibtk/src/math/fortran/grad2d.f.m4#L430

However, if I want to do the same gradient computation using variable SC alpha, the underlying Fortran code first computes alpha grad Phi terms:
https://github.com/IBAMR/IBAMR/blob/master/ibtk/src/math/fortran/flux2d.f.m4#L328

and then 'axpys' the beta U term:
https://github.com/IBAMR/IBAMR/blob/master/ibtk/src/math/PatchMathOps.cpp#L3585
https://github.com/IBAMR/IBAMR/blob/master/ibtk/src/math/PatchMathOps.cpp#L3644

However in these axpy statements, src2 now holds alphagrad Phi because it is the same patch data as dst, so what is eventually returned by HierarchyMathOps::grad() is
U <- beta
alphagrad Phi +alphagrad Phi

instead of

U <- betaU + alphagrad*Phi

==
Similar issues for FC U and src2.
Should we be able to call HierarchyMathOps::grad() with dst == src2 for non-constant alpha (as is the case with constant alpha)?

Runtime error in example/IB/explicit/ex5

I'm getting this run-time error in IB/explicit/ex5
This error message is from the main2d, but main3d produces an almost identical error.

This MAY be some issue with my SAMRAI...

/examples/IB/explicit/ex5$ ./main2d input2d

WARNING: Automatically using both VisIt and Silo data writers.
In the future, it will be necessary to include "Silo" in the list of data writer in order to output Silo data.
.
IBStandardInitializer:  Reading from input files.
  base filename: points2d
  assigned to level 0 of the Cartesian grid patch hierarchy


Global seed = 1479860631

IBStandardInitializer:  Deallocating initialization data.

Writing visualization files at timestep # 0 t=0

Writing output files at timestep # 0 t=0
P=00000:Program abort called in file ``/home/deleeke/sfw/samrai/2.4.4/linux-g++-debug/include/Patch.C'' at line 117
P=00000:ERROR MESSAGE: 
P=00000:Failed assertion: d_patch_data[id].isNull()
[deleeke-x401a:01591] *** Process received signal ***
[deleeke-x401a:01591] Signal: Aborted (6)
[deleeke-x401a:01591] Signal code:  (-6)

Q_rhs_vec is not set up properly in IBFEMethod::computeLagrangianFluidSource

Q_dof_map.constrain_element_vector(Q_rhs_e, Q_dof_indices);

In IBFEMethod::computeLagrangianFluidSource(double data_time), the following two lines 888-889 need to move out of the for loop on qp,
// Apply constraints (e.g., enforce periodic boundary conditions) // and add the elemental contributions to the global vector. Q_dof_map.constrain_element_vector(Q_rhs_e, Q_dof_indices); Q_rhs_vec->add_vector(Q_rhs_e, Q_dof_indices);

LNode::getNodeDataVector()

Line 173 in LNode-inl.h looks buggy..
it_val = d_node_data_type_arr[k];
It should be
it_val = d_node_data[k];

d_node_data_type_arr contains unique elements and that would always result in a vector of length 1.

IBFE example 4 runtime problems

This example's main3d compiles and never throws an error, but in never proceeds past this point:

examples/IBFE/explicit/ex4$ ./main3d input3d

 ./main3d input3d*** Warning, This code is deprecated, and likely to be removed in future library versions! ./include/libmesh/auto_ptr.h, line 270, compiled Aug  2 2016 at 11:58:24 ***

IBFEMethod: using FIRST order LAGRANGE finite elements.

*** Warning, This code is deprecated, and likely to be removed in future library versions! ../LIBMESH/src/mesh/boundary_info.C, line 1016, compiled Aug  2 2016 at 12:04:42 ***

Nightly Build

@boyceg

I am going to enable nightly builds of master on Jenkins. There two options about how the build status is displayed on GitHub:

  1. Set build status with a checkmark, red "x", or yellow "unstable/pending" ball on the branches page next to branch name

  2. Put build status badge in README

And/or there is the option to get emails:

  1. Receive an email only when it is unstable with the console output in the email and another notification then when it returns to passing.

  2. Receive an email for every build.

Of those four options which would you like (you can do any combination)?

make choice of Stokes+IB preconditioner more flexible

The present implementation of IBImplicitStaggeredHierarchyIntegrator effectively requires using a StaggeredStokesFACPreconditioner with a StaggeredStokesIBLevelRelaxationFACOperator. The code should be made a bit more general (e.g. using a simple base class for Stokes+IB solvers derived from the StaggeredStokesSolver base class and a new factory class for Stokes+IB solvers).

support for irregular Eulerian domains

If one wanted to run a simulation with IBAMR on a T-shaped domain, but without using IB points to make that non-rectangular domain, would that be easy to do? I’m interested in using the ADR with AMR aspects of IBAMR but I don’t want the time step restrictions associated with the IB wall points.

examples/IBFE/explicit/ex7 broken

Issue type

Bug

Affected branches/commits

Branch: master
Commit: fdd3bd1

Description of problem

Looks like there is a compilation error in this example when compiling with GCC

I have not looked into it any further, but this looks like an undefined variable problem.

Compilation error output:

In file included from test_main.cpp:2:0:
example.cpp: In function 'bool run_example(int, char**)':
example.cpp:227:72: error: 'boundary_id' was not declared in this scope
                     if (boundary_info->has_boundary_id(elem,side,1) || boundary_id == boundary_info->has_boundary_id(elem,side,3))
                                                                        ^
In file included from test_main.cpp:2:0:
example.cpp:255:72: error: 'boundary_id' was not declared in this scope
                     if (boundary_info->has_boundary_id(elem,side,1) || boundary_id == boundary_info->has_boundary_id(elem,side,3))
                                                                        ^
Makefile:612: recipe for target 'test2d-test_main.o' failed

Steps to reproduce:

Configure IBAMR to build with gcc based compilers.
Attempt to compile the examples in examples/IBFE/explicit/ex7

Error in IMP example

I get a runtime error when I try and run the IMP example


/IMP/explicit/ex0$ ./main2d input2d
 
*** Warning, This code is deprecated, and likely to be removed in future library versions! ./include/libmesh/auto_ptr.h, line 270, compiled Aug  2 2016 at 11:58:24 ***
P=00000:Program abort called in file ``../../IBAMR/lib/../src/IB/IMPInitializer.cpp'' at line 234
P=00000:ERROR MESSAGE: 
P=00000:Failed assertion: silo_writer
[deleeke-x401a:03573] *** Process received signal ***
[deleeke-x401a:03573] Signal: Aborted (6)
[deleeke-x401a:03573] Signal code:  (-6)
[deleeke-x401a:03573] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f2745432330]
[deleeke-x401a:03573] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f273ff79c37]
[deleeke-x401a:03573] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f273ff7d028]
[deleeke-x401a:03573] [ 3] ./main2d[0xb3b6b3]
[deleeke-x401a:03573] [ 4] ./main2d[0xafe514]
[deleeke-x401a:03573] [ 5] ./main2d[0x68eb2f]
[deleeke-x401a:03573] [ 6] ./main2d[0x42d5a3]
[deleeke-x401a:03573] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f273ff64f45]
[deleeke-x401a:03573] [ 8] ./main2d[0x42b289]
[deleeke-x401a:03573] *** End of error message ***
Aborted (core dumped)

Let me know if you need any more details!

Runtime error in examples/IBFE/explicit/ex2/main3d

On recent clean build of master, I get a run-time error with the 3d version example (2d runs fine).

$ ./main3d input3d 
*** Warning, This code is deprecated, and likely to be removed in future library versions! ./include/libmesh/auto_ptr.h, line 270, compiled Mar 15 2017 at 12:15:26 ***

IBFEMethod: using FIRST order LAGRANGE finite elements.

*** Warning, This code is deprecated, and likely to be removed in future library versions! ../LIBMESH/src/mesh/boundary_info.C, line 1016, compiled Mar 15 2017 at 12:18:09 ***


Writing visualization files...


+++++++++++++++++++++++++++++++++++++++++++++++++++
At beginning of timestep # 0
Simulation time is 0
Assertion `i < this->n_sides()' failed.
i = 0
this->n_sides() = 0


Stack frames: 14
0: libMesh::print_trace(std::ostream&)
1: libMesh::MacroFunctions::report_error(char const*, int, char const*, char const*)
2: libMesh::Quad4::build_side(unsigned int, bool) const
3: libMesh::Face::build_edge(unsigned int) const
4: ./main3d() [0xa96486]
5: ./main3d() [0xaa303e]
6: ./main3d() [0xaa353d]
7: ./main3d() [0x789d20]
8: ./main3d() [0x7829c3]
9: ./main3d() [0x5dd3bd]
10: ./main3d() [0xa38efe]
11: ./main3d() [0x4c1aa4]
12: __libc_start_main
13: ./main3d() [0x4be939]
[0] ../LIBMESH/src/geom/face_quad4.C, line 130, compiled Mar 15 2017 at 12:17:54
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------

CIBFEMethod

@amneetb, does this class work? If not, should we remove it from the library for now?

IMPInitializer::registerMesh()

a) Ref:

d_vertex_offset[level_number].resize(d_vertex_offset[level_number].size() + 1,
mesh_idx == 0 ? 0 : d_num_vertex[level_number][mesh_idx - 1]);

  d_vertex_offset[level_number].resize(d_vertex_offset[level_number].size() + 1,
                                         mesh_idx == 0 ? 0 : d_num_vertex[level_number][mesh_idx - 1]);

It looks like d_vertex_offset is just storing the number of vertices of previous mesh registered with this routine, instead of sum of all the number of previously registered mesh vertices.

b) This info is getting used in IMPInitializer::getCanonicalLagrangianIndex() routine and initializeLSiloDataWriter():

return d_vertex_offset[level_number][point_index.first] + point_index.second;

example/ConstraintIB/falling_sphere

I noticed that GNU library was not used in example/ConstraintIB/falling_sphere case. However, we can't make examples/run it without installing GNU library.
Is it possible to fix this issue?

Tks.

Updating to the current libMesh version

With the current version of libMesh C++11 is required and UniquePtr is simply an alias for std::unique_ptr. So calling UniquePtr p(NULL) is not allowed anymore.
For backward compatibility, I believe it could be enough to use the default constructors
UniquePtr p(NULL); -> UniquePtr p;
Any thought?

check GSL m4

It appears that libgslcblas is not being linked to in some cases when checking for libgsl (e.g. using clang on the VM).

dependencies branch reduce-memory-use

The branch boyceg/reduce-memory-use needd the version 3.3 or 3.4 of PETSc and the version 0.9.3
of libMesh while the master branch is already using newer versions. If it is possible, it may be convenient to have the same dependencies in all the branches to avoid the worry of having different versions of the same library.

d_split_forces boolean

Ref

const bool compute_transmission_force = (!d_split_forces && !at_dirichlet_bdry);

if (d_use_jump_conditions && d_split_forces && !at_dirichlet_bdry)

The above two lines look suspicious. If d_split_forces is true on line 1309, it won't reach the statements of block L 1351.

Also, what is weak form for external surface forces. Are you including it in the definition of PK1*N or it's treated differently?

Jenkins key phrases

@boyceg

So, at the moment, all jobs test every PR when it is made and when new commits are pushed.

Additionally, I have set up some new key phrases for the Jenkins PR jobs to watch out for -- these can be in comments or in commit messages I believe.

retest this please builtin to GHPRB, runs all jobs watching this PR
opt test runs opt job only
skip opt skips opt job, put this in commit message or along with "retest this please"

the rest follow same pattern as above

llvm test
skip llvm
gcc test
skip gcc

Does that sound good?
(note: at the moment, all members of IBAMR organization can trigger these builds)

Restarts broken for non-IB examples

If you try restarting a simulation from an example that does not contain an immersed structure (i.e. navier_stokes/ex3), you will get the following error message:

In the future, it will be necessary to include "Silo" in the list of data writer in order to output Silo data.
.
P=00000:Program abort called in file ``../../../IBAMR/ibtk/lib/../src/lagrangian/LSiloDataWriter.cpp'' at line 2404
P=00000:ERROR MESSAGE:
P=00000:Restart database corresponding to LSiloDataWriter not found in restart file.

The error can be traced back to a call in AppInitializer:
0x000000000081d83a in IBTK::AppInitializer::AppInitializer (this=0x10a1a80, argc=, argv=,
default_log_file_name=...) at ../../../IBAMR/ibtk/lib/../src/utilities/AppInitializer.cpp:263

i.e. this line of code, which looks like it is intended to be deprecated anyway:
https://github.com/IBAMR/IBAMR/blob/master/ibtk/src/utilities/AppInitializer.cpp#L263

==

I understand the purpose of this -- if one doesn't register the Silo writer for an IB case, then this will take care of it. However given that it breaks restarts for purely Eulerian cases, do you think it's safe to remove it at this point in time?

sign issue?

Ref

F -= P * J * FF_inv_trans * normal_face[qp];

This should be F += ....

The reason being fluid should experience an opposite reaction. Force on the surface of solid is

f_pressure_solid = -p *n * da
f_pressure_fluid = - f_pressure_solid

f_pressure_fluid should be spread on the Eulerian grid

IB/implicit examples -- problem with input files

All the IB/implicit examples compile fine, but the examples fail with the message that they lack any definition of stokes_ib_precond_db required by src/IB/IBImplicitStaggeredHierarchyIntegrator.cpp

The reference I find to that is in line 175 in IBImplicitStaggeredHierarchyIntegrator:

   if (!d_solve_for_position)
    {
        Pointer<Database> stokes_ib_pc_db = input_db->getDatabase("stokes_ib_precond_db");
        d_stokes_solver = new IBImplicitStaggeredStokesSolver(object_name, stokes_ib_pc_db);
        ins_hier_integrator->setStokesSolver(d_stokes_solver);
    }

What are valid entries for stokes_ib_precond_db in the input file?
What would be a sane default in IBImplicitStaggeredHierarchyIntegrator.cpp for this if no preconditioner is provided in the input database?
(The problem is this value is being referenced without any check to see if it exists!)

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.