1 Star 1 Fork 0

yong/HFSSTrans

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TransWorker.h 3.93 KB
一键复制 编辑 原始数据 按行查看 历史
yong 提交于 2023-01-02 21:34 . 增加输出几何体ID
#ifndef TRANS_WORKER_H
#define TRANS_WORKER_H
#include <vector>
#include <string>
#include <map>
#include "Node.h"
enum FreqSwpType {
SWP_DISCRETE = 0,
SWP_INTERPOL = 1,
SWP_FAST = 2
};
const std::string LUMP_PORT = "Lump_Port";
const std::string WAVE_PORT = "Wave_Port";
struct Tetr {
int node[4];
int boud[4];
int iBody;
int iMedi;
};
struct Tria {
int node[3];
int iBoud;
int iTetr;
};
struct Material {
std::string sName;
double dEps{ 1 };
double dTan{ 0 };
double dSgm{ 0 };
double dMiu{ 1 };
};
struct Geometry {
std::string sName;
std::string sMedi;
bool bSolvInside{ false };
int iObjID{ -1 };
int iSrcID{ -1 };
int iMedi{ -1 };
std::vector<int> vFaceID;
};
struct Boundary {
std::string sName;
std::string sType;
int id{ -1 };
int iEdgeDn{ -1 };
int iEdgeUp{ -1 };
int iTriaHead;
int iTriaTail;
double dZ0{ 50.0 };
std::vector<int> vVoluID;
std::vector<int> vFaceID;
};
struct PortInfo {
std::string sName;
std::string sType;
int id{ -1 };
int iEdgeDn{ -1 };
int iEdgeUp{ -1 };
Node rc;
Node ei;
Node norm;
double a{ 0.0 };
double b{ 0.0 };
double dZ0{ 50.0 };
double dMag{ 1.0 };
double dPha{ 0.0 };
};
struct FEM_Para {
std::string sFreqUnit{ "GHz" };
std::string sSwpType{ "Interpolate" }; // type of frequency sweep
double dFreq0{ 0 };
double dMinFreq{ 0 };
double dMaxFreq{ 0 };
int iNumFreq{ 0 }; // number of frequency
int iNumFars{ 0 }; // number of far field plane
int iNumNear{ 0 }; // number of near field plane
int iCurrent{ 0 }; // set whether calculate surface curren
int iGauss{ 4 }; // number of Gauss point
int iOrder{ 2 }; // order of basis function
int iDrivnEigen{ 0 }; // solution type : 0--Driven, 1--Eigenmode
int iEigModeNum{ 1 }; // mode number of Eigenmode
int iSolverType{ 0 }; // solver type : 0--LU, 1--Iteration, 2--DDM
int iMaxIterNum{ 9 }; // max number of iteration for driven mode
int iAdapMinNum{ 1 }; // min iteration step for adaptive mode
int iAdapPassed{ 1 }; // min pass time for adaptive mode
int iAdapMaxNum{ 0 }; // max iteration step for adaptive mode
double dEigMinFreq{ 0 }; // min frequency(GHz) for Eigenmode
double dMaxIterErr{ 0.01 }; // max iteration error if using iterate solver
double dAdaptRatio{ 0.3 }; // max ratio of mesh to be adaptive (xx%)
double dAdaptDelta{ 0.1 }; // max delta S-parameter for driven mode
bool bSolvInside{ false };
};
class TransWorker {
public:
TransWorker() = default;
~TransWorker() = default;
bool fnParseCmdArgu(int argc, char *argv[], std::string &sAedt, std::string &sMesh);
bool fnLoadAedtFile(std::string &sName);
bool fnLoadMeshFile(std::string &sName);
bool fnGetPortCoord();
bool fnOutputMsh(std::string &sName);
bool fnOutputTet(std::string &sName);
bool fnOutputXml(std::string &sName);
private:
std::vector<Node> m_vR;
std::vector<Tetr> m_vTetr;
std::vector<Tria> m_vTria;
std::vector<Material> m_vMedi;
std::vector<Geometry> m_vGeom;
std::vector<Boundary> m_vBoud;
std::vector<PortInfo> m_vLump;
std::vector<PortInfo> m_vPort;
std::map<int, int> m_mapGeom;
FEM_Para m_para;
void fnLoadMaterial(std::string &sTxt);
void fnLoadGeometry(std::string &sTxt);
void fnLoadBoundary(std::string &sTxt);
void fnLoadSolvPara(std::string &sTxt);
void fnLoadSolution(std::string &sTxt);
void fnLoadPostPara(std::string &sTxt);
bool fnLinkGeomMedi();
void fnSetBoundFace(std::map<int, int>& mapFace);
void fnGetBoundTria();
void fnTetrMaterial();
void fnLinkTriaTetr();
void fnGetWireFrame(PortInfo &port, std::vector<int> &vWire);
};
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/chn-cem/hfsstrans.git
git@gitee.com:chn-cem/hfsstrans.git
chn-cem
hfsstrans
HFSSTrans
master

搜索帮助