new FDTD extension: conducting sheet model
This commit is contained in:
parent
3abe10848d
commit
317ef82993
107
FDTD/extensions/OptimizeCondSheetParameter.m
Normal file
107
FDTD/extensions/OptimizeCondSheetParameter.m
Normal file
@ -0,0 +1,107 @@
|
||||
function OptimizeCondSheetParameter
|
||||
% function OptimizeCondSheetParameter
|
||||
%
|
||||
% internal openEMS function to create the "cond_sheet_parameter.h" header
|
||||
% file containing optimized parameter values for the conducting sheet model
|
||||
%
|
||||
% (c) 2012: Thorsten Liebig, thorsten.liebig@gmx.de
|
||||
|
||||
|
||||
close all
|
||||
clear
|
||||
clc
|
||||
|
||||
|
||||
X = [1 1 1 1 1];
|
||||
lb = zeros(size(X));
|
||||
ub = ones(size(X))*1000;
|
||||
|
||||
|
||||
Omega = linspace(0,20,51);
|
||||
Omega = Omega(2:end);
|
||||
|
||||
Omega_fine = linspace(0,20,15001);
|
||||
Omega_fine = Omega_fine(2:end);
|
||||
|
||||
options = optimset('fzero');
|
||||
% options = optimset(options,'Display','iter')
|
||||
options = optimset(options,'MaxFunEvals',5000);
|
||||
options = optimset(options,'MaxIter',5000);
|
||||
|
||||
omg_stop_str = [];
|
||||
omg_critical_20 = [];
|
||||
omg_critical_5 = [];
|
||||
g_str = [];
|
||||
r1_str= [];
|
||||
r2_str= [];
|
||||
l1_str= [];
|
||||
l2_str= [];
|
||||
|
||||
numPara = 30;
|
||||
factor = 1.5;
|
||||
|
||||
for p = 1:numPara
|
||||
|
||||
X = lsqnonlin(@(X)CalcYDiff(Omega,X),X,lb,ub,options);
|
||||
|
||||
omg_stop_str = [omg_stop_str num2str(Omega(end),10) ','];
|
||||
g_str = [g_str num2str(X(1),10) ','];
|
||||
r1_str = [r1_str num2str(X(2),10) ','];
|
||||
l1_str = [l1_str num2str(X(3),10) ','];
|
||||
r2_str = [r2_str num2str(X(4),10) ','];
|
||||
l2_str = [l2_str num2str(X(5),10) ','];
|
||||
|
||||
Ys = tanh((1+1j)*sqrt(Omega_fine))/(1+1j)./sqrt(Omega_fine);
|
||||
|
||||
err = (CalcYDiff(Omega_fine,X))./real(1./Ys);
|
||||
|
||||
fc = Omega_fine(find(abs(err)>0.2,1,'last'));
|
||||
if (isempty(fc))
|
||||
fc = 0;
|
||||
end
|
||||
omg_critical_20 = [omg_critical_20 num2str(fc,10) ','];
|
||||
|
||||
fc = Omega_fine(find(abs(err)>0.05,1,'last'));
|
||||
if (isempty(fc))
|
||||
fc = 0;
|
||||
end
|
||||
omg_critical_5 = [omg_critical_5 num2str(fc,10) ','];
|
||||
|
||||
% disp(['max error: ' num2str(max(abs(err)*100)) ])
|
||||
% figure
|
||||
% plot(Omega_fine,err*100,'g--');
|
||||
|
||||
Omega_fine = Omega_fine*factor;
|
||||
Omega = Omega*factor;
|
||||
end
|
||||
|
||||
%% write to file
|
||||
fid = fopen('cond_sheet_parameter.h','w');
|
||||
|
||||
fprintf(fid,'// This is a list of conducting sheet model parameter for different ranges of omega = w/w0\n');
|
||||
fprintf(fid,'// This file was created automatically using Matlab: OptimizeCondSheetParameter.m \n');
|
||||
fprintf(fid,'// Do not change this file! \n');
|
||||
fprintf(fid,'// Creation: %s \n\n',datestr(now));
|
||||
|
||||
|
||||
|
||||
fprintf(fid,'unsigned int numOptPara=%d;\n',numPara);
|
||||
|
||||
fprintf(fid,'double omega_stop[%d]={%s};\n',numPara,omg_stop_str(1:end-1));
|
||||
fprintf(fid,'double omega_critical_5[%d]={%s};\n',numPara,omg_critical_5(1:end-1));
|
||||
fprintf(fid,'double omega_critical_20[%d]={%s};\n',numPara,omg_critical_20(1:end-1));
|
||||
fprintf(fid,'double g[%d]={%s};\n',numPara,g_str(1:end-1));
|
||||
fprintf(fid,'double r1[%d]={%s};\n',numPara,r1_str(1:end-1));
|
||||
fprintf(fid,'double l1[%d]={%s};\n',numPara,l1_str(1:end-1));
|
||||
fprintf(fid,'double r2[%d]={%s};\n',numPara,r2_str(1:end-1));
|
||||
fprintf(fid,'double l2[%d]={%s};\n',numPara,l2_str(1:end-1));
|
||||
|
||||
fclose(fid);
|
||||
|
||||
function Ydiff = CalcYDiff(omega, X)
|
||||
|
||||
Ys = tanh((1+1j)*sqrt(omega))/(1+1j)./sqrt(omega);
|
||||
|
||||
Y = X(1) + 1./(X(2)+1j*omega*X(3)) + 1./(X(4)+1j*omega*X(5));
|
||||
|
||||
Ydiff = real(1./Ys)-real(1./Y);
|
14
FDTD/extensions/cond_sheet_parameter.h
Normal file
14
FDTD/extensions/cond_sheet_parameter.h
Normal file
@ -0,0 +1,14 @@
|
||||
// This is a list of conducting sheet model parameter for different ranges of omega = w/w0
|
||||
// This file was created automatically using Matlab: OptimizeCondSheetParameter.m
|
||||
// Do not change this file!
|
||||
// Creation: 08-May-2012 09:49:53
|
||||
|
||||
unsigned int numOptPara=30;
|
||||
double omega_stop[30]={20,30,45,67.5,101.25,151.875,227.8125,341.71875,512.578125,768.8671875,1153.300781,1729.951172,2594.926758,3892.390137,5838.585205,8757.877808,13136.81671,19705.22507,29557.8376,44336.7564,66505.1346,99757.7019,149636.5529,224454.8293,336682.2439,505023.3659,757535.0488,1136302.573,1704453.86,2556680.79};
|
||||
double omega_critical_5[30]={0,0,0,1.566,6.8445,10.4085,15.1419375,22.30284375,33.45426562,50.28391406,75.42587109,113.1388066,169.70821,254.5623149,381.8434724,572.7652086,859.1478129,1288.721719,1933.082579,2899.623869,4349.435803,6524.153704,9786.230557,14679.34583,22019.01875,33028.52813,35503.14262,119084.5097,180444.8486,704280.3349};
|
||||
double omega_critical_20[30]={0,0,0,0,1.41075,2.7135,4.100625,5.90034375,8.6113125,12.86571094,19.37545312,29.06317969,43.59476953,65.3921543,98.08823145,147.1323472,220.6985208,331.0477811,496.5716717,744.8575075,1117.286261,1675.929392,2513.894088,3770.841132,5656.261698,8484.392547,10504.48601,11363.02573,11135.76522,7499.596983};
|
||||
double g[30]={0.1370843401,0.1244327709,0.1087425925,0.09215450299,0.07639249525,0.06239206861,0.05068701937,0.04124161681,0.03364925947,0.0274825647,0.02244156564,0.01832317373,0.01496080786,0.01221545053,0.009973874666,0.008143635713,0.006649251918,0.005429092739,0.00443283702,0.003619397792,0.002955227653,0.002412935361,0.001970156167,0.001608629812,0.001313423397,0.001072422468,0.0009031383439,0.0007674973627,0.0006482579571,0.0005450699565};
|
||||
double r1[30]={1.302754546,1.2992612,1.320033314,1.41829213,1.674326257,2.138770494,2.769126112,3.498802047,4.311446869,5.266204065,6.443980095,7.893402541,9.667414736,11.84010502,14.50110421,17.76014698,21.75163911,26.64019322,32.6274156,39.96021835,48.94100192,59.94011376,73.41109983,89.90930992,110.1195785,134.8631576,149.2770459,153.5258961,148.9373215,119.3522908};
|
||||
double l1[30]={0.9542567116,0.9412051444,0.8999655165,0.8189903271,0.702028543,0.5718817624,0.4577262324,0.3689027719,0.3004106661,0.2455514861,0.2005633225,0.1637496639,0.1337010005,0.1091664663,0.0891340699,0.07277768839,0.05942276018,0.04851850861,0.03961522618,0.03234573021,0.02641021614,0.02156389712,0.0176069076,0.01437606898,0.0117376269,0.009584103516,0.008750848841,0.008547706786,0.00854127488,0.008801399365};
|
||||
double r2[30]={10.62245057,10.21952962,10.24755832,10.99147713,12.70450822,15.59830718,19.55714986,24.32580904,29.88733852,36.55680626,44.75374078,54.81575133,67.13533424,82.22360504,100.7029064,123.3353165,151.0542147,185.0027444,226.5809553,277.5035137,339.8704104,416.2534638,509.8022059,624.3729288,764.7279941,936.5525496,1000,999.9999981,999.999984,999.9999985};
|
||||
double l2[30]={0.7925524826,0.6926195458,0.5814718257,0.4784644339,0.3916667501,0.3204661897,0.2620413998,0.2140939121,0.1748272154,0.1427375388,0.1165424396,0.09515681664,0.07769522035,0.06343788358,0.05179681795,0.04229192785,0.03453121766,0.02819462457,0.0230208182,0.01879642336,0.01534721999,0.01253095815,0.01023149158,0.008353988465,0.006820957973,0.005569332359,0.004553963932,0.003696380632,0.002978504727,0.002391295771};
|
233
FDTD/extensions/operator_ext_conductingsheet.cpp
Normal file
233
FDTD/extensions/operator_ext_conductingsheet.cpp
Normal file
@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Thorsten Liebig (Thorsten.Liebig@gmx.de)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "operator_ext_conductingsheet.h"
|
||||
#include "tools/array_ops.h"
|
||||
#include "tools/constants.h"
|
||||
#include "cond_sheet_parameter.h"
|
||||
|
||||
Operator_Ext_ConductingSheet::Operator_Ext_ConductingSheet(Operator* op, double f_max) : Operator_Ext_LorentzMaterial(op)
|
||||
{
|
||||
m_f_max = f_max;
|
||||
}
|
||||
|
||||
bool Operator_Ext_ConductingSheet::BuildExtension()
|
||||
{
|
||||
double dT = m_Op->GetTimestep();
|
||||
unsigned int pos[] = {0,0,0};
|
||||
double coord[3];
|
||||
unsigned int numLines[3] = {m_Op->GetNumberOfLines(0),m_Op->GetNumberOfLines(1),m_Op->GetNumberOfLines(2)};
|
||||
|
||||
m_Order = 0;
|
||||
vector<unsigned int> v_pos[3];
|
||||
int ****tanDir = Create_N_3DArray<int>(numLines);
|
||||
float ****Conductivity = Create_N_3DArray<float>(numLines);
|
||||
float ****Thickness = Create_N_3DArray<float>(numLines);
|
||||
|
||||
CSPrimitives* cs_sheet = NULL;
|
||||
double box[6];
|
||||
int nP, nPP;
|
||||
bool b_pos_on;
|
||||
bool disable_pos;
|
||||
for (pos[0]=0; pos[0]<numLines[0]; ++pos[0])
|
||||
{
|
||||
for (pos[1]=0; pos[1]<numLines[1]; ++pos[1])
|
||||
{
|
||||
for (pos[2]=0; pos[2]<numLines[2]; ++pos[2])
|
||||
{
|
||||
b_pos_on = false;
|
||||
disable_pos = false;
|
||||
// disable conducting sheet model inside the boundary conditions, especially inside a pml
|
||||
for (int m=0;m<3;++m)
|
||||
if ((pos[m]<=(m_Op->GetBCSize(2*m))) || (pos[m]>=(numLines[m]-m_Op->GetBCSize(2*m+1)-1)))
|
||||
disable_pos = true;
|
||||
|
||||
for (int n=0; n<3; ++n)
|
||||
{
|
||||
nP = (n+1)%3;
|
||||
nPP = (n+2)%3;
|
||||
|
||||
tanDir[n][pos[0]][pos[1]][pos[2]] = -1; //deactivate by default
|
||||
Conductivity[n][pos[0]][pos[1]][pos[2]] = 0; //deactivate by default
|
||||
Thickness[n][pos[0]][pos[1]][pos[2]] = 0; //deactivate by default
|
||||
|
||||
coord[0] = m_Op->GetDiscLine(0,pos[0]);
|
||||
coord[1] = m_Op->GetDiscLine(1,pos[1]);
|
||||
coord[2] = m_Op->GetDiscLine(2,pos[2]);
|
||||
coord[n] = m_Op->GetDiscLine(n,pos[n],true); //pos of E_n
|
||||
CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::CONDUCTINGSHEET, false, &cs_sheet);
|
||||
if (prop)
|
||||
{
|
||||
CSPropConductingSheet* cs_prop = dynamic_cast<CSPropConductingSheet*>(prop);
|
||||
if (cs_prop==NULL)
|
||||
return false; //sanity check, this should never happen
|
||||
if (cs_sheet==NULL)
|
||||
return false; //sanity check, this should never happen
|
||||
if (cs_sheet->GetDimension()!=2)
|
||||
continue;
|
||||
cs_sheet->SetPrimitiveUsed(true);
|
||||
|
||||
if (disable_pos)
|
||||
{
|
||||
m_Op->SetVV(n,pos[0],pos[1],pos[2], 0 );
|
||||
m_Op->SetVI(n,pos[0],pos[1],pos[2], 0 );
|
||||
continue;
|
||||
}
|
||||
|
||||
Conductivity[n][pos[0]][pos[1]][pos[2]] = cs_prop->GetConductivity();
|
||||
Thickness[n][pos[0]][pos[1]][pos[2]] = cs_prop->GetThickness();
|
||||
|
||||
if ((Conductivity[n][pos[0]][pos[1]][pos[2]]==0) || (Thickness[n][pos[0]][pos[1]][pos[2]]==0))
|
||||
{
|
||||
cerr << "Operator_Ext_ConductingSheet::BuildExtension: Warning: Zero conductivity or thickness detected... skipping node!" << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
cs_sheet->GetBoundBox(box);
|
||||
if (box[2*nP]!=box[2*nP+1])
|
||||
tanDir[n][pos[0]][pos[1]][pos[2]] = nP;
|
||||
if (box[2*nPP]!=box[2*nPP+1])
|
||||
tanDir[n][pos[0]][pos[1]][pos[2]] = nPP;
|
||||
b_pos_on = true;
|
||||
}
|
||||
}
|
||||
if (b_pos_on)
|
||||
{
|
||||
for (int n=0; n<3; ++n)
|
||||
v_pos[n].push_back(pos[n]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t numCS = v_pos[0].size();
|
||||
if (numCS==0)
|
||||
return false;
|
||||
|
||||
m_LM_Count.push_back(numCS);
|
||||
m_LM_Count.push_back(numCS);
|
||||
|
||||
m_Order = 2;
|
||||
m_volt_ADE_On = new bool[m_Order];
|
||||
m_volt_ADE_On[0] = m_volt_ADE_On[1]=true;
|
||||
m_curr_ADE_On = new bool[m_Order];
|
||||
m_curr_ADE_On[0] = m_curr_ADE_On[1]=false;
|
||||
|
||||
m_LM_pos = new unsigned int**[m_Order];
|
||||
m_LM_pos[0] = new unsigned int*[3];
|
||||
m_LM_pos[1] = new unsigned int*[3];
|
||||
|
||||
v_int_ADE = new FDTD_FLOAT**[m_Order];
|
||||
v_ext_ADE = new FDTD_FLOAT**[m_Order];
|
||||
i_int_ADE = NULL;
|
||||
i_ext_ADE = NULL;
|
||||
|
||||
v_int_ADE[0] = new FDTD_FLOAT*[3];
|
||||
v_ext_ADE[0] = new FDTD_FLOAT*[3];
|
||||
v_int_ADE[1] = new FDTD_FLOAT*[3];
|
||||
v_ext_ADE[1] = new FDTD_FLOAT*[3];
|
||||
|
||||
for (int n=0; n<3; ++n)
|
||||
{
|
||||
m_LM_pos[0][n] = new unsigned int[numCS];
|
||||
m_LM_pos[1][n] = new unsigned int[numCS];
|
||||
for (unsigned int i=0; i<numCS; ++i)
|
||||
{
|
||||
m_LM_pos[0][n][i] = v_pos[n].at(i);
|
||||
m_LM_pos[1][n][i] = v_pos[n].at(i);
|
||||
}
|
||||
v_int_ADE[0][n] = new FDTD_FLOAT[numCS];
|
||||
v_int_ADE[1][n] = new FDTD_FLOAT[numCS];
|
||||
v_ext_ADE[0][n] = new FDTD_FLOAT[numCS];
|
||||
v_ext_ADE[1][n] = new FDTD_FLOAT[numCS];
|
||||
}
|
||||
|
||||
unsigned int index;
|
||||
float w_stop = m_f_max*2*PI;
|
||||
float Omega_max=0;
|
||||
float G,L1,L2,R1,R2,Lmin;
|
||||
float G0, w0;
|
||||
float wtl; //width to length factor
|
||||
float factor=1;
|
||||
int t_dir=0; //tangential sheet direction
|
||||
unsigned int tpos[] = {0,0,0};
|
||||
unsigned int optParaPos;
|
||||
for (unsigned int i=0;i<numCS;++i)
|
||||
{
|
||||
pos[0]=m_LM_pos[0][0][i];pos[1]=m_LM_pos[0][1][i];pos[2]=m_LM_pos[0][2][i];
|
||||
tpos[0]=pos[0];tpos[1]=pos[1];tpos[2]=pos[2];
|
||||
index = m_Op->MainOp->SetPos(pos[0],pos[1],pos[2]);
|
||||
for (int n=0;n<3;++n)
|
||||
{
|
||||
t_dir = tanDir[n][pos[0]][pos[1]][pos[2]];
|
||||
G0 = Conductivity[n][pos[0]][pos[1]][pos[2]]*Thickness[n][pos[0]][pos[1]][pos[2]];
|
||||
w0 = 8.0/ G0 / Thickness[n][pos[0]][pos[1]][pos[2]]/__MUE0__;
|
||||
Omega_max = w_stop/w0;
|
||||
for (optParaPos=0;optParaPos<numOptPara;++optParaPos)
|
||||
if (omega_stop[optParaPos]>Omega_max)
|
||||
break;
|
||||
if (optParaPos>=numOptPara)
|
||||
{
|
||||
cerr << "Operator_Ext_ConductingSheet::BuildExtension(): Error, conductor thickness, conductivity or max. simulation frequency of interest is too high! Check parameter!" << endl;
|
||||
cerr << " --> max f: " << m_f_max << "Hz, Conductivity: " << Conductivity[n][pos[0]][pos[1]][pos[2]] << "S/m, Thickness " << Thickness[n][pos[0]][pos[1]][pos[2]]*1e6 << "um" << endl;
|
||||
optParaPos = numOptPara-1;
|
||||
}
|
||||
v_int_ADE[0][n][i]=0;
|
||||
v_ext_ADE[0][n][i]=0;
|
||||
v_int_ADE[1][n][i]=0;
|
||||
v_ext_ADE[1][n][i]=0;
|
||||
if (t_dir>=0)
|
||||
{
|
||||
wtl = m_Op->GetEdgeLength(n,pos)/m_Op->GetNodeWidth(t_dir,pos);
|
||||
factor = 1;
|
||||
if (tanDir[t_dir][tpos[0]][tpos[1]][tpos[2]]<0)
|
||||
factor = 2;
|
||||
--tpos[t_dir];
|
||||
if (tanDir[t_dir][tpos[0]][tpos[1]][tpos[2]]<0)
|
||||
factor = 2;
|
||||
|
||||
if (n==1)
|
||||
factor=1;
|
||||
|
||||
L1 = l1[optParaPos]/G0/w0*factor;
|
||||
L2 = l2[optParaPos]/G0/w0*factor;
|
||||
R1 = r1[optParaPos]/G0*factor;
|
||||
R2 = r2[optParaPos]/G0*factor;
|
||||
G = G0*g[optParaPos]/factor;
|
||||
|
||||
L1*=wtl;
|
||||
L2*=wtl;
|
||||
R1*=wtl;
|
||||
R2*=wtl;
|
||||
G/=wtl;
|
||||
|
||||
Lmin = L1;
|
||||
if (L2<L1)
|
||||
Lmin = L2;
|
||||
m_Op->EC_G[n][index]= G;
|
||||
m_Op->EC_C[n][index]= dT*dT/4.0*(16.0/Lmin + 1/L1 + 1/L2);
|
||||
m_Op->Calc_ECOperatorPos(n,pos);
|
||||
|
||||
v_int_ADE[0][n][i]=(2.0*L1-dT*R1)/(2.0*L1+dT*R1);
|
||||
v_ext_ADE[0][n][i]=dT/(L1+dT*R1/2.0)*m_Op->GetVI(n,pos[0],pos[1],pos[2]);
|
||||
v_int_ADE[1][n][i]=(2.0*L2-dT*R2)/(2.0*L2+dT*R2);
|
||||
v_ext_ADE[1][n][i]=dT/(L2+dT*R2/2.0)*m_Op->GetVI(n,pos[0],pos[1],pos[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
45
FDTD/extensions/operator_ext_conductingsheet.h
Normal file
45
FDTD/extensions/operator_ext_conductingsheet.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Thorsten Liebig (Thorsten.Liebig@gmx.de)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPERATOR_EXT_CONDUCTINGSHEET_H
|
||||
#define OPERATOR_EXT_CONDUCTINGSHEET_H
|
||||
|
||||
#include "FDTD/operator.h"
|
||||
#include "operator_ext_lorentzmaterial.h"
|
||||
|
||||
/*!
|
||||
FDTD extension for a conducting sheet model as described in:
|
||||
Lauer, A.; Wolff, I.; , "A conducting sheet model for efficient wide band FDTD analysis of planar waveguides and circuits," Microwave Symposium Digest, 1999 IEEE MTT-S International , vol.4, no., pp.1589-1592 vol.4, 1999
|
||||
doi: 10.1109/MWSYM.1999.780262
|
||||
URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=780262&isnumber=16934
|
||||
*/
|
||||
class Operator_Ext_ConductingSheet : public Operator_Ext_LorentzMaterial
|
||||
{
|
||||
public:
|
||||
Operator_Ext_ConductingSheet(Operator* op, double f_max);
|
||||
|
||||
virtual bool BuildExtension();
|
||||
|
||||
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {return true;}
|
||||
|
||||
virtual std::string GetExtensionName() const {return std::string("Conducting Sheet Extension");}
|
||||
|
||||
protected:
|
||||
double m_f_max;
|
||||
};
|
||||
|
||||
#endif // OPERATOR_EXT_CONDUCTINGSHEET_H
|
@ -33,6 +33,7 @@ class Operator : public Operator_Base
|
||||
friend class Engine;
|
||||
friend class Engine_Interface_FDTD;
|
||||
friend class Operator_Ext_LorentzMaterial; //we need to find a way around this... friend class Operator_Extension only would be nice
|
||||
friend class Operator_Ext_ConductingSheet; //we need to find a way around this... friend class Operator_Extension only would be nice
|
||||
friend class Operator_Ext_PML_SF_Plane;
|
||||
friend class Operator_Ext_Excitation;
|
||||
friend class Operator_Ext_UPML;
|
||||
@ -75,6 +76,9 @@ public:
|
||||
virtual void ApplyElectricBC(bool* dirs); //applied by default to all boundaries
|
||||
virtual void ApplyMagneticBC(bool* dirs);
|
||||
|
||||
virtual void SetBCSize(int dir, int size) {m_BC_Size[dir]=size;}
|
||||
virtual int GetBCSize(int dir) {return m_BC_Size[dir];}
|
||||
|
||||
//! Set a forced timestep to use by the operator
|
||||
virtual void SetTimestep(double ts) {dT = ts;}
|
||||
bool GetTimestepValid() const {return !m_InvaildTimestep;}
|
||||
@ -201,6 +205,9 @@ protected:
|
||||
//! Calculate and setup lumped elements
|
||||
virtual bool Calc_LumpedElements();
|
||||
|
||||
//! Store the size of the applied boundary conditions
|
||||
int m_BC_Size[6];
|
||||
|
||||
//store material properties for post-processing
|
||||
float**** m_epsR;
|
||||
float**** m_kappa;
|
||||
|
@ -17,4 +17,5 @@ function FDTD = SetCustomExcite(FDTD,f0,funcStr)
|
||||
|
||||
FDTD.Excitation.ATTRIBUTE.Type=10;
|
||||
FDTD.Excitation.ATTRIBUTE.f0=f0;
|
||||
FDTD.Excitation.ATTRIBUTE.Function=funcStr;
|
||||
FDTD.Excitation.ATTRIBUTE.Function=funcStr;
|
||||
FDTD.ATTRIBUTE.f_max=f0;
|
||||
|
@ -14,4 +14,5 @@ function FDTD = SetGaussExcite(FDTD,f0,fc)
|
||||
|
||||
FDTD.Excitation.ATTRIBUTE.Type=0;
|
||||
FDTD.Excitation.ATTRIBUTE.f0=f0;
|
||||
FDTD.Excitation.ATTRIBUTE.fc=fc;
|
||||
FDTD.Excitation.ATTRIBUTE.fc=fc;
|
||||
FDTD.ATTRIBUTE.f_max=f0+fc;
|
||||
|
@ -10,4 +10,5 @@ function FDTD = SetSinusExcite(FDTD,f0)
|
||||
% author: Thorsten Liebig
|
||||
|
||||
FDTD.Excitation.ATTRIBUTE.Type=1;
|
||||
FDTD.Excitation.ATTRIBUTE.f0=f0;
|
||||
FDTD.Excitation.ATTRIBUTE.f0=f0;
|
||||
FDTD.ATTRIBUTE.f_max=f0;
|
||||
|
@ -102,6 +102,7 @@ SOURCES += FDTD/engine.cpp \
|
||||
SOURCES += FDTD/extensions/engine_extension.cpp \
|
||||
FDTD/extensions/operator_ext_dispersive.cpp \
|
||||
FDTD/extensions/operator_ext_lorentzmaterial.cpp \
|
||||
FDTD/extensions/operator_ext_conductingsheet.cpp \
|
||||
FDTD/extensions/engine_ext_dispersive.cpp \
|
||||
FDTD/extensions/engine_ext_lorentzmaterial.cpp \
|
||||
FDTD/extensions/operator_ext_pml_sf.cpp \
|
||||
@ -169,6 +170,8 @@ HEADERS += FDTD/extensions/operator_extension.h \
|
||||
FDTD/extensions/engine_ext_cylinder.h \
|
||||
FDTD/extensions/operator_ext_dispersive.h \
|
||||
FDTD/extensions/operator_ext_lorentzmaterial.h \
|
||||
FDTD/extensions/operator_ext_conductingsheet.h \
|
||||
FDTD/extensions/cond_sheet_parameter.h \
|
||||
FDTD/extensions/engine_ext_dispersive.h \
|
||||
FDTD/extensions/engine_ext_lorentzmaterial.h \
|
||||
FDTD/extensions/operator_ext_pml_sf.h \
|
||||
@ -264,4 +267,3 @@ QMAKE_EXTRA_TARGETS += install
|
||||
phony.target = .PHONY
|
||||
phony.depends = $$QMAKE_EXTRA_TARGETS
|
||||
QMAKE_EXTRA_TARGETS += phony
|
||||
|
||||
|
11
openems.cpp
11
openems.cpp
@ -27,6 +27,7 @@
|
||||
#include "FDTD/extensions/operator_ext_pml_sf.h"
|
||||
#include "FDTD/extensions/operator_ext_upml.h"
|
||||
#include "FDTD/extensions/operator_ext_lorentzmaterial.h"
|
||||
#include "FDTD/extensions/operator_ext_conductingsheet.h"
|
||||
#include "FDTD/engine_interface_fdtd.h"
|
||||
#include "FDTD/engine_interface_cylindrical_fdtd.h"
|
||||
#include "Common/processvoltage.h"
|
||||
@ -263,8 +264,10 @@ bool openEMS::SetupBoundaryConditions(TiXmlElement* BC)
|
||||
string mur_v_ph_names[6] = {"MUR_PhaseVelocity_xmin", "MUR_PhaseVelocity_xmax", "MUR_PhaseVelocity_ymin", "MUR_PhaseVelocity_ymax", "MUR_PhaseVelocity_zmin", "MUR_PhaseVelocity_zmax"};
|
||||
for (int n=0; n<6; ++n)
|
||||
{
|
||||
FDTD_Op->SetBCSize(n, 0);
|
||||
if (bounds[n]==2) //Mur-ABC
|
||||
{
|
||||
FDTD_Op->SetBCSize(n, 1);
|
||||
Operator_Ext_Mur_ABC* op_ext_mur = new Operator_Ext_Mur_ABC(FDTD_Op);
|
||||
op_ext_mur->SetDirection(n/2,n%2);
|
||||
double v_ph = 0;
|
||||
@ -275,6 +278,8 @@ bool openEMS::SetupBoundaryConditions(TiXmlElement* BC)
|
||||
op_ext_mur->SetPhaseVelocity(mur_v_ph);
|
||||
FDTD_Op->AddExtension(op_ext_mur);
|
||||
}
|
||||
if (bounds[n]==3)
|
||||
FDTD_Op->SetBCSize(n, pml_size[n]);
|
||||
}
|
||||
|
||||
//create the upml
|
||||
@ -630,6 +635,12 @@ int openEMS::SetupFDTD(const char* file)
|
||||
|
||||
if (m_CSX->GetQtyPropertyType(CSProperties::LORENTZMATERIAL)>0)
|
||||
FDTD_Op->AddExtension(new Operator_Ext_LorentzMaterial(FDTD_Op));
|
||||
if (m_CSX->GetQtyPropertyType(CSProperties::CONDUCTINGSHEET)>0)
|
||||
{
|
||||
double f_max=0;
|
||||
FDTD_Opts->QueryDoubleAttribute("f_max",&f_max);
|
||||
FDTD_Op->AddExtension(new Operator_Ext_ConductingSheet(FDTD_Op,f_max));
|
||||
}
|
||||
|
||||
//check all properties to request material storage during operator creation...
|
||||
SetupMaterialStorages();
|
||||
|
Loading…
Reference in New Issue
Block a user