gcc compatibility

Place here all posts related to implementation and source codes. This forum is rather technical and reserved for programmers.
valerio
Posts: 10
Joined: Mon Jan 14, 2008 1:56 pm

gcc compatibility

Postby valerio » Sun Oct 25, 2009 10:20 am

Hi Marc,
just an idea: the header qtbwave.h can be modified the following way, to get compatibility with gcc using pure C calls.

Additionally: do you also have a C wrapper for ellipticity calculation?
I'm asking only because I don't want to reinvent the wheel ( :D ), otherwise I'll try to add it my self (hope I'll be able!)
Ciao and thanks.

-------------------------------------------------------------
# ifndef QTBWAVE_H
# define QTBWAVE_H

#ifdef __cplusplus
extern "C" {
#endif

void dispersion_curve_init_();
void dispersion_curve_rayleigh_( int * nLayers, double * h, double * vp, double * vs, double * rho,
int * nSamples, double * omega,
int * nModes, double * slowness );
void dispersion_curve_love_( int * nLayers, double * h, double * vp, double * vs, double * rho,
int * nSamples, double * omega,
int * nModes, double * slowness );

#ifdef __cplusplus
}
#endif

# endif // QTBWAVE_H

valerio
Posts: 10
Joined: Mon Jan 14, 2008 1:56 pm

Postby valerio » Mon Oct 26, 2009 8:20 am

I propose the following modification for qtbwave.cpp and qtbwave.h, to include ellipticity calculation (and peak may be, see attachment).
Regarding the calculation of ellipticity peaks, I notice that with some complex models and setting the precision (dispersion.setPrecision( 1e-15 );) the program crash. Is that because the function is experimental or I'm doing something wrong? :-)

Ciao and thanks
Attachments
qtbwave.h
(907 Bytes) Downloaded 296 times
qtbwave.c
(4.77 KiB) Downloaded 277 times


Return to “Developer's corner”

Who is online

Users browsing this forum: No registered users and 1 guest