gctl_potential/lib/potential/gkernel_tricone.h

153 lines
7.7 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_GRAV_KERNEL_TRICONE_H
#define _GCTL_GRAV_KERNEL_TRICONE_H
#include "gm_data.h"
namespace gctl
{
struct gravcone_para
{
tensor F[4]; ///< tensor products of four facets
tensor E[12]; ///< tensor products of six edges
double edglen[12]; ///< edge lengths of six edges
};
typedef type_tricone<gravcone_para> grav_tri_cone; ///< 带gravcone_para属性的三角锥结构体
/**
* @brief 使 GJI的文章
*/
struct gravcone_para_gji : public gravcone_para
{
point3dc nface[4];
point3dc nedge[12];
//注意三棱锥的侧面与侧面的外法线矢量相对于半径的偏导数为0 所以nf_rj为顶面三角形相对于三个顶点半径的偏导数
//三棱锥顶面的偏导数矢量
point3dc nf_rj[3]; //顶面的单位矢量相对于一个标量(顶点半径)的偏导数
point3dc nj2_rj[3]; //顶面三角形中与顶点相连的逆时针边及其侧面相对于半径的偏导数
point3dc n2j_rj[3]; //侧面上的偏导数 侧面外法线矢量的偏导数为0
point3dc n3j_rj[3];
point3dc nj3_rj[3];
point3dc n23_rj[3];
};
typedef type_tricone<gravcone_para_gji> grav_tri_cone_gji; ///< 带gravcone_para_gji属性的三角锥结构体
/**
* @brief calculate the gravity parameters of given element type.
*
* @param in_tri Input elements
* @param out_para The output parameter array
*/
void callink_gravity_para(array<grav_tri_cone> &in_cone, array<gravcone_para> &out_para);
/**
* @brief calculate the gravity parameters of given element type.
*
* @param in_tri Input elements
* @param out_para The output parameter array
*/
2025-01-08 11:26:13 +08:00
void callink_gravity_para(array<grav_tri_cone_gji> &in_cone, array<gravcone_para_gji> &out_para);
2024-09-10 19:56:41 +08:00
/**
* @brief
*
* @note
*
* @param out_kernel
* @param[in] ele
* @param[in] ops
* @param[in] comp_id
* @param[in] show_progress
*/
void gkernel(matrix<double> &out_kernel, const array<grav_tri_cone> &ele, const array<point3ds> &obsp,
gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg);
/**
* @brief
*
* @note
*
* @param out_obs m^2/s^2m/s^21/s^2
* @param[in] ele m
* @param[in] obsp m
* @param[in] rho kg/m^3
* @param[in] comp_id
* @param[in] verbose
*/
void gobser(array<double> &out_obs, const array<grav_tri_cone> &ele, const array<point3ds> &obsp,
const array<double> &rho, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg);
/**
* @brief xy和z方向的重力值
*
* @param out_obs m^2/s^2m/s^21/s^2
* @param[in] ele m
* @param[in] obsp m
* @param[in] rho kg/m^3
* @param[in] verbose
*/
void gobser(array<point3dc> &out_obs, const array<grav_tri_cone> &ele, const array<point3dc> &obsp,
const array<double> &rho, verbose_type_e verbose = FullMsg);
/**
* @brief
*
* @note
*
* @param out_obs
* @param[in] ele
* @param[in] obsp
* @param[in] rho
* @param[in] comp_id
* @param[in] verbose
*/
void gobser(array<double> &out_obs, const array<grav_tri_cone_gji> &ele, const array<point3ds> &obsp,
const array<double> &rho, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg);
/**
* @brief GJI文章
*
* @param out_mGrad
* @param[in] vert_neighList
* @param[in] obsp
* @param[in] rho
* @param[in] verts_ptr
* @param[in] ang_limit -1
* @param[in] comp_id
* @param[in] verbose
*/
void gobser_model_gradient(array<double> &out_mGrad, const array<std::vector<grav_tri_cone_gji*> > &vert_neighList,
const array<double> &obs_diff, const array<point3ds> &obsp, const array<double> &rho,
const array<vertex3dc> *verts_ptr = nullptr, double ang_limit = -1.0,
gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg);
}
#endif // _GCTL_GRAV_KERNEL_TRICONE_H