You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.7 KiB
104 lines
2.7 KiB
// BC.H
|
|
#ifndef BC_H
|
|
#define BC_H
|
|
#include "vtr.h"
|
|
#include "Constants.h"
|
|
#include "../dgtd-performance.hpp"
|
|
|
|
#define pecType 1000000
|
|
#define portType 100000
|
|
|
|
#define pmcType 1
|
|
#define abcType 2
|
|
#define constE 3
|
|
#define impType 4
|
|
#define planeWaveType 5
|
|
#define outputSurfType 6
|
|
#define nonConformal 7
|
|
|
|
// Added additional boundary condition to support PML (qi jian)
|
|
#define pmlType 11
|
|
|
|
#define DomainInterFaceType 12
|
|
#define fieldPlaneType -100
|
|
|
|
class bc {
|
|
friend class FemGrp;
|
|
// friend class FemGrpBalancing;
|
|
friend int bcTypeConvert(char *);
|
|
friend class face;
|
|
|
|
private:
|
|
int bType; //number of the bc corresponding to the numbers set in the defines
|
|
int pNum; //number of port
|
|
int bNum; //id in file .bc
|
|
char name[StrLenShort]; //name of the bc
|
|
fp_t rval; //impedance of the bc
|
|
fp_t magE; //Field intensity of the bc
|
|
fp_t cval; //TODO: it is just the impedance of the bc //120Pi for PWs
|
|
vtr field; //Field intensity vector of the bc
|
|
|
|
// Plane Wave
|
|
fp_t theta; //angle of excitation
|
|
fp_t phi; // used for plane wave excitations
|
|
vtr PW_ro; //position where the PW starts
|
|
|
|
// port
|
|
int PortFlag;
|
|
vtr PortDirection;
|
|
vtr LocRo;
|
|
vtr LocR1;
|
|
|
|
public:
|
|
// constructor
|
|
bc(int = 0);
|
|
|
|
bool isPort(const int);
|
|
|
|
// set functions
|
|
void set_bType(int);
|
|
void set_name(char *);
|
|
void set_cval(fp_t, fp_t);
|
|
void set_rval(fp_t);
|
|
void set_pNum(int);
|
|
void set_bNum(int);
|
|
void set_magE(fp_t);
|
|
void SETFIELD(fp_t, fp_t, fp_t);
|
|
|
|
// Plane Wave excitations
|
|
void setTheta(fp_t);
|
|
void setPhi(fp_t);
|
|
void setPW_ro(fp_t rox, fp_t roy, fp_t roz){PW_ro.setvtr(rox, roy, roz);}
|
|
|
|
// get functions
|
|
int getbType();
|
|
int getbNum();
|
|
char* getName();
|
|
fp_t get_ABCImpVal(){return rval;}
|
|
fp_t getMagE(){return magE;}
|
|
fp_t get_PortImpVal(){return rval;}
|
|
fp_t getRval(){return rval;}
|
|
fp_t getCval(){return rval;}
|
|
//Plane Wave excitations
|
|
fp_t getTheta();
|
|
fp_t getPhi();
|
|
vtr getField();
|
|
vtr getPW_ro(){return PW_ro;}
|
|
|
|
|
|
// Port excitations
|
|
void set_LocalOrigin(fp_t rox, fp_t roy, fp_t roz){LocRo.setvtr(rox, roy, roz);}
|
|
void set_LocalR1(fp_t r1x, fp_t r1y, fp_t r1z){LocR1.setvtr(r1x, r1y, r1z);}
|
|
void set_PortFlag(int flag){PortFlag = flag;}
|
|
void set_PortDirection(fp_t r1x, fp_t r1y, fp_t r1z){PortDirection.setvtr(r1x, r1y, r1z);}
|
|
vtr get_PortDirection(){return PortDirection;}
|
|
vtr get_Ro(){return LocRo;}
|
|
vtr get_R1(){return LocR1;}
|
|
int get_PortFlag(){return PortFlag;}
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|