update src

This commit is contained in:
张壹 2021-07-22 19:28:50 +08:00
parent 393ffdee91
commit 38ef3a6811
6 changed files with 11 additions and 13 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
tet-file = data/pipeline/pipeline
mag-file = data/pipeline/magz.txt
site-file = data/pipeline/site.txt
obs-file = data/pipeline/pipeline
tet-file = data/prism/prism.1
mag-file = (0,0,200)
site-file = -30/30/-30/30/10/81/81
obs-file = data/prism/prism
cal-type = potential gradient tensor

View File

@ -1,10 +1,6 @@
#include "magtet.h"
magtet::magtet(){}
magtet::~magtet(){}
void magtet::read_tet(std::string tet_name)
{
gctl::read_Tetgen_node(tet_name, node_);
@ -140,7 +136,7 @@ void magtet::cal_tensors()
v1 = *ele_[e].fget(i, 1) - *ele_[e].fget(i, 0);
v2 = *ele_[e].fget(i, 2) - *ele_[e].fget(i, 0);
nf = gctl::cross(v1, v2).normal();
// The space is declared by the read_magz() function
// The space is declared by the init_magz() function
ele_para_[e].fnorm[i] = nf;
for (int j = 0; j < 3; ++j)
@ -151,7 +147,7 @@ void magtet::cal_tensors()
ele_para_[e].etang[j+i*3] = gctl::cross(nf, ne);
}
ele_para_[e].mag_amp[i] = gctl::dot(magz_[e], ele_para_[e].fnorm[i]);
ele_para_[e].mag_amp[i] = gctl::dot(magz_[e], nf);
}
// link magtet_para to tetrahedron's attribute

View File

@ -19,6 +19,11 @@
#define RUN_ECHO(action, msg) do {std::clog << msg << "... \n"; action;} while(0);
/**
* @brief
*
* att指针上
*/
struct magtet_para
{
double mag_amp[4];
@ -28,9 +33,6 @@ struct magtet_para
class magtet
{
public:
magtet();
virtual ~magtet();
void read_tet(std::string tet_name);
void init_magz(std::string para);
void init_site(std::string para);