Re: [ibamr-dev] Compiling issue while adding a new class "SuperposeWaveGenerator"

14 views
Skip to first unread message

Amneet Bhalla

unread,
Mar 11, 2021, 11:19:44 PM3/11/21
to ibam...@googlegroups.com, ibamr...@googlegroups.com
@David: do we have instructions on how to add new classes in IBAMR written down somewhere?

On Thu, Mar 11, 2021 at 7:04 PM 'zeng...@umn.edu' via IBAMR Developers <ibam...@googlegroups.com> wrote:
Hi all,

I am considering generating the inlet waves using the focused wave method. So I want to build another new class "SuperposeWaveGenerator", instead of using the current class "IrregularWaveGenerator". 

Thus, I build copies of all files related "IrregularWaveGenerator" and replace the "Irregular" keywords with "Superpose" in all files. Here is what I have tried.

// ---------------------------------------------------------------------------------------------------------------------------------

1. Build SuperposeWaveBcCoef.cpp and SuperposeWaveGenerator.cpp under the directory src/wave_generation/, similar to the IrregularWaveBcCoef.cpp and IrregularWaveGenerator.cpp in that directory.

2. Build SuperposeWaveBcCoef.h and SuperposeWaveGenerator.h under the directory  include/ibamr/, similar to the IrregularWaveBcCoef.h and IrregularWaveGenerator.h in that directory.

3. Add 
../include/ibamr/SuperposeWaveBcCoef.h \

../include/ibamr/SuperposeWaveGenerator.h \

../src/wave_generation/SuperposeWaveBcCoef.cpp \

../src/wave_generation/SuperposeWaveGenerator.cpp \
in lib/Makefile.am

4. Add the header file 


#include <ibamr/SuperposeWaveBcCoef.h>

#include <ibamr/SuperposeWaveGenerator.h>

and some "SuperposeWave" related codes

in examples/wave_tank/ex0/example.cpp

// ---------------------------------------------------------------------------------------------------------------------------------

However, when I try to compile /wave_tank/ex0/example.cpp, it seems that the "SuperposeWave" related codes are not added correctly. The IBAMR can not identify the new added codes and compile them.

The errors are:

/mnt/d/Linuxfiles/ibamrtest_32waves/example.cpp:340: undefined reference to `IBAMR::SuperposeWaveBcCoef::SuperposeWaveBcCoef(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, SAMRAI::tbox::Pointer<SAMRAI::tbox::Database>, SAMRAI::tbox::Pointer<SAMRAI::geom::CartesianGridGeometry<2> >)'
/mnt/d/Linuxfiles/ibamrtest_32waves/example.cpp:402: undefined reference to `IBAMR::SuperposeWaveGenerator::SuperposeWaveGenerator(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, SAMRAI::tbox::Pointer<SAMRAI::tbox::Database>)'
/mnt/d/Linuxfiles/ibamrtest_32waves/example.cpp:551: undefined reference to `typeinfo for IBAMR::SuperposeWaveGenerator'
/mnt/d/Linuxfiles/ibamrtest_32waves/example.cpp:555: undefined reference to `IBAMR::SuperposeWaveGenerator::printWaveData(std::basic_ofstream<char, std::char_traits<char> >&) const'
collect2: error: ld returned 1 exit status
Makefile:32: recipe for target 'main2d' failed
make: *** [main2d] Error 1

Any suggestions? 


--
You received this message because you are subscribed to the Google Groups "IBAMR Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibamr-dev/3d87fe53-e4e6-46b0-a5ba-6016c2263cadn%40googlegroups.com.
--
--Amneet 



Boyce Griffith

unread,
Mar 11, 2021, 11:46:00 PM3/11/21
to noreply-spamdigest via IBAMR Users, ibam...@googlegroups.com

On Mar 11, 2021, at 11:19 PM, Amneet Bhalla <mail2...@gmail.com> wrote:

@David: do we have instructions on how to add new classes in IBAMR written down somewhere?

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 view this discussion on the web visit https://groups.google.com/d/msgid/ibamr-users/CAMETWJ2Op8EYrr6LXMBMqbVJ2fbM9%2Bb-x0S9H%3DrLW%2Bg-w9dLUA%40mail.gmail.com.

Yadong Zeng

unread,
Mar 12, 2021, 8:18:15 PM3/12/21
to ibamr...@googlegroups.com, ibam...@googlegroups.com
Thanks, Prof. Boyce Griffith and Prof. Amneet Bhalla. I solved the above problem.

An additional question to Prof. Amneet Bhalla, there are two classes "IrregularWaveBcCoef" and "IrregularWaveGenerator". I found they share some similar functions like setBcCoefs, getSurfaceElevation, and getVelocity. Are there some reasons? 

From my understanding, the class "IrregularWaveBcCoef" is used for setting physical bcs for the variables. The "IrregularWaveGenerator" class is only used when we want to absorb the reflection waves from the WECs. In another word, we do not need to use  "IrregularWaveGenerator" class if we only want to generate the waves without putting the WECs in the computational domain. In this situation, we can just comment on the codes from line https://github.com/IBAMR/IBAMR/blob/7db7a19ef14a7018dbceaebca3ed035986a7bb22/examples/wave_tank/ex0/example.cpp#L344 to line https://github.com/IBAMR/IBAMR/blob/7db7a19ef14a7018dbceaebca3ed035986a7bb22/examples/wave_tank/ex0/example.cpp#L377          

Am I correct?

Thanks in advance.




--

Yadong (Jordan) Zeng

Ph.D. Candidate

Department of Mechanical Engineering  

University of Minnesota 

Amneet Bhalla

unread,
Mar 13, 2021, 1:03:01 AM3/13/21
to ibamr...@googlegroups.com, ibam...@googlegroups.com
Yes, that’s correct. IrregularWaveGenerator absorbs reflected waves from WECs towards the wave generator boundary.

--
--Amneet 



Boyce Griffith

unread,
Mar 15, 2021, 12:05:46 PM3/15/21
to IBAMR Developers, ibamr...@googlegroups.com
Amneet, would it make sense to combine these two classes (IrregularWaveBcCoef and IrregularWaveGenerator) that provides both interfaces?

Amneet Bhalla

unread,
Mar 15, 2021, 12:08:08 PM3/15/21
to ibamr...@googlegroups.com, IBAMR Developers
Not really. They have different purpose. Also one is essential and the other is optional.

--
--Amneet 



Reply all
Reply to author
Forward
0 new messages