Method for Respiratory Simulation

310 views
Skip to first unread message

Yan Shang

unread,
Apr 6, 2018, 8:34:40 PM4/6/18
to IBAMR Users
Hi everyone,

Currently, I am trying to use IBAMR to simulate the collapse in human upper airway during obstructive sleep apnea.

But I am new to IB and I hardly find any tutorial documentation for IBAMR on Internet.

Is there anyone studying similar topic? Or can I have a detailed suggestion for how I should start with IBAMR?

Many thanks!

Yan

Amneet Bhalla

unread,
Apr 6, 2018, 8:37:28 PM4/6/18
to ibamr...@googlegroups.com
Is it possible for you to send the fluid-structure interaction equations and model to describe evolution of quantities (if any)?

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.
To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



Yan Shang

unread,
Apr 7, 2018, 12:28:26 PM4/7/18
to ibamr...@googlegroups.com
Hi Amneet,

Formerly, I used Fluent with RANS k-w SST model to simulate flow in upper airway reconstructed from CT scanning. 

For fluid-structure interaction study, there is little article concerns with this specific topic. I saw someone used ABAQUS with NLGEOM option to do the FSI simulation, in which tissues were assumed to be isotropic linear elastic materials.

I am not clear which solver I should use and how to generate mesh based on CT scanning(DICOM format)

Thanks for your support.

Yan

Amneet Bhalla

unread,
Apr 7, 2018, 12:36:07 PM4/7/18
to ibamr...@googlegroups.com
I think it is cerainly possible to do this with IBFE approach. Take a look at examples/IBFE for some simple examples. You can run those examples and visualize the output. The material response is defined in the main.cpp files as simple C functions. You would also need to convert your medical images to finite element mesh that IBAMR can read. There are many IBAMR users and developers who can assist you further with your questions as many applications use IBFE method.

 

On Sat, Apr 7, 2018 at 9:28 AM Yan Shang <yansha...@gmail.com> wrote:
Hi Amneet,

Formerly, I used Fluent with RANS k-w SST model to simulate flow in upper airway reconstructed from CT scanning. 

For fluid-structure interaction study, there is little article concerns with this specific topic. I saw someone used ABAQUS with NLGEOM option to do the FSI simulation, in which tissues were assumed to be isotropic linear elastic materials.

I am not clear which solver I should use and how to generate mesh based on CT scanning(DICOM format)

Thanks for your support.

Yan
2018-04-06 19:36 GMT-05:00 Amneet Bhalla <mail2...@gmail.com>:
Is it possible for you to send the fluid-structure interaction equations and model to describe evolution of quantities (if any)?
On Fri, Apr 6, 2018 at 5:15 PM, Yan Shang <yansha...@gmail.com> wrote:
Hi everyone,

Currently, I am trying to use IBAMR to simulate the collapse in human upper airway during obstructive sleep apnea.

But I am new to IB and I hardly find any tutorial documentation for IBAMR on Internet.

Is there anyone studying similar topic? Or can I have a detailed suggestion for how I should start with IBAMR?

Many thanks!

Yan

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--Amneet 



Yan Shang

unread,
Apr 7, 2018, 12:50:14 PM4/7/18
to ibamr...@googlegroups.com
Great! I'll try it.

It is so encouraging to meet you and other excellent people here!



2018-04-07 11:35 GMT-05:00 Amneet Bhalla <mail2...@gmail.com>:
I think it is cerainly possible to do this with IBFE approach. Take a look at examples/IBFE for some simple examples. You can run those examples and visualize the output. The material response is defined in the main.cpp files as simple C functions. You would also need to convert your medical images to finite element mesh that IBAMR can read. There are many IBAMR users and developers who can assist you further with your questions as many applications use IBFE method.
On Sat, Apr 7, 2018 at 9:28 AM Yan Shang <yansha...@gmail.com> wrote:
Hi Amneet,

Formerly, I used Fluent with RANS k-w SST model to simulate flow in upper airway reconstructed from CT scanning. 

