Giter VIP home page Giter VIP logo

piezomag's Introduction

piezomag

A program and library for calculating seismomagnetic field, i.e. geomagnetic field change caused by earthquake due to piezomagnetic effect.

Description

This package contains library for calculating seismomagnetic field due to a vertical or inclined rectangular fault located inside magnetized perfectly-elastic half space. Using this library, you can calculate seismomagnetic field easily, and any fault strike angle, dip angle and all types of fault motion, strike-slip, dip-slip and tensile-opening are available for this library.

Installation

Run the following commands on the top source directry:

$ ./autogen.sh
$ ./configure
$ make
$ make install

By above, shared library (libpiezomag.so) is installed in your system. By default, this library and relevant files, such as include files, are installed under /usr/local. To change this, specify prefix as follows:

$ ./configure --prefix=hoge

Public functions

This library provides the following public functions:

bool
fread_params (FILE *fp, fault_params *fault, magnetic_params *mag);

This function reads parameter file and store user-defined parameters to the following pre-allocated structures:

fault_params *fault: structure which stores fault parameters.

magnetic_params *mag: structure which stores crustal magnetic properties.

For the details of the members of above structures, see "include/piezomag.h", and for the details of the parameter file, see "work/example_params.data" (an example of parameter file).

These structures are allocated by the following functions, respectivly:

fault_params *fault_params_alloc (void)

magnetic_params *magnetic_params_alloc (void)


bool
seismomagnetic_field_term (MagComp component, SeismoMagTerm term,
    const fault_params *fault, const magnetic_params *mag,
    double xobs, double yobs, double zobs, double *val);

This function calculates the seismomagnetic field on obervation point (xobs(NS), yobs(EW), zobs(DownUp)).

MagComp component specifies the output magnetic component and it takes the following values:

typedef enum {
 MAG_COMP_F    =  0, // total force
 MAG_COMP_X    =  1, // x(NS) component
 MAG_COMP_Y    =  2, // y(EW) component
 MAG_COMP_Z    =  3, // z(DownUp) component
} MagComp;

SeismoMagTerm term specifies the output seismomagnetic term:

typedef enum {
 SEISMO_MAG_MAIN       =  1 << 0, // main term (0)
 SEISMO_MAG_MIRROR     =  1 << 1, // mirror image (H0)
 SEISMO_MAG_SUBMIRROR  =  1 << 2, // sub-mirror image(HI, HIII or HII)
 // total seismomagnetic field (0 + H0 + (HI, HIII or HII))
 SEISMO_MAG_TOTAL = SEISMO_MAG_MAIN | SEISMO_MAG_MIRROR | SEISMO_MAG_SUBMIRROR
} SeismoMagTerm;

If obervation point is on the singular point, this function returns false.


void
fprintf_seismomagnetic_field_term (FILE *stream,
    MagComp component, SeismoMagTerm term,
    const fault_params *fault, const magnetic_params *mag,
    double xobs1, double xobs2, double dx,
    double yobs1, double yobs2, double dy, double zobs);

This function calculates the seismomagnetic field on the grid x=[xobs1:dx:xobs2], y=[yobs1:dy:yobs2] and z=zobs. If observation point is singular point, result is not printed out. Output format is X(NS) Y(EW) VAL.


bool
seismomagnetic_field (MagComp component,
    const fault_params *fault, const magnetic_params *mag,
    double xobs, double yobs, double zobs, double *val);
void
fprintf_seismomagnetic_field (FILE *stream,
    MagComp component,
    const fault_params *fault, const magnetic_params *mag,
    double xobs1, double xobs2, double dx,
    double yobs1, double yobs2, double dy, double zobs);

These are equivalent to the followings, respectively:

seismomagnetic_field_term (component, SEISMO_MAG_TOTAL, fault, mag,
    xobs, yobs, zobs, &val);
fprintf_seismomagnetic_field_term (component, SEISMO_MAG_TOTAL, fault, mag,
    xobs1, xobs2, dx, yobs1, yobs2, dy, zobs);

Example program

An example program "main/piez" is also contained in this package. This prograrm calls the function fprintf_seismomagnetic_field () and outputs seismomagnetic field on the grid of x=[xobs1:dx:xobs2], y=[yobs1:dy:yobs2] and z=zobs. To run this program, do

$ ./main/piez -f <parameter file name> -r <xobs1/xobs2/yobs1/yobs2> -i <dx/dy>
  -z <zobs> -o <output component: 0 = total force, 1 = X, 2 = Y and 3 = Z>

For more details, see "work/calcomp.sh" (an example script to run main/piez).

Licence

LGPL

References

M. Utsugi, Y. Nishida and Y. Sasai, Piezomagnetic potentials due to an inclined rectangular fault in a semi-infinite medium, Geophysical Journal International, Vol. 140, Issue 3, pp.479โ€“492, 2000. DOI: 10.1046/j.1365-246X.2000.00953.x

piezomag's People

Watchers

James Cloos avatar Mitsuru Utsugi avatar

Forkers

dal3006

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.