/* * test.java */ import com.comsol.model.*; import com.comsol.model.util.*; /** Model exported on Aug 15 2014, 22:33 by COMSOL 4.3.2.189. */ public class test { public static void main(String[] args) { run(); } public static Model run() { Model model = ModelUtil.create("Model"); model.modelPath("/data/fopiroot/fopiroot_dev/padresponse_COMSOL"); model.name("padresponse.mph"); model.param().set("stopZ", "1[mm]"); model.param().set("Xrel", "0"); model.param().set("Yrel", "0"); model.modelNode().create("mod1"); model.func().create("gp1", "GaussianPulse"); model.func().create("gp2", "GaussianPulse"); model.func().create("gp3", "GaussianPulse"); model.func().create("rn3", "Random"); model.func().create("an1", "Analytic"); model.func().create("an2", "Analytic"); model.func().create("rn1", "Random"); model.func().create("rn2", "Random"); model.func("gp1").name("inlet weighting x"); model.func("gp1").set("funcname", "gp_x"); model.func("gp1").set("location", "Xrel"); model.func("gp1").set("sigma", "0.00027"); model.func("gp2").name("inlet weighting y"); model.func("gp2").set("funcname", "gp_y"); model.func("gp2").set("location", "Yrel"); model.func("gp2").set("sigma", "0.00027"); model.func("gp3").name("inlet weighting z"); model.func("gp3").set("funcname", "gp_z"); model.func("gp3").set("location", "4[mm]-0.5[mm]"); model.func("gp3").set("sigma", "7.7e-3[cm]"); model.func("rn3").name("inlet randomizer"); model.func("rn3").set("mean", "0.5"); model.func("rn3").set("funcname", "rn_in"); model.func("rn3").set("nargs", "4"); model.func("an1").name("inlet weighting 2D"); model.func("an1") .set("plotargs", new String[][]{{"x", "-0.001", "0.001"}, {"y", "-0.001", "0.001"}, {"t", "2", "2"}}); model.func("an1").set("funcname", "inlet"); model.func("an1").set("args", new String[]{"x", "y", "t"}); model.func("an1").set("expr", "gp_x(x)*gp_y(y)*abs(rn_in(x,y,0,t))"); model.func("an2").name("inlet weighting 3D"); model.func("an2") .set("plotargs", new String[][]{{"x", "-0.001", "0.001"}, {"y", "-0.001", "0.001"}, {"z", "-0.001", "0.001"}, {"t", "2", "2"}}); model.func("an2").set("funcname", "inlet3d"); model.func("an2").set("args", new String[]{"x", "y", "z", "t"}); model.func("an2") .set("expr", "gp_x(x)*gp_y(y)*gp_z(z)*abs(rn_in(x,y,z,t))"); model.func("rn1").name("vel_z"); model.func("rn1").set("mean", "-51500"); model.func("rn1").set("funcname", "rn_vz"); model.func("rn1").set("nargs", "5"); model.func("rn1").set("normalsigma", "4200"); model.func("rn1").set("type", "normal"); model.func("rn2").name("vel_xy"); model.func("rn2").set("funcname", "rn_vxy"); model.func("rn2").set("nargs", "5"); model.func("rn2").set("normalsigma", "8200"); model.func("rn2").set("type", "normal"); model.geom().create("geom1", 3); model.geom("geom1").geomRep("comsol"); model.geom("geom1").feature().create("wp1", "WorkPlane"); model.geom("geom1").feature().create("ext1", "Extrude"); model.geom("geom1").feature().create("arr1", "Array"); model.geom("geom1").feature().create("arr2", "Array"); model.geom("geom1").feature().create("mir3", "Mirror"); model.geom("geom1").feature().create("mir4", "Mirror"); model.geom("geom1").feature().create("mir5", "Mirror"); model.geom("geom1").feature().create("mir6", "Mirror"); model.geom("geom1").feature().create("sca1", "Scale"); model.geom("geom1").feature().create("arr3", "Array"); model.geom("geom1").feature().create("arr4", "Array"); model.geom("geom1").feature().create("mir7", "Mirror"); model.geom("geom1").feature().create("mir8", "Mirror"); model.geom("geom1").feature().create("mir9", "Mirror"); model.geom("geom1").feature().create("mir10", "Mirror"); model.geom("geom1").feature().create("blk1", "Block"); model.geom("geom1").feature().create("dif1", "Difference"); model.geom("geom1").feature().create("blk2", "Block"); model.geom("geom1").feature().create("blk3", "Block"); model.geom("geom1").feature().create("blk4", "Block"); model.geom("geom1").feature("wp1").geom().feature() .create("pol1", "Polygon"); model.geom("geom1").feature("wp1").geom().feature("pol1") .set("source", "table"); model.geom("geom1").feature("wp1").geom().feature("pol1") .set("table", new String[][]{{"0.0014", "0"}, {"0.0007", "-0.0012124"}, {"-0.0007", "-0.0012124"}, {"-0.0014", "0"}, {"-0.0007", "0.0012124"}, {"0.0007", "0.0012124"}, {"0.0014", "0"}}); model.geom("geom1").feature("ext1").setIndex("distance", "25e-6", 0); model.geom("geom1").feature("ext1").set("reverse", true); model.geom("geom1").feature("ext1").selection("input") .set(new String[]{"wp1"}); model.geom("geom1").feature("arr1").set("type", "linear"); model.geom("geom1").feature("arr1").set("size", "4"); model.geom("geom1").feature("arr1") .set("displ", new String[]{"1.5[mm]*sin(30[degree])+1.5[mm]", "1.5[mm]*cos(30[degree])", "0"}); model.geom("geom1").feature("arr1").selection("input") .set(new String[]{"ext1"}); model.geom("geom1").feature("arr2").set("type", "linear"); model.geom("geom1").feature("arr2").set("size", "2"); model.geom("geom1").feature("arr2") .set("displ", new String[]{"0", "1.5[mm]*cos(30[degree])*2", "0"}); model.geom("geom1").feature("arr2").selection("input") .set(new String[]{"arr1(2)", "arr1(3)"}); model.geom("geom1").feature("mir3") .set("axis", new String[]{"-(1.5[mm]*sin(30[degree])+1.5[mm])", "1.5[mm]*cos(30[degree])", "0"}); model.geom("geom1").feature("mir3").set("keep", true); model.geom("geom1").feature("mir3").selection("input") .set(new String[]{"arr1(4)", "arr2(1,1)", "arr2(1,2)", "arr2(2,2)"}); model.geom("geom1").feature("mir4") .set("axis", new String[]{"1", "0", "0"}); model.geom("geom1").feature("mir4").set("keep", true); model.geom("geom1").feature("mir4").selection("input") .set(new String[]{"arr1(4)", "arr2", "mir3(4)"}); model.geom("geom1").feature("mir5") .set("axis", new String[]{"-(1.5[mm]*cos(30[degree]))", "-(1.5[mm]*sin(30[degree])+1.5[mm])", "0"}); model.geom("geom1").feature("mir5").set("keep", true); model.geom("geom1").feature("mir5").selection("input") .set(new String[]{"mir3(1)", "mir3(2)", "mir3(3)", "mir4(3)", "mir4(5)", "mir4(6)"}); model.geom("geom1").feature("mir6") .set("axis", new String[]{"1.5[mm]*cos(30[degree])", "-(1.5[mm]*sin(30[degree])+1.5[mm])", "0"}); model.geom("geom1").feature("mir6").set("keep", true); model.geom("geom1").feature("mir6").selection("input") .set(new String[]{"arr2(2,1)", "arr2(2,2)", "mir3", "mir4", "mir5(4)", "mir5(5)", "mir5(6)"}); model.geom("geom1").feature("sca1").set("keep", true); model.geom("geom1").feature("sca1").set("isotropic", "1.6/1.4"); model.geom("geom1").feature("sca1").set("factor", "1.6/1.4"); model.geom("geom1").feature("sca1").selection("input") .set(new String[]{"arr1(1)"}); model.geom("geom1").feature("arr3").set("type", "linear"); model.geom("geom1").feature("arr3").set("size", "4"); model.geom("geom1").feature("arr3") .set("displ", new String[]{"1.5[mm]*sin(30[degree])+1.5[mm]", "1.5[mm]*cos(30[degree])", "0"}); model.geom("geom1").feature("arr3").selection("input") .set(new String[]{"sca1"}); model.geom("geom1").feature("arr4").set("type", "linear"); model.geom("geom1").feature("arr4").set("size", "2"); model.geom("geom1").feature("arr4") .set("displ", new String[]{"0", "1.5[mm]*cos(30[degree])*2", "0"}); model.geom("geom1").feature("arr4").selection("input") .set(new String[]{"arr3(2)", "arr3(3)"}); model.geom("geom1").feature("mir7") .set("axis", new String[]{"-(1.5[mm]*sin(30[degree])+1.5[mm])", "1.5[mm]*cos(30[degree])", "0"}); model.geom("geom1").feature("mir7").set("keep", true); model.geom("geom1").feature("mir7").selection("input") .set(new String[]{"arr3(4)", "arr4(1,1)", "arr4(1,2)", "arr4(2,2)"}); model.geom("geom1").feature("mir8") .set("axis", new String[]{"1", "0", "0"}); model.geom("geom1").feature("mir8").set("keep", true); model.geom("geom1").feature("mir8").selection("input") .set(new String[]{"arr3(4)", "arr4", "mir7(4)"}); model.geom("geom1").feature("mir9") .set("axis", new String[]{"-(1.5[mm]*cos(30[degree]))", "-(1.5[mm]*sin(30[degree])+1.5[mm])", "0"}); model.geom("geom1").feature("mir9").set("keep", true); model.geom("geom1").feature("mir9").selection("input") .set(new String[]{"mir7(1)", "mir7(2)", "mir7(3)", "mir8(3)", "mir8(5)", "mir8(6)"}); model.geom("geom1").feature("mir10") .set("axis", new String[]{"1.5[mm]*cos(30[degree])", "-(1.5[mm]*sin(30[degree])+1.5[mm])", "0"}); model.geom("geom1").feature("mir10").set("keep", true); model.geom("geom1").feature("mir10").selection("input") .set(new String[]{"arr4(2,1)", "arr4(2,2)", "mir7", "mir8", "mir9(4)", "mir9(5)", "mir9(6)"}); model.geom("geom1").feature("blk1") .set("size", new String[]{"20[mm]", "20[mm]", "0.025[mm]"}); model.geom("geom1").feature("blk1").set("base", "center"); model.geom("geom1").feature("blk1") .set("pos", new String[]{"0", "0", "-0.025[mm]/2"}); model.geom("geom1").feature("dif1").set("face", "all"); model.geom("geom1").feature("dif1").set("intbnd", false); model.geom("geom1").feature("dif1").selection("input") .set(new String[]{"blk1"}); model.geom("geom1").feature("dif1").selection("input2") .set(new String[]{"arr3(1)", "arr3(4)", "arr4", "mir10", "mir7", "mir8", "mir9"}); model.geom("geom1").feature("blk2") .set("size", new String[]{"0.02", "0.02", "4e-3+2*25e-6"}); model.geom("geom1").feature("blk2").set("base", "center"); model.geom("geom1").feature("blk2") .set("pos", new String[]{"0", "0", "2e-3"}); model.geom("geom1").feature("blk3") .set("size", new String[]{"0.02", "0.02", "0.025[mm]"}); model.geom("geom1").feature("blk3").set("base", "center"); model.geom("geom1").feature("blk3") .set("pos", new String[]{"0", "0", "0.025[mm]/2+4e-3"}); model.geom("geom1").feature("blk3").set("createselection", true); model.geom("geom1").feature("blk4") .set("size", new String[]{"0.02", "0.02", "0.5e-3"}); model.geom("geom1").feature("blk4").set("base", "center"); model.geom("geom1").feature("blk4") .set("pos", new String[]{"0", "0", "4[mm]-stopZ-0.5e-3/2"}); model.geom("geom1").run(); model.selection().create("box1", "Box"); model.selection("box1").set("entitydim", "2"); model.selection().create("sel1", "Explicit"); model.selection("sel1").geom("geom1", 2); model.selection("sel1").set(new int[]{163, 164, 166, 196, 197, 216, 217}); model.selection().create("sel2", "Explicit"); model.selection("sel2").geom("geom1", 3, 2, new String[]{"exterior"}); model.selection("sel2") .set(new int[]{1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42}); model.selection().create("box2", "Box"); model.selection("box2").set("entitydim", "2"); model.selection("box1").set("condition", "inside"); model.selection("box1").set("xmin", "-0.02/2"); model.selection("box1").set("zmax", "0.025[mm]+4e-3+1e-4"); model.selection("box1").set("zmin", "4e-3-1e-4"); model.selection("box1").set("ymax", "0.02/2"); model.selection("box1").set("ymin", "-0.02/2"); model.selection("box1").set("xmax", "0.02/2"); model.selection("box1").name("cathode"); model.selection("sel1").name("middle pad"); model.selection("sel1").name("Explicit 1"); model.selection("sel2").name("padplane"); model.selection("sel2").name("Explicit 2"); model.selection("box2").set("input", new String[]{"sel2"}); model.selection("box2").set("inputent", "selections"); model.variable().create("var1"); model.view("view1").hideEntities().create("hide1"); model.view("view1").hideEntities("hide1").set(new int[]{2, 3, 4}); model.view().create("view3", 2); model.view().create("view4", 2); model.view().create("view5", 2); model.view().create("view6", 3); model.view().create("view7", 3); model.view().create("view8", 3); model.material().create("mat2"); model.material("mat2").propertyGroup() .create("linzRes", "Linearized resistivity"); model.material().create("mat1"); model.material("mat1").propertyGroup("def").func() .create("eta", "Piecewise"); model.material("mat1").propertyGroup("def").func() .create("Cp", "Piecewise"); model.material("mat1").propertyGroup("def").func() .create("rho", "Analytic"); model.material("mat1").propertyGroup("def").func() .create("k", "Piecewise"); model.material("mat1").propertyGroup("def").func() .create("cs", "Analytic"); model.material("mat1").selection().set(new int[]{2, 3, 4}); model.physics().create("es", "Electrostatics", "geom1"); model.physics("es").feature().create("gnd1", "Ground", 2); model.physics("es").feature("gnd1").selection().named("sel2"); model.physics("es").feature().create("pot2", "ElectricPotential", 2); model.physics("es").feature("pot2").selection().set(new int[]{15}); model.physics().create("cpt", "ChargedParticleTracing", "geom1"); model.physics("cpt").feature().create("rel1", "Release", 3); model.physics("cpt").feature("rel1").selection().set(new int[]{4}); model.physics("cpt").feature().create("wall2", "Wall", 2); model.physics("cpt").feature("wall2").selection().named("sel2"); model.physics("cpt").feature().create("wall4", "Wall", 2); model.physics("cpt").feature("wall4").selection().set(new int[]{24}); model.physics("cpt").feature().create("ef1", "ElectricForce", 3); model.physics("cpt").feature("ef1").selection().all(); model.physics("cpt").feature().create("mf1", "MagneticForce", 3); model.physics("cpt").feature("mf1").selection().all(); model.physics("cpt").feature().create("ec2", "ElasticCollisionForce", 3); model.physics("cpt").feature("ec2").selection().all(); model.physics("cpt").feature().create("ec1", "ElasticCollisionForce", 3); model.physics("cpt").feature("ec1").selection().all(); model.physics("cpt").feature() .create("ppi1", "ParticleParticleInteraction", 3); model.physics("cpt").feature().create("wall3", "Wall", 2); model.physics("cpt").feature("wall3").selection().set(new int[]{12}); model.physics().create("es2", "Electrostatics", "geom1"); model.physics("es2").feature().create("gnd1", "Ground", 2); model.physics("es2").feature("gnd1").selection().named("box1"); model.physics("es2").feature().create("gnd2", "Ground", 2); model.physics("es2").feature("gnd2").selection().named("sel2"); model.physics("es2").feature().create("pot1", "ElectricPotential", 2); model.physics("es2").feature("pot1").selection().named("sel1"); model.mesh().create("mesh1", "geom1"); model.mesh("mesh1").feature().create("ftet1", "FreeTet"); model.result().table().create("tbl1", "Table"); model.result().table().create("tbl2", "Table"); model.result().table().create("tbl3", "Table"); model.result().table().create("tbl4", "Table"); model.variable("var1").name("Variables 1a"); model.view("view1").hideEntities("hide1").active(false); model.view("view2").axis().set("xmin", "-0.0016681291162967682"); model.view("view2").axis().set("ymin", "-0.0013336400734260678"); model.view("view2").axis().set("xmax", "0.0016681291162967682"); model.view("view2").axis().set("ymax", "0.0013336400734260678"); model.view("view3").axis().set("xmin", "-3.7802302837371826"); model.view("view3").axis().set("ymin", "-1.9442814588546753"); model.view("view3").axis().set("xmax", "3.7802302837371826"); model.view("view3").axis().set("ymax", "1.9442814588546753"); model.view("view4").axis().set("xmin", "-0.021387094631791115"); model.view("view4").axis().set("ymin", "-0.010999999940395355"); model.view("view4").axis().set("xmax", "0.021387094631791115"); model.view("view4").axis().set("ymax", "0.010999999940395355"); model.view("view5").axis().set("xmin", "-0.01444224826991558"); model.view("view5").axis().set("ymin", "-0.0027117072604596615"); model.view("view5").axis().set("xmax", "0.005984077230095863"); model.view("view5").axis().set("ymax", "0.008020767942070961"); model.material("mat2").name("Copper"); model.material("mat2").propertyGroup("def") .set("relpermeability", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"}); model.material("mat2").propertyGroup("def") .set("electricconductivity", new String[]{"5.998e7[S/m]", "0", "0", "0", "5.998e7[S/m]", "0", "0", "0", "5.998e7[S/m]"}); model.material("mat2").propertyGroup("def") .set("heatcapacity", "385[J/(kg*K)]"); model.material("mat2").propertyGroup("def") .set("relpermittivity", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"}); model.material("mat2").propertyGroup("def").set("emissivity", "0.5"); model.material("mat2").propertyGroup("def") .set("density", "8700[kg/m^3]"); model.material("mat2").propertyGroup("def") .set("thermalconductivity", new String[]{"400[W/(m*K)]", "0", "0", "0", "400[W/(m*K)]", "0", "0", "0", "400[W/(m*K)]"}); model.material("mat2").propertyGroup("linzRes").set("rho0", ""); model.material("mat2").propertyGroup("linzRes").set("alpha", ""); model.material("mat2").propertyGroup("linzRes").set("Tref", ""); model.material("mat2").propertyGroup("linzRes") .set("rho0", "1.72e-8[ohm*m]"); model.material("mat2").propertyGroup("linzRes") .set("alpha", "3.9e-3[1/K]"); model.material("mat2").propertyGroup("linzRes").set("Tref", "273.15[K]"); model.material("mat2").propertyGroup("linzRes").addInput("temperature"); model.material("mat1").name("Air"); model.material("mat1").propertyGroup("def").func("eta").set("arg", "T"); model.material("mat1").propertyGroup("def").func("eta") .set("pieces", new String[][]{{"200.0", "1600.0", "-8.38278E-7+8.35717342E-8*T^1-7.69429583E-11*T^2+4.6437266E-14*T^3-1.06585607E-17*T^4"}}); model.material("mat1").propertyGroup("def").func("Cp").set("arg", "T"); model.material("mat1").propertyGroup("def").func("Cp") .set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}}); model.material("mat1").propertyGroup("def").func("rho") .set("argders", new String[][]{{"pA", "d(pA*0.02897/8.314/T,pA)"}, {"T", "d(pA*0.02897/8.314/T,T)"}}); model.material("mat1").propertyGroup("def").func("rho") .set("plotargs", new String[][]{{"pA", "0", "1"}, {"T", "0", "1"}}); model.material("mat1").propertyGroup("def").func("rho") .set("dermethod", "manual"); model.material("mat1").propertyGroup("def").func("rho") .set("args", new String[]{"pA", "T"}); model.material("mat1").propertyGroup("def").func("rho") .set("expr", "pA*0.02897/8.314/T"); model.material("mat1").propertyGroup("def").func("k").set("arg", "T"); model.material("mat1").propertyGroup("def").func("k") .set("pieces", new String[][]{{"200.0", "1600.0", "-0.00227583562+1.15480022E-4*T^1-7.90252856E-8*T^2+4.11702505E-11*T^3-7.43864331E-15*T^4"}}); model.material("mat1").propertyGroup("def").func("cs") .set("argders", new String[][]{{"T", "d(sqrt(1.4*287*T),T)"}}); model.material("mat1").propertyGroup("def").func("cs") .set("plotargs", new String[][]{{"T", "0", "1"}}); model.material("mat1").propertyGroup("def").func("cs") .set("dermethod", "manual"); model.material("mat1").propertyGroup("def").func("cs") .set("args", new String[]{"T"}); model.material("mat1").propertyGroup("def").func("cs") .set("expr", "sqrt(1.4*287*T)"); model.material("mat1").propertyGroup("def") .set("dynamicviscosity", "eta(T[1/K])[Pa*s]"); model.material("mat1").propertyGroup("def") .set("ratioofspecificheat", "1.4"); model.material("mat1").propertyGroup("def") .set("electricconductivity", new String[]{"0[S/m]", "0", "0", "0", "0[S/m]", "0", "0", "0", "0[S/m]"}); model.material("mat1").propertyGroup("def") .set("heatcapacity", "Cp(T[1/K])[J/(kg*K)]"); model.material("mat1").propertyGroup("def") .set("density", "rho(pA[1/Pa],T[1/K])[kg/m^3]"); model.material("mat1").propertyGroup("def") .set("thermalconductivity", new String[]{"k(T[1/K])[W/(m*K)]", "0", "0", "0", "k(T[1/K])[W/(m*K)]", "0", "0", "0", "k(T[1/K])[W/(m*K)]"}); model.material("mat1").propertyGroup("def") .set("soundspeed", "cs(T[1/K])[m/s]"); model.material("mat1").propertyGroup("def") .set("relpermittivity", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"}); model.material("mat1").propertyGroup("def").addInput("temperature"); model.material("mat1").propertyGroup("def").addInput("pressure"); model.physics("es").feature("pot2").set("V0", "-1268"); model.physics("cpt").feature("rel1").set("InitialPosition", "Density"); model.physics("cpt").feature("rel1").set("N", "1000"); model.physics("cpt").feature("rel1").set("dpro", "inlet3d(x,y,z,t)"); model.physics("cpt").feature("rel1") .set("v0", new String[][]{{"rn_vxy(particleindex,x,y,z,t)"}, {"rn_vxy(particleindex,x,y,z,t)"}, {"rn_vz(particleindex,x,y,z,t)"}}); model.physics("cpt").feature("wall2").name("padplane"); model.physics("cpt").feature("wall4").name("padplane_nonconducting"); model.physics("cpt").feature("ef1").set("E_src", "root.mod1.es.Ex"); model.physics("cpt").feature("mf1") .set("B", new String[][]{{"0"}, {"0"}, {"0.616"}}); model.physics("cpt").feature("ec2").set("CollisionModel", "MonteCarlo"); model.physics("cpt").feature("ec2").set("xsec", "1.48711e-21"); model.physics("cpt").feature("ec2").set("Nd", "2.44E25"); model.physics("cpt").feature("ec2").set("mg", "0.0435415[kg/mol]"); model.physics("cpt").feature("ec2").name("elastic"); model.physics("cpt").feature("ec1").set("xsec", "9.01561e-19"); model.physics("cpt").feature("ec1").set("Nd", "2.44E25"); model.physics("cpt").feature("ec1").set("mg", "0.0435415[kg/mol]"); model.physics("cpt").feature("ec1").name("friction"); model.physics("cpt").feature("ppi1").active(false); model.physics("cpt").feature("wall3").active(false); model.physics("es2").feature("pot1").set("V0", "1"); model.mesh("mesh1").feature("size").set("hauto", 4); model.mesh("mesh1").run(); model.result().table("tbl1").comments("Particle Evaluation 5 (cpt.st)"); model.result().table("tbl2").comments("Particle Evaluation 5 (cpt.st)"); model.result().table("tbl3").comments("Particle Evaluation 5 (cpt.st)"); model.result().table("tbl4") .comments("Point Evaluation 1 {pev1} (es2.Ex)"); model.coordSystem("sys1").set("frametype", "geometry"); model.study().create("std1"); model.study("std1").feature().create("stat", "Stationary"); model.study().create("std2"); model.study("std2").feature().create("time", "Transient"); model.study().create("std3"); model.study("std3").feature().create("stat", "Stationary"); model.study().create("std4"); model.study("std4").feature().create("param", "Parametric"); model.sol().create("sol1"); model.sol("sol1").study("std1"); model.sol("sol1").attach("std1"); model.sol("sol1").feature().create("st1", "StudyStep"); model.sol("sol1").feature().create("v1", "Variables"); model.sol("sol1").feature().create("s1", "Stationary"); model.sol("sol1").feature("s1").feature().create("fc1", "FullyCoupled"); model.sol("sol1").feature("s1").feature().create("i1", "Iterative"); model.sol("sol1").feature("s1").feature("i1").feature() .create("mg1", "Multigrid"); model.sol("sol1").feature("s1").feature().remove("fcDef"); model.study("std1").feature("stat").set("initstudyhide", "on"); model.study("std1").feature("stat").set("initsolhide", "on"); model.study("std1").feature("stat").set("notstudyhide", "on"); model.study("std1").feature("stat").set("notsolhide", "on"); model.study("std2").feature("time").set("initstudyhide", "on"); model.study("std2").feature("time").set("initsolhide", "on"); model.study("std2").feature("time").set("notstudyhide", "on"); model.study("std2").feature("time").set("notsolhide", "on"); model.study("std3").feature("stat").set("initstudyhide", "on"); model.study("std3").feature("stat").set("initsolhide", "on"); model.study("std3").feature("stat").set("notstudyhide", "on"); model.study("std3").feature("stat").set("notsolhide", "on"); model.sol().create("sol2"); model.sol("sol2").study("std2"); model.sol("sol2").attach("std2"); model.sol("sol2").feature().create("st1", "StudyStep"); model.sol("sol2").feature().create("v1", "Variables"); model.sol("sol2").feature().create("t1", "Time"); model.sol("sol2").feature("t1").feature().create("fc1", "FullyCoupled"); model.sol("sol2").feature("t1").feature().create("i1", "Iterative"); model.sol("sol2").feature("t1").feature("i1").feature() .create("ja1", "Jacobi"); model.sol("sol2").feature("t1").feature().remove("fcDef"); model.study("std1").feature("stat").set("initstudyhide", "on"); model.study("std1").feature("stat").set("initsolhide", "on"); model.study("std1").feature("stat").set("notstudyhide", "on"); model.study("std1").feature("stat").set("notsolhide", "on"); model.study("std2").feature("time").set("initstudyhide", "on"); model.study("std2").feature("time").set("initsolhide", "on"); model.study("std2").feature("time").set("notstudyhide", "on"); model.study("std2").feature("time").set("notsolhide", "on"); model.study("std3").feature("stat").set("initstudyhide", "on"); model.study("std3").feature("stat").set("initsolhide", "on"); model.study("std3").feature("stat").set("notstudyhide", "on"); model.study("std3").feature("stat").set("notsolhide", "on"); model.sol().create("sol3"); model.sol("sol3").study("std3"); model.sol("sol3").attach("std3"); model.sol("sol3").feature().create("st1", "StudyStep"); model.sol("sol3").feature().create("v1", "Variables"); model.sol("sol3").feature().create("s1", "Stationary"); model.sol("sol3").feature("s1").feature().create("fc1", "FullyCoupled"); model.sol("sol3").feature("s1").feature().create("i1", "Iterative"); model.sol("sol3").feature("s1").feature("i1").feature() .create("mg1", "Multigrid"); model.sol("sol3").feature("s1").feature().remove("fcDef"); model.study("std1").feature("stat").set("initstudyhide", "on"); model.study("std1").feature("stat").set("initsolhide", "on"); model.study("std1").feature("stat").set("notstudyhide", "on"); model.study("std1").feature("stat").set("notsolhide", "on"); model.study("std2").feature("time").set("initstudyhide", "on"); model.study("std2").feature("time").set("initsolhide", "on"); model.study("std2").feature("time").set("notstudyhide", "on"); model.study("std2").feature("time").set("notsolhide", "on"); model.study("std3").feature("stat").set("initstudyhide", "on"); model.study("std3").feature("stat").set("initsolhide", "on"); model.study("std3").feature("stat").set("notstudyhide", "on"); model.study("std3").feature("stat").set("notsolhide", "on"); model.sol().create("sol4"); model.sol("sol4").study("std4"); model.sol("sol4").attach("std4"); model.sol("sol4").feature().create("st1", "StudyStep"); model.sol("sol4").feature().create("v1", "Variables"); model.study("std1").feature("stat").set("initstudyhide", "on"); model.study("std1").feature("stat").set("initsolhide", "on"); model.study("std1").feature("stat").set("notstudyhide", "on"); model.study("std1").feature("stat").set("notsolhide", "on"); model.study("std2").feature("time").set("initstudyhide", "on"); model.study("std2").feature("time").set("initsolhide", "on"); model.study("std2").feature("time").set("notstudyhide", "on"); model.study("std2").feature("time").set("notsolhide", "on"); model.study("std3").feature("stat").set("initstudyhide", "on"); model.study("std3").feature("stat").set("initsolhide", "on"); model.study("std3").feature("stat").set("notstudyhide", "on"); model.study("std3").feature("stat").set("notsolhide", "on"); model.batch().create("b1", "Batch"); model.batch("b1").feature().create("cl1", "Class"); model.batch("b1").feature("daDef").feature().create("pr1", "Process"); model.batch("b1").feature("daDef").feature().create("pr2", "Process"); model.batch("b1").study("std4"); model.result().dataset().create("cpl1", "CutPlane"); model.result().dataset().create("surf1", "Surface"); model.result().dataset().create("cpl3", "CutPlane"); model.result().dataset().create("part1", "Particle"); model.result().dataset("surf1").selection().named("sel1"); model.result().numerical().create("par1", "Particle"); model.result().numerical().create("par4", "Particle"); model.result().numerical("pev1").set("probetag", "none"); model.result().numerical("pev2").set("probetag", "none"); model.result().numerical("pev3").set("probetag", "none"); model.result().create("pg1", "PlotGroup3D"); model.result().create("pg3", "PlotGroup3D"); model.result().create("pg4", "PlotGroup3D"); model.result().create("pg5", "PlotGroup3D"); model.result().create("pg6", "PlotGroup1D"); model.result().create("pg7", "PlotGroup3D"); model.result("pg1").feature().create("mslc1", "Multislice"); model.result("pg3").feature().create("str1", "Streamline"); model.result("pg3").feature("str1").selection().named("sel1"); model.result("pg4").feature().create("traj1", "ParticleTrajectories"); model.result("pg4").feature().create("traj2", "ParticleTrajectories"); model.result("pg4").feature("traj1").feature().create("col1", "Color"); model.result("pg6").feature().create("hist1", "Histogram"); model.result("pg7").feature().create("mslc1", "Multislice"); model.result().export().create("play1", "Player"); model.result().export().create("play2", "Player"); model.result().export().create("play3", "Player"); model.study("std1").name("Drift field"); model.study("std1").feature("stat") .set("activate", new String[]{"es", "on", "cpt", "off", "es2", "off"}); model.study("std2").name("Particles"); model.study("std2").feature("time").set("notsolnum", "auto"); model.study("std2").feature("time") .set("activate", new String[]{"es", "off", "cpt", "on", "es2", "off"}); model.study("std2").feature("time").set("notsolmethod", "sol"); model.study("std2").feature("time").set("plot", "on"); model.study("std2").feature("time").set("usesol", "on"); model.study("std2").feature("time").set("notstudy", "std1"); model.study("std2").feature("time").set("plotgroup", "pg4"); model.study("std2").feature("time").set("tlist", "range(0,5.0e-10,1e-7)"); model.study("std2").feature("time").set("rtol", "1.0E-5"); model.study("std2").feature("time").set("rtolactive", false); model.study("std3").name("Weighting field"); model.study("std3").feature("stat") .set("activate", new String[]{"es", "off", "cpt", "off", "es2", "on"}); model.study("std4").name("output"); model.study("std4").feature("param").active(false); model.study("std4").feature("param").set("plistarr", new String[]{""}); model.study("std4").feature("param").set("pname", new String[]{"Xrel"}); model.sol("sol1").attach("std1"); model.sol("sol1").feature("st1").name("Compile Equations: Stationary"); model.sol("sol1").feature("st1").set("studystep", "stat"); model.sol("sol1").feature("v1").set("control", "stat"); model.sol("sol1").feature("v1").feature("mod1_qcpt") .set("solvefor", false); model.sol("sol1").feature("v1").feature("mod1_V2").set("solvefor", false); model.sol("sol1").feature("s1").set("control", "stat"); model.sol("sol1").feature("s1").feature("i1").set("linsolver", "cg"); model.sol("sol1").feature("s1").feature("i1").feature("mg1") .set("prefun", "amg"); model.sol("sol1").runAll(); model.sol("sol2").attach("std2"); model.sol("sol2").feature("st1") .name("Compile Equations: Time Dependent"); model.sol("sol2").feature("st1").set("study", "std2"); model.sol("sol2").feature("st1").set("studystep", "time"); model.sol("sol2").feature("v1").set("control", "time"); model.sol("sol2").feature("v1").set("solnum", "auto"); model.sol("sol2").feature("v1").set("initmethod", "sol"); model.sol("sol2").feature("v1").set("notsolmethod", "sol"); model.sol("sol2").feature("v1").set("notsolnum", "auto"); model.sol("sol2").feature("v1").set("initsol", "sol2"); model.sol("sol2").feature("v1").set("notsol", "sol1"); model.sol("sol2").feature("v1").feature("mod1_V").set("solvefor", false); model.sol("sol2").feature("v1").feature("mod1_V2").set("solvefor", false); model.sol("sol2").feature("t1").set("atolglobal", "1.0E-6"); model.sol("sol2").feature("t1").set("tstepsgenalpha", "manual"); model.sol("sol2").feature("t1").set("plotgroup", "pg4"); model.sol("sol2").feature("t1").set("plot", "on"); model.sol("sol2").feature("t1").set("rtol", "1.0E-5"); model.sol("sol2").feature("t1").set("timemethod", "genalpha"); model.sol("sol2").feature("t1").set("tlist", "range(0,5.0e-10,1e-7)"); model.sol("sol2").feature("t1") .set("atoludot", new String[]{"mod1_V", "1e-3", "mod1_qcpt", "1e-3", "mod1_V2", "1e-3"}); model.sol("sol2").feature("t1").set("control", "time"); model.sol("sol2").feature("t1") .set("atolmethod", new String[]{"mod1_V", "global", "mod1_qcpt", "global", "mod1_V2", "global"}); model.sol("sol2").feature("t1") .set("atol", new String[]{"mod1_V", "1e-3", "mod1_qcpt", "1e-3", "mod1_V2", "1e-3"}); model.sol("sol2").feature("t1").set("timestepgenalpha", "5e-10"); model.sol("sol2").feature("t1") .set("atoludotactive", new String[]{"mod1_V", "off", "mod1_qcpt", "off", "mod1_V2", "off"}); model.sol("sol2").feature("t1").feature("fc1").set("jtech", "once"); model.sol("sol2").runAll(); model.sol("sol3").attach("std3"); model.sol("sol3").feature("st1") .name("Compile Equations: Stationary {stat}"); model.sol("sol3").feature("st1").set("studystep", "stat"); model.sol("sol3").feature("st1").set("study", "std3"); model.sol("sol3").feature("v1").set("control", "stat"); model.sol("sol3").feature("v1").feature("mod1_V").set("solvefor", false); model.sol("sol3").feature("v1").feature("mod1_qcpt") .set("solvefor", false); model.sol("sol3").feature("s1").set("control", "stat"); model.sol("sol3").feature("s1").feature("i1").set("linsolver", "cg"); model.sol("sol3").feature("s1").feature("i1").feature("mg1") .set("prefun", "amg"); model.sol("sol3").runAll(); model.sol("sol4").attach("std4"); model.sol("sol4").feature("st1").set("study", "std4"); model.sol("sol4").runAll(); model.batch("b1") .set("batchdir", "/home/mberger/fopiroot/fopiroot_dev/padresponse_COMSOL/batch"); model.batch("b1").feature("daDef").feature("pr1") .set("cmd", new String[]{"/usr/local/comsol43b/bin/comsol", "batch", "-job", "b1", "-alivetime", "15", "-inputfile", "/home/mberger/batchmodel.mph", "-batchlog", "/home/mberger/batchmodel.mph.log"}); model.batch("b1").feature("daDef").feature("pr1") .set("status", "Starting\nFri Aug 15 20:15:10 CEST 2014\nCOMSOL 4.3b (Build: 189) starting in batch mode\nOpening: /home/mberger/batchmodel.mph\nOpen time: 25 s.\nRunning: Batch 1\nSaving: /home/mberger/batchmodel.mph\nSave time: 24 s.\nMemory: 879/879 2095/2095\nTotal time: 51 s.\nsages:\n\u0009Unknown feature\n\u0009- Tag: part4\n\nStack trace:\n\u0009at com.comsol.model.internal.impl.ModelEntityListImpl.findObject(Unknown Source)\n\u0009at com.comsol.model.internal.impl.ModelEntityListImpl.g(Unknown Source)\n\u0009at com.comsol.model.internal.impl.ModelEntityListImpl.get(Unknown Source)\n\u0009at com.comsol.model.internal.impl.ModelEntityListImpl.get(Unknown Source)\n\u0009at com.comsol.model.operations.AbstractDatasetReferenceCheck.resolveEntity(Unknown Source)\n\u0009at com.comsol.model.operations.ReferencePropCheck.resolve(Unknown Source)\n\u0009at com.comsol.model.method.PropValueUtil.propertySet(Unknown Source)\n\u0009at com.comsol.model.internal.impl.PropValueImpl.set(Unknown Source)\n\u0009at com.comsol.model.internal.impl.PropFeatureImpl.c(Unknown Source)\n\u0009at com.comsol.model.internal.impl.PropFeatureImpl.set(Unknown Source)\n\u0009at com.comsol.model.impl.PropFeatureImpl.set(Unknown Source)\n\u0009at calc_ramo.run(calc_ramo.java:30)\n\u0009at calc_ramo.main(calc_ramo.java:15)\n\u0009at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\u0009at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\n\u0009at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n\u0009at java.lang.reflect.Method.invoke(Unknown Source)\n\u0009at com.comsol.util.application.CsBaseApplication.runExternalClassStat(Unknown Source)\n\u0009at com.comsol.util.application.CsBaseApplication.runExternalClass(Unknown Source)\n\u0009at com.comsol.util.compile.d$1.a(Unknown Source)\n\u0009at com.comsol.util.compile.d$1.call(Unknown Source)\n\u0009at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)\n\u0009at java.util.concurrent.FutureTask.run(Unknown Source)\n\u0009at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)\n\u0009at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\u0009at java.lang.Thread.run(Unknown Source)"); model.batch("b1").feature("daDef").feature("pr1") .set("filename", "/home/mberger/batchmodel.mph"); model.batch("b1").feature("daDef").feature("pr2") .set("cmd", new String[]{"/usr/local/comsol43b/bin/comsol", "batch", "-job", "b1", "-alivetime", "15", "-inputfile", "/home/mberger/fopiroot/fopiroot_dev/padresponse_COMSOL/batch/batchmodel.mph", "-batchlog", "/home/mberger/fopiroot/fopiroot_dev/padresponse_COMSOL/batch/batchmodel.mph.log"}); model.batch("b1").feature("daDef").feature("pr2") .set("status", "Starting\nCollecting particle positions\nCollecting particle velocities\nStart loop over particles\nAt particle: 0\nAt particle: 10\nAt particle: 20\nAt particle: 30\nAt particle: 40\nAt particle: 50\nAt particle: 60\nAt particle: 70\nAt particle: 80\nAt particle: 90\nAt particle: 100\nAt particle: 110\nAt particle: 120\nAt particle: 130\nAt parRun time: 101 s.\nMemory: 1256/1256 2406/2406\nSaving: /home/mberger/fopiroot/fopiroot dev/padresponse COMSOL/batch/batchmodel.mph\nSave time: 34 s.\nMemory: 1257/1257 2414/2414\nTotal time: 161 s.\n 250\nAt particle: 260\nAt particle: 270\nAt particle: 280\nAt particle: 290\nAt particle: 300\nAt particle: 310\nAt particle: 320\nAt particle: 330\nAt particle: 340\nAt particle: 350\nAt particle: 360\nAt particle: 370\nAt particle: 380\nAt particle: 390\nAt particle: 400\nAt particle: 410\nAt particle: 420\nAt particle: 430\nAt particle: 440\nAt particle: 450\nAt particle: 460\nAt particle: 470\nAt particle: 480\nAt particle: 490\nAt particle: 500\nAt particle: 510\nAt particle: 520\nAt particle: 530\nAt particle: 540\nAt particle: 550\nAt particle: 560\nAt particle: 570\nAt particle: 580\nAt particle: 590\nAt particle: 600\nAt particle: 610\nAt particle: 620\nAt particle: 630\nAt particle: 640\nAt particle: 650\nAt particle: 660\nAt particle: 670\nAt particle: 680\nAt particle: 690\nAt particle: 700\nAt particle: 710\nAt particle: 720\nAt particle: 730\nAt particle: 740\nAt particle: 750\nAt particle: 760\nAt particle: 770\nAt particle: 780\nAt particle: 790\nAt particle: 800\nAt particle: 810\nAt particle: 820\nAt particle: 830\nAt particle: 840\nAt particle: 850\nAt particle: 860\nAt particle: 870\nAt particle: 880\nAt particle: 890\nAt particle: 900\nAt particle: 910\nAt particle: 920\nAt particle: 930\nAt particle: 940\nAt particle: 950\nAt particle: 960\nAt particle: 970\nAt particle: 980\nAt particle: 990\nAll Done\nDone"); model.batch("b1").feature("daDef").feature("pr2") .set("filename", "/home/mberger/fopiroot/fopiroot_dev/padresponse_COMSOL/batch/batchmodel.mph"); model.batch("b1").feature("cl1") .set("filename", "/data/fopiroot/fopiroot_dev/padresponse_COMSOL/calc_ramo.class"); model.batch("b1").run(); model.result().dataset("dset1").set("frametype", "mesh"); model.result().dataset("cpl1").set("quickz", "0[mm]"); model.result().dataset("cpl1").set("quickplane", "xy"); model.result().dataset("cpl3").set("planetype", "general"); model.result().dataset("cpl3") .set("genpoints", new String[][]{{"-3e-3", "0", "0"}, {"3e-3", "0", "0"}, {"0", "1", "0"}}); model.result().dataset("cpt1").set("pointx", "0"); model.result().dataset("cpt1").set("pointy", "0"); model.result().dataset("cpt1").set("pointz", "0"); model.result().dataset("part1").set("pgeom", "pgeom_cpt"); model.result().dataset("part1") .set("posdof", new String[]{"mod1.qx", "mod1.qy", "mod1.qz"}); model.result().dataset("part1").set("solution", "sol2"); model.result().numerical("par1").name("Particle posX"); model.result().numerical("par1").set("unit", "m"); model.result().numerical("par1").set("expr", "qx"); model.result().numerical("par1").set("descr", "Particle position"); model.result().numerical("par2").set("unit", "m"); model.result().numerical("par2").set("expr", "qy"); model.result().numerical("par2").set("descr", "Particle position"); model.result().numerical("par3").set("unit", "m"); model.result().numerical("par3").set("expr", "qz"); model.result().numerical("par3").set("descr", "Particle position"); model.result().numerical("par4").name("Particle release time"); model.result().numerical("par4").set("unit", "s"); model.result().numerical("par4").set("expr", "cpt.prt"); model.result().numerical("par4").set("descr", "Particle release time"); model.result().numerical("pev1").set("data", "cpt1"); model.result().numerical("pev1").set("expr", "es2.Ex"); model.result().numerical("pev1").set("unit", "V/m"); model.result().numerical("pev1") .set("descr", "Electric field, x component"); model.result().numerical("pev1").set("table", "tbl4"); model.result().numerical("pev2").set("data", "cpt1"); model.result().numerical("pev2").set("expr", "es2.Ey"); model.result().numerical("pev2").set("unit", "V/m"); model.result().numerical("pev2") .set("descr", "Electric field, y component"); model.result().numerical("pev2").set("table", "tbl4"); model.result().numerical("pev3").set("data", "cpt1"); model.result().numerical("pev3").set("expr", "es2.Ez"); model.result().numerical("pev3").set("unit", "V/m"); model.result().numerical("pev3") .set("descr", "Electric field, z component"); model.result().numerical("pev3").set("table", "tbl4"); model.result().numerical("par5").setResult(); model.result().numerical("pev1").setResult(); model.result().numerical("pev2").appendResult(); model.result().numerical("pev3").appendResult(); model.result("pg1").name("Electric Potential (es)"); model.result("pg1").feature("mslc1").name("Multislice"); model.result("pg3").feature("str1").set("selnumber", "200"); model.result("pg4").name("Particle Trajectories (cpt)"); model.result("pg4").set("data", "part1"); model.result("pg4").set("looplevel", new String[]{"201"}); model.result("pg4").feature("traj1").set("sphereradiusscale", "0.025"); model.result("pg4").feature("traj1").set("linetype", "none"); model.result("pg4").feature("traj1").set("sphereradiusscaleactive", true); model.result("pg4").feature("traj1").set("pointtype", "point"); model.result("pg4").feature("traj1").feature("col1") .set("rangecoloractive", "on"); model.result("pg4").feature("traj1").feature("col1").set("unit", "m/s"); model.result("pg4").feature("traj1").feature("col1") .set("expr", "sqrt(cpt.vx*cpt.vx+cpt.vy*cpt.vy)"); model.result("pg4").feature("traj1").feature("col1") .set("rangecolormax", "60"); model.result("pg4").feature("traj1").feature("col1") .set("descr", "sqrt(cpt.vx*cpt.vx+cpt.vy*cpt.vy)"); model.result("pg6").set("data", "part1"); model.result("pg6").set("ylabel", "Count"); model.result("pg6").set("looplevelinput", new String[]{"first"}); model.result("pg6").set("xlabel", "Particle velocity, x component (m/s)"); model.result("pg6").set("ylabelactive", false); model.result("pg6").set("xlabelactive", false); model.result("pg6").feature("hist1").set("unit", "m/s"); model.result("pg6").feature("hist1") .set("descr", "Particle velocity, x component"); model.result("pg6").feature("hist1").set("expr", "cpt.vx"); model.result("pg7").name("Electric Potential (es2)"); model.result("pg7").set("data", "dset3"); model.result("pg7").feature("mslc1").name("Multislice"); model.result("pg7").feature("mslc1").set("expr", "V2"); model.result().export("play1").set("showframe", "25"); model.result().export("play1").set("plotgroup", "pg4"); model.result().export("play1").set("solnumtype", "inner"); model.result().export("play1").set("shownparameter", "1e-7"); model.result().export("play1").set("solnum", new String[]{"1"}); model.result().export("play2").set("showframe", "25"); model.result().export("play2").set("plotgroup", "pg4"); model.result().export("play2").set("solnumtype", "inner"); model.result().export("play2").set("shownparameter", "1e-7"); model.result().export("play2").set("solnum", new String[]{"1"}); model.result().export("play3").set("showframe", "6"); model.result().export("play3").set("frametime", "0.001"); model.result().export("play3").set("plotgroup", "pg4"); model.result().export("play3").set("shownparameter", "2.05e-8"); model.result().export("play3").set("solnumtype", "level1"); return model; } }