For fluid-structure interaction study, there is little article concerns with this specific topic. I saw someone used ABAQUS with NLGEOM option to do the FSI simulation, in which tissues were assumed to be isotropic linear elastic materials.

I am not clear which solver I should use and how to generate mesh based on CT scanning(DICOM format)

Thanks for your support.

Yan
2018-04-06 19:36 GMT-05:00 Amneet Bhalla <mail2...@gmail.com>:
Is it possible for you to send the fluid-structure interaction equations and model to describe evolution of quantities (if any)?
On Fri, Apr 6, 2018 at 5:15 PM, Yan Shang <yansha...@gmail.com> wrote:
Hi everyone,

Currently, I am trying to use IBAMR to simulate the collapse in human upper airway during obstructive sleep apnea.

But I am new to IB and I hardly find any tutorial documentation for IBAMR on Internet.

Is there anyone studying similar topic? Or can I have a detailed suggestion for how I should start with IBAMR?

Many thanks!

Yan

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.

Amneet Bhalla

unread,
Apr 7, 2018, 12:55:14 PM4/7/18
to ibamr...@googlegroups.com
These may also be useful for your reference:

http://www.medengphys.com/article/S1350-4533(17)30182-0/fulltext

Boyce and others can point you to more references as well. 

Yan Shang

unread,
Apr 7, 2018, 3:40:19 PM4/7/18
to IBAMR Users
It is really helpful!

But I came across a error when I run example in IBFE/ex0

