gctl_potential/lib/potential/mkernel_tesseroid.h

132 lines
5.0 KiB
C
Raw Normal View History

2024-09-10 19:56:41 +08:00
/********************************************************
*
*
*
*
*
*
* Geophysical Computational Tools & Library (GCTL)
*
* Copyright (c) 2022 Yi Zhang (yizhang-geo@zju.edu.cn)
*
* GCTL is distributed under a dual licensing scheme. You can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 2
* of the License, or (at your option) any later version. You should have
* received a copy of the GNU Lesser General Public License along with this
* program. If not, see <http://www.gnu.org/licenses/>.
*
* If the terms and conditions of the LGPL v.2. would prevent you from using
* the GCTL, please consider the option to obtain a commercial license for a
* fee. These licenses are offered by the GCTL's original author. As a rule,
* licenses are provided "as-is", unlimited in time for a one time fee. Please
* send corresponding requests to: yizhang-geo@zju.edu.cn. Please do not forget
* to include some description of your company and the realm of its activities.
* Also add information on how to contact you by electronic and paper mail.
******************************************************/
#ifndef _GCTL_MAG_KERNEL_TESSEROID_H
#define _GCTL_MAG_KERNEL_TESSEROID_H
#include "gm_data.h"
#ifdef GCTL_POTENTIAL_MAGTESS
namespace gctl
{
/**
* @brief tesseroid
*
*/
struct magtess_para
{
// 磁化矢量参数
double bx, by, bz, h, f;
// 地磁场磁化倾角(弧度)
double geo_iarc, geo_darc;
magtess_para()
{
bx = by = bz = h = f = geo_iarc = geo_darc = NAN;
}
};
///< 带magtess_para属性的tesseroid结构体
typedef type_tesseroid<magtess_para> mag_tesseroid;
/**
* @brief S设置 Tesseroid
*
* @param out_para
* @param inclina
* @param declina
*/
void set_geomag_angles(array<magtess_para> &out_para, const array<double> &inclina, const array<double> &declina);
/**
* @brief Tesseroid
*
* @param in_tess
* @param out_para
* @param mag_B
*/
void callink_magnetic_para(array<mag_tesseroid> &in_tess, array<magtess_para> &out_para,
const point3dc &mag_B);
/**
* @brief Tesseroid
*
* @param in_tess
* @param out_para
* @param mag_B
*/
void callink_magnetic_para(array<mag_tesseroid> &in_tess, array<magtess_para> &out_para,
const array<point3dc> &mag_B);
/**
* @brief Calculate the magnetic parameters of given tesseroid elements respect to the spherical coordinates.
*
* @note The value of magnetic susceptibility is taken as one here. This is usefull for calculating
* kernel matrix of the magnetic anomalies.
*
* @param in_tess Input tesseroids
* @param out_para Output parameters
* @param inclina_deg inclination angle of the magnetization vector with respect to the local Cartesian coordinates at every tesseroid elements
* @param declina_deg declination angle of the magnetization vector with respect to the local Cartesian coordinates at every tesseroid elements
* @param field_tense Tense of the Earth's magnetic field
*/
void callink_magnetic_para_earth_sph(array<mag_tesseroid> &in_tess, array<magtess_para> &out_para,
double inclina_deg, double declina_deg, double field_tense = GCTL_T0);
/**
* @brief tesseroid单元体的磁异常核函数
*
* @param out_kernel
* @param ele tesseroid单元体
* @param obsp
* @param comp_id
* @param gauss_order
* @param verbose
*/
void magkernel(matrix<double> &out_kernel, const array<mag_tesseroid> &ele, const array<point3ds> &obsp,
magnetic_field_type_e comp_id = Za, int gauss_order = 4, verbose_type_e verbose = FullMsg);
/**
* @brief tesseroid单元体的磁异常
*
* @param out_obs
* @param ele tesseroid单元体
* @param obsp
* @param sus
* @param comp_id
* @param gauss_order
* @param verbose
*/
void magobser(array<double> &out_obs, const array<mag_tesseroid> &ele, const array<point3ds> &obsp,
const array<double> &sus, magnetic_field_type_e comp_id = Za, int gauss_order = 4,
verbose_type_e verbose = FullMsg);
}
#endif // GCTL_POTENTIAL_MAGTESS
#endif // _GCTL_MAG_KERNEL_TESSEROID_H