136 lines
6.2 KiB
C++
136 lines
6.2 KiB
C++
/********************************************************
|
|
* ██████╗ ██████╗████████╗██╗
|
|
* ██╔════╝ ██╔════╝╚══██╔══╝██║
|
|
* ██║ ███╗██║ ██║ ██║
|
|
* ██║ ██║██║ ██║ ██║
|
|
* ╚██████╔╝╚██████╗ ██║ ███████╗
|
|
* ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝
|
|
* 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_TRIANGLE_H
|
|
#define _GCTL_MAG_KERNEL_TRIANGLE_H
|
|
|
|
#include "gm_data.h"
|
|
#include "gctl/poly/triangle.h"
|
|
#include "gctl/utility/progress_bar.h"
|
|
|
|
namespace gctl
|
|
{
|
|
/**
|
|
* @brief 三角形磁性参数结构体
|
|
*
|
|
*/
|
|
struct magtri_para
|
|
{
|
|
point3dc B; ///< 磁化强度矢量 directional magnetizations
|
|
tensor F; ///< 面的张量积
|
|
tensor E[3]; ///< 边的张量积
|
|
double edglen[3]; ///< 边的长度
|
|
};
|
|
|
|
typedef type_triangle<magtri_para> mag_triangle; ///< 带磁性参数三角形结构体
|
|
|
|
/**
|
|
* @brief Calculate the magnetic parameters of given triangular elements.
|
|
*
|
|
* @param in_tri Input and output elements
|
|
* @param out_para Output parameters
|
|
* @param mag_B magnetization vectors
|
|
*/
|
|
void callink_magnetic_para(array<mag_triangle> &in_tri, array<magtri_para> &out_para, const array<point3dc> &mag_B);
|
|
|
|
/**
|
|
* @brief Calculate the magnetic parameters of given triangular elements.
|
|
*
|
|
* @note The value of magnetic susceptibility is taken as one here. This is usefull for calculating
|
|
* kernel matrix of the magnetic anomalies.
|
|
*
|
|
* @param in_tri Input and output elements
|
|
* @param out_para Output parameters
|
|
* @param inclina_deg inclination angle
|
|
* @param declina_deg declination angle
|
|
* @param field_tense Tense of the Earth's magnetic field
|
|
*/
|
|
void callink_magnetic_para_earth(array<mag_triangle> &in_tri, array<magtri_para> &out_para,
|
|
double inclina_deg, double declina_deg, double field_tense = GCTL_T0);
|
|
|
|
/**
|
|
* @brief Calculate the magnetic parameters of given triangular elements wrt. 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_tri Input elements
|
|
* @param out_para Output parameters
|
|
* @param inclina_deg inclination angle of the magnetization vector wrt. the local Cartesian coordinates at every triangular elements
|
|
* @param declina_deg declination angle of the magnetization vector wrt. the local Cartesian coordinates at every triangular elements
|
|
* @param mag_vec Output magnetization vectors (This is useful for data visualization)
|
|
* @param field_tense Tense of the Earth's magnetic field
|
|
*/
|
|
void callink_magnetic_para_earth_sph(array<mag_triangle> &in_tri, array<magtri_para> &out_para,
|
|
double inclina_deg, double declina_deg, array<point3dc> *mag_vec = nullptr, double field_tense = GCTL_T0);
|
|
|
|
/**
|
|
* @brief Calculate the magnetic componments of a single tetrahedron element under the Cartesian coordinates
|
|
*
|
|
* @param out_b The output magnetic componments
|
|
* @param a_ele The tetrahedron element
|
|
* @param a_op The observation point
|
|
* @return point3dc The returned magnetic componments
|
|
*/
|
|
point3dc magkernel_single(const mag_triangle &a_ele, const point3dc &a_op);
|
|
|
|
/**
|
|
* @brief Calculate the magnetic componments of a single tetrahedron element under the spherical coordinates
|
|
*
|
|
* @param a_ele The tetrahedron element
|
|
* @param a_op The observation point
|
|
* @param R_ptr Pointer of the coordinate transform matrix. This is used to speed up the computation.
|
|
* @return point3dc The returned magnetic componments
|
|
*/
|
|
point3dc magkernel_single(const mag_triangle &a_ele, const point3ds &a_op, tensor *R_ptr = nullptr);
|
|
|
|
/**
|
|
* @brief Calculate the magnetic componments of tetrahedron elements under the Cartesian coordinates
|
|
*
|
|
* @param out_obs Output magnetic field data. Directional components are stored accordingly.
|
|
* @param ele The tetrahedron elements
|
|
* @param obsp The observation points
|
|
* @param sus Magnetic susceptibilities
|
|
* @param verbose Output info level
|
|
*/
|
|
void magobser(array<point3dc> &out_obs, const array<mag_triangle> &ele, const array<point3dc> &obsp,
|
|
const array<double> &sus, verbose_type_e verbose = FullMsg);
|
|
|
|
/**
|
|
* @brief Calculate the magnetic componments of tetrahedron elements under the Spherical coordinates
|
|
*
|
|
* @param out_obs Output magnetic field data. Directional components are stored accordingly.
|
|
* @param ele The tetrahedron elements
|
|
* @param obsp The observation points
|
|
* @param sus Magnetic susceptibilities
|
|
* @param verbose Output info level
|
|
*/
|
|
void magobser(array<point3dc> &out_obs, const array<mag_triangle> &ele, const array<point3ds> &obsp,
|
|
const array<double> &sus, verbose_type_e verbose = FullMsg);
|
|
};
|
|
|
|
#endif // _GCTL_MAG_KERNEL_TRIANGLE_H
|