I have re-built my OpenMPI and PETSc. But nothing changed.
ShangYan@ibamr:~/sfw/ibamr/ibamr-objs-opt/examples/IBFE/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 Apr 5 2018 at 23:32:41 ***IBFEMethod: mesh part 0 is using SECOND order LAGRANGE finite elements.[0]PETSC ERROR: ------------------------------------------------------------------------[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash.[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------[0]PETSC ERROR: Signal received[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.[0]PETSC ERROR: Petsc Release Version 3.7.2, Jun, 05, 2016 [0]PETSC ERROR: ./main2d on a linux-opt named ibamr by ShangYan Sat Apr 7 19:23:09 2018[0]PETSC ERROR: Configure options --CC=/home/ShangYan/sfw/linux/openmpi/1.10.2/bin/mpicc --CXX=/home/ShangYan/sfw/linux/openmpi/1.10.2/bin/mpicxx --FC=/home/ShangYan/sfw/linux/openmpi/1.10.2/bin/mpif90 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --FOPTFLAGS=-O3 --LDFLAGS="-L/home/ShangYan/sfw/linux/openmpi/1.10.2/lib -Wl,-rpath,/home/ShangYan/sfw/linux/openmpi/1.10.2/lib" --with-default-arch=0 --PETSC_ARCH=linux-opt --with-debugging=0 --with-c++-support --with-hypre=1 --download-hypre=1 --with-x=0[0]PETSC ERROR: #1 User provided function() line 0 in unknown file--------------------------------------------------------------------------MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLDwith errorcode 59.NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.You may or may not see output from other processes, depending onexactly when Open MPI kills them.--------------------------------------------------------------------------
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



Amneet Bhalla

unread,
Apr 7, 2018, 5:58:45 PM4/7/18
to ibamr...@googlegroups.com
Are non-IBFE examples (say examples/navier_stokes or examples/IB) working for you in serial and parallel? 

To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



Shashank Acharya

unread,
Apr 7, 2018, 6:04:06 PM4/7/18
to IBAMR Users
Hi Yan,

It would be difficult to know what's wrong without looking at all the logs. So I can't be much help there.

But to make life easy, I had written a script to install IBAMR so that anyone can use it. You can find it here:


Just ignore the "module" part and make sure you provide the right location for openmpi (do this: $ which mpiexec and copy the part of the path before /bin and set that as $OPENMPI_DIR variable's value)

Keep pressing enter when it asks you to and IBAMR should be installed. I've given this script to students who newly joined our lab so they can install IBAMR asap and it works perfectly.

Hope you can find it useful as well.

Yan Shang

unread,
Apr 7, 2018, 9:20:24 PM4/7/18
to IBAMR Users
IBFE/ex2,3,7,8 and IB/ex0, NS/ex0 work well.

I am running IBAMR on Ubuntu 16.04 in google cloud compute engine with 8 vCPUs, 40 GB memory / Intel Broadwell

Amneet Bhalla

unread,
Apr 7, 2018, 9:38:10 PM4/7/18
to ibamr...@googlegroups.com
Then that particular example needs to be fixed. Nothing wrong with your build of IBAMR :-)

To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users+unsubscribe@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



Boyce Griffith

unread,
Apr 7, 2018, 9:40:26 PM4/7/18
to ibamr...@googlegroups.com
Is this a parallel run? We do test these in serial but do not currently do any automatic parallel tests. (I am planning on upgrading the CI server over the summer, and hopefully we can start running some more demanding tests in the nightly builds.)

Yan Shang

unread,
Apr 8, 2018, 3:40:38 PM4/8/18
to IBAMR Users
Yes, it is a parallel run. Can I assign the number of cores used in the program? 

Boyce Griffith

unread,
Apr 8, 2018, 3:45:58 PM4/8/18
to ibamr...@googlegroups.com


On Apr 8, 2018, at 3:40 PM, Yan Shang <yansha...@gmail.com> wrote:

Yes, it is a parallel run. Can I assign the number of cores used in the program? 


How many cores?

Yan Shang

unread,
Apr 8, 2018, 3:51:34 PM4/8/18
to IBAMR Users
8 vCPUs on Google Cloud Compute Engine.

Boyce Griffith

unread,
Jun 20, 2018, 11:22:32 PM6/20/18
to IBAMR Users
Sorry for the slow response; I cannot replicate this error. Can you verify whether it still occurs with an updated pull of IBAMR master?

Yicheng Chen

unread,
Jul 21, 2021, 9:00:01 AM7/21/21
to IBAMR Users
Hi Yan,
I am newly to IBAMR and want to perform the IB simulation in human upper airway, too.
I have the same problem as you, including how to use this excellent tool. Please let me know have you achieved your expected work? May I ask for your guidance?

Best regards
YIcheng Chen
在2018年4月8日星期日 UTC+8 上午12:50:14<Yan Shang> 写道:
Great! I'll try it.

It is so encouraging to meet you and other excellent people here!



2018-04-07 11:35 GMT-05:00 Amneet Bhalla <mail2...@gmail.com>:
I think it is cerainly possible to do this with IBFE approach. Take a look at examples/IBFE for some simple examples. You can run those examples and visualize the output. The material response is defined in the main.cpp files as simple C functions. You would also need to convert your medical images to finite element mesh that IBAMR can read. There are many IBAMR users and developers who can assist you further with your questions as many applications use IBFE method.
On Sat, Apr 7, 2018 at 9:28 AM Yan Shang <yansha...@gmail.com> wrote:
Hi Amneet,

Formerly, I used Fluent with RANS k-w SST model to simulate flow in upper airway reconstructed from CT scanning. 

For fluid-structure interaction study, there is little article concerns with this specific topic. I saw someone used ABAQUS with NLGEOM option to do the FSI simulation, in which tissues were assumed to be isotropic linear elastic materials.

I am not clear which solver I should use and how to generate mesh based on CT scanning(DICOM format)

Thanks for your support.

Yan
2018-04-06 19:36 GMT-05:00 Amneet Bhalla <mail2...@gmail.com>:
Is it possible for you to send the fluid-structure interaction equations and model to describe evolution of quantities (if any)?
On Fri, Apr 6, 2018 at 5:15 PM, Yan Shang <yansha...@gmail.com> wrote:
Hi everyone,

Currently, I am trying to use IBAMR to simulate the collapse in human upper airway during obstructive sleep apnea.

But I am new to IB and I hardly find any tutorial documentation for IBAMR on Internet.

Is there anyone studying similar topic? Or can I have a detailed suggestion for how I should start with IBAMR?

Many thanks!

Yan

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

To post to this group, send email to ibamr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--Amneet 



--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.

Boyce Griffith

unread,
Jul 26, 2021, 12:13:05 PM7/26/21
to IBAMR Users

On Jul 21, 2021, at 3:56 AM, Yicheng Chen <cychi...@gmail.com> wrote:

Hi Yan,
I am newly to IBAMR and want to perform the IB simulation in human upper airway, too.
I have the same problem as you, including how to use this excellent tool. Please let me know have you achieved your expected work? May I ask for your guidance?

Are there specific problems that you are encountering that we could try to help with?

— Boyce

Yicheng Chen

unread,
Jul 27, 2021, 8:48:26 AM7/27/21
to IBAMR Users
Hi professor,

I am newly learning to use IBAMR and hope to simulate the human upper airway with periodic respirations in the future. It looks easy to start my study by a simple grid replacement in simulation. There are some elementary question.

1. Which example I should learn? In IBFE, or other solver?
     The human upper airway (UA) can be considered as a flexible tube, or a partly-elastic tube (part of its wall is flexible, and others are rigid). If we want to simulate UA in 3d IB method, which example I should learn?

2.  How I can import own geometry into IB simulation? 
     In other talk about ConstrainIB simulation, we can replace fish's geometry easily by change the eel2d (https://groups.google.com/g/ibamr-users/c/tVQkCZT2rms). 
     How can I import my mesh in IBFE simulation? The mesh looks like a tube and be generated by Gmsh (may be exodusii in the future). Do I need to preload it by libmesh? 

3. How I can change the boundary condition of UA simulation? 
    For example, I want to apply periodic velocity inlet, or change the elastic modulus in some part of the UA. Which file I need to learn?

Thank you very much for your kind help!

— Yicheng Chen

Yicheng Chen

unread,
Sep 7, 2021, 11:04:07 PM9/7/21
to IBAMR Users
Professor,

I encountered the same problem with Yan when I am trying to simulation the deformation of upper airway.

This is the error report:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
At beginning of timestep # 0
Simulation time is 0

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger

[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: User provided function() line 0 in  unknown file (null)
[Eason:20273] *** Process received signal ***
[Eason:20273] Signal: Aborted (6)
[Eason:20273] Signal code:  (-6)
[Eason:20273] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f3c25ac3980]
[Eason:20273] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f3c23ceafb7]
[Eason:20273] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f3c23cec921]
[Eason:20273] [ 3] /home/eason/sfw/linux/petsc/3.13.4/linux-opt/lib/libpetsc.so.3.13(+0x196e78)[0x7f3c2749be78]
[Eason:20273] [ 4] /home/eason/sfw/linux/petsc/3.13.4/linux-opt/lib/libpetsc.so.3.13(PetscError+0x12f)[0x7f3c2749842f]
[Eason:20273] [ 5] /home/eason/sfw/linux/petsc/3.13.4/linux-opt/lib/libpetsc.so.3.13(PetscSignalHandlerDefault+0x245)[0x7f3c2749c7f5]
[Eason:20273] [ 6] /home/eason/sfw/linux/petsc/3.13.4/linux-opt/lib/libpetsc.so.3.13(+0x1978b7)[0x7f3c2749c8b7]
[Eason:20273] [ 7] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040)[0x7f3c23ceb040]
[Eason:20273] [ 8] ./main3d(+0x8f6b2)[0x55590972b6b2]
[Eason:20273] [ 9] ./main3d(+0x28f4a2)[0x55590992b4a2]
[Eason:20273] [10] ./main3d(+0x2c775d)[0x55590996375d]
[Eason:20273] [11] ./main3d(+0x14804b)[0x5559097e404b]
[Eason:20273] [12] ./main3d(+0x4e38bf)[0x555909b7f8bf]
[Eason:20273] [13] ./main3d(+0x794aa)[0x5559097154aa]
[Eason:20273] [14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f3c23ccdbf7]
[Eason:20273] [15] ./main3d(+0x8df2a)[0x555909729f2a]
[Eason:20273] *** End of error message ***
Aborted (core dumped)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
And I try to run it in gdb, the debugger reported:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Starting program: /home/eason/my_ibamr_app/main3d input3d
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee6cc700 (LWP 20329)]
...
[New Thread 0x7fffc16ba700 (LWP 20347)]
[Thread 0x7fffc16ba700 (LWP 20347) exited]
...
[Thread 0x7fffee6cc700 (LWP 20329) exited]
[New Thread 0x7fffc16ba700 (LWP 20352)]
[New Thread 0x7fffc3ebb700 (LWP 20353)]


