From ef962f6008f25ab7cbd4ca21bcc72b97a1e2d76f Mon Sep 17 00:00:00 2001 From: Ruben Undheim Date: Tue, 5 Jul 2016 18:02:38 +0200 Subject: Imported Upstream version 0.0.34 --- CSXCAD/matlab/AddConductingSheet.m | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 CSXCAD/matlab/AddConductingSheet.m (limited to 'CSXCAD/matlab/AddConductingSheet.m') diff --git a/CSXCAD/matlab/AddConductingSheet.m b/CSXCAD/matlab/AddConductingSheet.m new file mode 100644 index 0000000..f3e79b4 --- /dev/null +++ b/CSXCAD/matlab/AddConductingSheet.m @@ -0,0 +1,47 @@ +function CSX = AddConductingSheet(CSX, name, conductivity, thickness) +%function CSX = AddConductingSheet(CSX, name, conductivity, thickness) +% +% Add a conducting sheet property to CSX with the given name. +% Remember to add at least one or more 2D!! geometrical primitives to this +% property. +% +% Hint: +% Set the thickness to 0 to fall back to a perfect metal (AddMetal) +% +% example: +% % create the conducting material peroperty, e.g. 40um thick copper +% CSX = AddConductingSheet(CSX,'copper',56e6,40e-6); +% % assign box the 2D box --> 40um thick sheet +% CSX = AddBox(CSX,'copper',10,[0 -50 200],[1000 50 200]); +% +% See also AddMaterial, AddMetal, AddExcitation, AddBox +% +% CSXCAD matlab interface +% ----------------------- +% author: Thorsten Liebig 2012 + + +% fall back to ideal pec for t==0 or c==0 +if ((thickness==0) || (conductivity==0)) + CSX = AddMetal(CSX,name); + return; +end + +if ((conductivity<0) || (thickness<0)) + error('CSXCAD:AddConductingSheet','a negative conductivity or thickness is invalid'); +end + +if (conductivity<1e6) + warning('CSXCAD:AddConductingSheet','a conductivity below 1MA/Vm is not recommended'); +end + +if (thickness>500e-6) + warning('CSXCAD:AddConductingSheet','a thickness greater than 500um is not recommended'); +end + + +if (thickness<1e-6) + warning('CSXCAD:AddConductingSheet','a thickness lower than 1um is not recommended'); +end + +CSX = AddProperty(CSX, 'ConductingSheet', name,'Conductivity',conductivity,'Thickness',thickness); -- cgit v1.2.3