Thread 1 "main3d" received signal SIGSEGV, Segmentation fault.
0x00005555555e36b2 in ModelData::wall_PK1_stress_function
(libMesh::TensorValue<double>&, libMesh::TensorValue<double> const&, libMesh::Point const&, libMesh::Point const&, libMesh::Elem*, std::vector<std::vector<double, std::allocator<double> > const*, std::allocator<std::vector<double, std::allocator<double> > const*> > const&, std::vector<std::vector<libMesh::VectorValue<double>, std::allocator<libMesh::VectorValue<double> > > const*, std::allocator<std::vector<libMesh::VectorValue<double>, std::allocator<libMesh::VectorValue<double> > > const*> > const&, double, void*) [clone .part.99] ()

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

Does it mean there sre some wrong when I set the PK1 force?
The function is a replication of IBFE/ex6: 
wall_PK1_stress_function(TensorValue<double>& PP,
                                               const TensorValue<double>& FF,
                                               const libMesh::Point& /*X*/,
                                               const libMesh::Point& s,
                                               Elem* const /*elem*/,
                                               const vector<const vector<double>*>& /*var_data*/,
                                               const vector<const vector<VectorValue<double> >*>& /*grad_var_data*/,
                                               double /*time*/,
                                               void* ctx)
{
             const ElasticityData* const elasticity_data = reinterpret_cast<ElasticityData*>(ctx);
             if (s(2) > 6.285 && s(2) < 7.64) //&& s(1) < 4.83 && s(1) > 3.10)
             {
                        static const TensorValue<double> II(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
                        const TensorValue<double> CC = FF.transpose() * FF;
                        const TensorValue<double> EE = 0.5 * (CC - II);
                        const TensorValue<double> SS = elasticity_data->lambda_s * EE.tr() * II + 2.0 * elasticity_data->mu_s * EE;
                        PP = FF * SS;
              }
             else
             {
                        PP.zero();
             } 
在2021年7月27日星期二 UTC+8 上午12:13:05<boy...@gmail.com> 写道:

Boyce Griffith

unread,
Sep 7, 2021, 11:14:09 PM9/7/21
to noreply-spamdigest via IBAMR Users
Are you passing in a context (ctx) pointer to a variable of type ElasticityData when setting up the stress function?

Yicheng Chen

unread,
Sep 7, 2021, 11:28:32 PM9/7/21
to IBAMR Users
Yes, I set the ctx pointer follow our example IBFE/ex6, professor. 

Firstly, the program get the elasticity data by using:
ElasticityData(Pointer<Database> input_db)
: c1_s(input_db->getDouble("C1_S")),
kappa_s(input_db->getDouble("KAPPA_S")),
mu_s(input_db->getDouble("MU_S")),
lambda_s(input_db->getDouble("LAMBDA_S"))

Thus it calculate the force using the EalasticityData. The “const ElasticityData* const elasticity_data = reinterpret_cast<ElasticityData*>(ctx)”  seems to be neccessary if we applied elasticity data in force function like "elasticity_data->lambda_s"

Boyce Griffith

unread,
Sep 7, 2021, 11:36:31 PM9/7/21
to ibamr...@googlegroups.com
On Sep 7, 2021, at 11:28 PM, Yicheng Chen <cychi...@gmail.com> wrote:

Yes, I set the ctx pointer follow our example IBFE/ex6, professor. 

Firstly, the program get the elasticity data by using:
ElasticityData(Pointer<Database> input_db)
: c1_s(input_db->getDouble("C1_S")),
kappa_s(input_db->getDouble("KAPPA_S")),
mu_s(input_db->getDouble("MU_S")),
lambda_s(input_db->getDouble("LAMBDA_S"))

Thus it calculate the force using the EalasticityData. The “const ElasticityData* const elasticity_data = reinterpret_cast<ElasticityData*>(ctx)”  seems to be neccessary if we applied elasticity data in force function like "elasticity_data->lambda_s”

How are you passing this when registering the PK1 stresses?

Yicheng Chen

unread,
Sep 8, 2021, 12:32:28 AM9/8/21
to IBAMR Users
Thank you professor! The bug comes from a wrong code when registing of PK1 stresses. I lost the blue parts follow.

IBFEMethod::LagBodyForceFcnData wall_tether_force_data(wall_tether_force_function, std::vector<IBTK::SystemData>(), elasticity_data_ptr);
IBFEMethod::PK1StressFcnData wall_PK1_stress_data(wall_PK1_stress_function, std::vector<IBTK::SystemData>(), elasticity_data_ptr);
ib_method_ops->registerLagBodyForceFunction(wall_tether_force_data, 0);
ib_method_ops->registerPK1StressFunction(wall_PK1_stress_data, 0);

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
However, a new problem of parallel simulation emerged:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
At beginning of timestep # 0
Simulation time is 0
--------------------------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.

--------------------------------------------------------------------------
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD
with errorcode 50162059.


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.
--------------------------------------------------------------------------
[1]PETSC ERROR: ------------------------------------------------------------------------
[1]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[1]PETSC ERROR: or see https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[1]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[1]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[1]PETSC ERROR: to get more information on the crash.
[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[1]PETSC ERROR: Signal received
[1]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[1]PETSC ERROR: Petsc Release Version 3.13.4, Aug 01, 2020
[1]PETSC ERROR: ./main3d on a linux-opt named Eason by eason Wed Sep 8 12:17:01 2021
[1]PETSC ERROR: Configure options --CC=/home/eason/sfw/linux/openmpi/4.0.2/bin/mpicc --CXX=/home/eason/sfw/linux/openmpi/4.0.2/bin/mpicxx --FC=/home/eason/sfw/linux/openmpi/4.0.2/bin/mpif90 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --FOPTFLAGS=-O3 --PETSC_ARCH=linux-opt --with-debugging=0 --download-hypre=1 --with-x=0
[1]PETSC ERROR: #1 User provided function() line 0 in unknown file
[2]PETSC ERROR: ------------------------------------------------------------------------
[2]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[2]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[2]PETSC ERROR: or see https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[2]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[2]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[2]PETSC ERROR: to get more information on the crash.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
It looks like a MPI error? But the gdb only told us "Program terminated with signal SIGKILL, killed", and IB3d.log shows the program stopped when spreading Lagrangian force to the Eulerian grid.

Boyce Griffith

unread,
Sep 8, 2021, 12:37:54 AM9/8/21
to noreply-spamdigest via IBAMR Users
The batch system can cause your job to end if it exceeded the amount of memory, cores/processes, or time that was requested when submitting the job. You may need to check with your system administrators to determine the cause.

— Boyce

Yicheng Chen

unread,
Sep 8, 2021, 1:18:12 AM9/8/21
to IBAMR Users
Yes sir! I will check and try to determine the cause.

Thank you so much for your kind help.

Best regards,

-Yicheng Chen
Reply all
Reply to author
Forward
0 new messages