<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Field Precision software tips &#187; NewFeatures</title>
	<atom:link href="http://fieldp.com/myblog/category/newfeatures/feed/" rel="self" type="application/rss+xml" />
	<link>http://fieldp.com/myblog</link>
	<description>Effective finite-element modeling of electromagnetic fields</description>
	<lastBuildDate>Thu, 05 Jan 2012 15:24:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Multitasking made easy</title>
		<link>http://fieldp.com/myblog/2012/multitasking-made-easy/</link>
		<comments>http://fieldp.com/myblog/2012/multitasking-made-easy/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 16:29:09 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1233</guid>
		<description><![CDATA[<p>Field Precision programs are optimized for the latest generation of multi-core or multi-processor PCs. The 64-bit major solution programs (HiPhi, Magnum, GamBet,&#8230;) feature true parallel operation. The time-intensive subroutines have been coded in OpenMP, giving significant improvements in speed (see magnum-in-parallel or multicore-gambet). A second feature is the capability to run multiple independent calculations simultaneously. All [...]]]></description>
			<content:encoded><![CDATA[<p>Field Precision programs are optimized for the latest generation of multi-core or multi-processor PCs. The 64-bit major solution programs (<strong>HiPhi</strong>, <strong>Magnum</strong>, <strong>GamBet</strong>,&#8230;) feature true parallel operation. The time-intensive subroutines have been coded in <strong>OpenMP</strong>, giving significant improvements in speed (see <a href="http://fieldp.com/myblog/2009/magnum-in-parallel/" target="_blank">magnum-in-parallel</a> or <a href="http://fieldp.com/myblog/2011/multicore-gambet/" target="_blank">multicore-gambet</a>). A second feature is the capability to run multiple independent calculations simultaneously. All the solution programs can run in the background if launched from a Windows batch file. Background operation is automatic and faster than running in a window. Unfortunately, this capability is often overlooked because of the effort required to create batch files and to keep track of what tasks are running. The problem was brought home to me during a recent consulting project where I needed to make an extended sequence of <strong>Trak</strong> calculations with small changes in geometry. Each step involved re-running three programs. Even though I was well aware of the batch file capability, laziness prevailed and I ran each calculation interactively. My irritation level was not quite high enough to overcome my inertia. We recently added a new feature to our program launchers (<strong>TC</strong>, <strong>AMaze</strong>, <strong>GBLaunch</strong> and <strong>Xenos</strong>) that should tip the balance — the ability to create and to run <em>Tasks</em>. A Task is any sequence of installed programs and input files for a background run. With the feature you can 1) quickly define Tasks in an interactive dialog, 2) launch simultaneous Tasks in the background and 3) find out which tasks are running. I&#8217;ll discuss how it works in this article.</p>
<div class="wp-caption aligncenter" style="width: 388px"><img title="Figure 1. Task control group in the TC program launcher." src="http://www.fieldp.com/myblog/images/createtask01.png" alt="Figure 1. Task control group in the TC program launcher." width="378" height="688" /><p class="wp-caption-text">Figure 1. Task control group in the TC program launcher.</p></div>
<p>Figure 1 shows the new Task control group in the <strong>TC</strong> program launcher. The <em>CREATE TASK</em> button calls up the dialog of Figure 2. The user supplies a file prefix <em>FPREFIX </em>that indicates the function of the Task. The Task information will be stored in a DOS batch file <em>FPREFIX.BAT</em> created in the current <strong>TC</strong> data directory. Commands in the file are compatible with all recent Windows versions including Windows 7.</p>
<div class="wp-caption aligncenter" style="width: 663px"><img title="Figure 2. Create task dialog" src="http://www.fieldp.com/myblog/images/createtask02.png" alt="Figure 2. Create task dialog" width="653" height="480" /><p class="wp-caption-text">Figure 2. Create task dialog</p></div>
<p>Each row represents an operation (batch file command). The first column defines the action. Clicking on a cell brings up a menu that includes all <strong>TriComp </strong>programs capable of background operation that are installed on the user&#8217;s computer. In addition, several relatively safe DOS commands are included (<em>ERASE</em>, <em>COPY</em>, <em>MOVE</em>, <em>RENAME </em>and <em>REM</em>). All commands operate on a file (<em>FILEIN</em>). The DOS commands <em>COPY</em>, <em>MOVE </em>and <em>RENAME </em>require a second file name (<em>FILEOUT</em>). You can type file names in the cells. By default, the files are in the <strong>TC</strong> working directory, but you can include path information if the files are in other directories. Alternatively, you can click in a cell and pick the<em> SELECT FILE</em> command to raise the standard Windows dialog for choosing files anywhere on the computer. There is a nice feature for the <strong>TriComp </strong>programs — only files with appropriate suffixes are displayed (<em>e.g.</em>, <em>*.EIN</em> or <em>*.SCR</em> for <strong>EStat</strong>).</p>
<p>Click the <em>OK</em> button when the sequence is complete to create the batch file. Here is an example:</p>
<pre>REM TriComp batch file, Field Precision
START /B /WAIT C:\fieldp\tricomp\mesh64.exe C:\Temp\convergegun
START /B /WAIT C:\fieldp\tricomp\estat64.exe C:\Temp\convergegun
START /B /WAIT C:\fieldp\tricomp\trak64.exe C:\Temp\convergegun
ERASE *.?ls
START /B /WAIT C:\fieldp\tricomp\notify.exe
IF EXIST Electrode01.ACTIVE ERASE Electrode01.ACTIVE</pre>
<p>The operations listed perform a complete <strong>Trak </strong>calculation in the background and then erase all listing files. Here are some notable features:</p>
<ul>
<li>The operations are performed sequentially because data from one operation may be used in the next. To run calculations in parallel, define and run multiple Tasks.</li>
<li>You can modify the file with an editor if you are familiar with DOS commands.</li>
<li>The DOS commands recognize the standard wildcard conventions (* for any character grouping, ? for any character).</li>
<li>The programs adds the command <em>notify.exe</em> to the task sequence if <em>AUDIO ALARM</em> is checked. In this case, the computer beeps when a task is completed.</li>
<li>The final command to erase a file <em>FPREFIX.ACTIVE</em> is added to all batch files. The presence of an activate file indicates that the task is running.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 328px"><img title="Figure 3. Run task dialog" src="http://www.fieldp.com/myblog/images/createtask03.png" alt="Figure 3. Run task dialog" width="318" height="399" /><p class="wp-caption-text">Figure 3. Run task dialog</p></div>
<p>Click the <em>RUN TASK</em> button when you have created Tasks or moved predefined task files to the data directory. The dialog (Figure 3) organizes tasks into two groups: ones that are available to run and ones that are currently running (<em>i.e.</em>, <em>FPREFIX.ACTIVE</em> has been detected). To launch a task, choose one from the top list and click <em>OK</em>. The program creates a file <em>FPREFIX.ACTIVE</em> and runs the batch file. The program sequence runs silently in the background and the results appear almost magically. In the meantime, you can prepare other inputs or run other tasks.</p>
<p>This year, we&#8217;re concentrating on program features to improve the user experience. We have two goals: 1) increase the computation speed and efficiency and 2) reduce the setup times. Clearly, users should worry less about program details so they can concentrate on physic issues. Our next job is to add macro capabilities to the 2D and 3D postprocessors. With this feature, the programs will remember the steps in a session to create an analysis script.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2012/multitasking-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website introduction video</title>
		<link>http://fieldp.com/myblog/2011/website-introduction-video/</link>
		<comments>http://fieldp.com/myblog/2011/website-introduction-video/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 15:32:03 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1196</guid>
		<description><![CDATA[<p>We&#8217;ve added a lot of content to our website at www.fieldp.com in 13 years. In fact, there&#8217;s so much material that the site might intimidating to first-time visitors looking for software or educational resources. To help, we&#8217;ve added a short overview video on the home page. Here it [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve added a lot of content to our website at www.fieldp.com in 13 years. In fact, there&#8217;s so much material that the site might intimidating to first-time visitors looking for software or educational resources. To help, we&#8217;ve added a short overview video on the home page. Here it is:</p>
<p><!-- copy and paste. Modify height and width if desired. --> <object id="scPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/Company_Profile_Choosing.mp4&amp;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/" /><param name="src" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf" /><embed id="scPlayer" type="application/x-shockwave-flash" width="640" height="498" src="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf" base="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/" allowscriptaccess="always" scale="showall" allowfullscreen="true" flashvars="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/Company_Profile_Choosing.mp4&amp;blurover=false" bgcolor="#FFFFFF" quality="high" data="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/website-introduction-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/Company_Profile_Choosing.mp4&amp;amp" length="14288650" type="video/mp4" />
		</item>
		<item>
		<title>Particle flux plots in Gendist</title>
		<link>http://fieldp.com/myblog/2011/particle-flux-plots-in-gendist/</link>
		<comments>http://fieldp.com/myblog/2011/particle-flux-plots-in-gendist/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 13:55:09 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1188</guid>
		<description><![CDATA[<p>A recent consulting project involved Xenos simulations of an intense, non-circular electron beam striking a graphite beam stop. A phosphor plate on the downstream face of the target was used as a diagnostic. The researchers wanted to know how the shape of the phosphor response correlated with the shape of the beam. One option was to [...]]]></description>
			<content:encoded><![CDATA[<p>A recent consulting project involved <strong>Xenos </strong>simulations of an intense, non-circular electron beam striking a graphite beam stop. A phosphor plate on the downstream face of the target was used as a diagnostic. The researchers wanted to know how the shape of the phosphor response correlated with the shape of the beam. One option was to add the phosphor plate as a region in a <strong>GamBet </strong>simulation and then to plot dose distribution as a slice plot in <strong>GBView3</strong>.</p>
<p>For the design of other diagnostics, the researchers wanted the spatial distribution of the X-ray flux emitted from the target. Such plots could be created using the <strong>GenDist </strong>utility program from information in the <strong>GamBet </strong>escape file. The escape file is a record of parameters for all particles leaving the solution volume. <strong>GenDist </strong>is a general-purpose program to create and to analyze large distributions of particles (<em>e.g.</em>, electrons, ions, photons, positrons). For the application, the procedure was to load the escape file into <strong>GenDist </strong>and then to add filters that admit only photons at the exit face (<em>i.e.</em>, <em>z</em> coordinate great than or equal to the exit face position). Of the <strong>GenDist </strong>plot types, the 2D histogram was appropriate for the application. Here, particles are assigned to a 2D matrix of bins according to their position in the <em>x</em>-<em>y</em> plane. The probability function <em>N</em>(<em>x</em>,<em>y</em>) may be weighted by the model particle current, energy or combined current/energy. In this way, the program can generate spatial distributions of the following quantities:</p>
<ul>
<li>Model particle density.</li>
<li>Particle flux (weighted by model-particle current or flux).</li>
<li>Power flux (weighted by model-particle current and kinetic energy).</li>
</ul>
<p>The previous version of <strong>GenDist </strong>had only one available style for 2D histograms —  a projected 3D view showing <em>N</em>(<em>x</em>,<em>y</em>) as height above the <em>x</em>-<em>y</em> plane. Although the style gave attractive plots for presentations, it was not useful for quantitative work. We added the three new styles shown in the figure for better display of spatial particle distributions:</p>
<ul>
<li>The existing 3D bin height plot improved with color coding.</li>
<li>A 3D plot with bin height displayed as an interpolated shape.</li>
<li>A 2D contour line plot, showing surfaces of equal probability density.</li>
<li>A 2D filled contour plot.</li>
</ul>
<ul>
<li><img title="Plot styles for the 2D histogram type in GenDist" src="http://www.fieldp.com/myblog/images/gendistplot.png" alt="Plot styles for the 2D histogram type in GenDist" width="600" height="1811" /></li>
</ul>
<div class="mceTemp mceIEcenter">
<dl class="wp-caption aligncenter" style="width: 610px;">
<dd class="wp-caption-dd">Plot styles for the 2D histogram type in GenDist</dd>
</dl>
</div>
<p>b) 3D plot with bin height display as an interpolated shape.<br />
3) 2D contour line plot, showing surfaces of equal probability density.<br />
4) 2D filled contour plot.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/particle-flux-plots-in-gendist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved extrusion model in Geometer/MetaMesh</title>
		<link>http://fieldp.com/myblog/2011/improved-extrusion-model-in-geometermetamesh/</link>
		<comments>http://fieldp.com/myblog/2011/improved-extrusion-model-in-geometermetamesh/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 22:52:26 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1168</guid>
		<description><![CDATA[<p>MetaMesh (our 3D automatic mesh generator) accepts geometric information from a wide variety of sources (see Automatic meshing of printed circuits). For relatively simple systems, the quickest path to a mesh is through the native combinatorial solid modeler of MetaMesh. A variety of shape models are available. One of the most useful is the extrusion, the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>MetaMesh </strong>(our 3D automatic mesh generator) accepts geometric information from a wide variety of sources (see <a href="http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/" target="_blank">Automatic meshing of printed circuits</a>). For relatively simple systems, the quickest path to a mesh is through the native combinatorial solid modeler of <strong>MetaMesh</strong>. A variety of shape models are available. One of the most useful is the <em>extrusion</em>, the projection of a arbitrary shape over a given length. We have added new features that make it much easier to create extrusions with a desired position and orientation.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img class=" " title="Figure 1. Outline generation utility in Geometer" src="http://www.fieldp.com/myblog/images/extrusion01.png" alt="Figure 1. Outline generation utility in Geometer" width="550" height="546" /><p class="wp-caption-text">Figure 1. Outline generation utility in Geometer</p></div>
<p>I&#8217;ll start with a review of the old procedure for extrusions. The basic principle in <strong>MetaMesh </strong>is to define basic parts (<em>i.e.</em>, set model types and dimensions) in a reference workbench space and then to move them to the model space by <em>SHIFT </em>and <em>ROTATE </em>operations. In the old convention, an extrusion extended along <em>z</em> in the workbench space with its cross-section outline defined in the <em>x</em>-<em>y</em> plane. The outline consists of a set of line and arc vectors that form a closed shape. The outline editor of <strong>Geometer </strong>(a full-featured 2D CAD utility shown in Fig. 1) is a convenient way to create vector sets. Once created, an outline may be used to define multiple extrusions at different positions or orientation by adding <em>SHIFT </em>or <em>ROTATE </em>parameters. An extrusion using the outline of Fig. 1 has the following <em>TYPE </em>form in the <strong>MetaMesh </strong>script:</p>
<pre>Type Extrusion
  L    5.2912 -1.000 7.500 -1.000 S
  L    7.5000 -1.000 7.500  1.000 S
  L    7.5000  1.000 5.291  1.000 S
  A    5.2912  1.000 3.000  2.500  3.000  0.000 S
  A    3.0000  2.500 0.500  0.000  3.000  0.000 S
  A    0.5000  0.000 3.000 -2.500  3.000  0.000 S
  A    3.0000 -2.500 5.291 -1.000  3.000  0.000 S
End</pre>
<p>The data lines contain the <em>x</em>-<em>y</em> coordinates of the start and end points of lines and the start-end-center points of arcs.</p>
<p>Because the outline may specified at absolute positions in the <em>x</em>-<em>y</em> plane, it is easy to create desired extrusions that point along <em>z</em>. In most cases, <em>SHIFT </em>and <em>ROTATE </em>operations are unnecessary The problem arises if you want extrusions that extend along <em>x</em> or <em>y</em>. It is not immediately obvious to most people (myself included) how the <em>x</em>-<em>y</em> coordinates of Fig. 1 map to <em>y</em>-<em>z</em> or <em>z</em>-<em>x</em> coordinates when 90° rotations are applied about different axes. Positioning <em>x</em> or <em>y</em> extrusions often requires considerable experimentation in <strong>Geometer</strong>.</p>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 410px"><img title="Figure 2. Add/Edit part dialog in Geometer" src="http://www.fieldp.com/myblog/images/extrusion02.png" alt="Figure 2. Add/Edit part dialog in Geometer" width="400" height="596" /><p class="wp-caption-text">Figure 2. Add/Edit part dialog in Geometer</p></div>
<p>We have modified both <strong>Geometer </strong>and <strong>MetaMesh </strong>so that you can directly define extrusions along <em>x</em> and <em>y</em>. For extrusions along <em>x</em>, the outline coordinates are interpreted as absolute values in the <em>y</em>-<em>z</em> plane. For an extrusion along <em>y</em>, the outline data gives <em>z</em>-<em>x</em> values. It is easy to apply the feature. Figure 2 shows the modified <em>Add/Edit part </em>dialog in <strong>Geometer</strong>. The red arrow shows new radio buttons that are active only when the part type is set to <em>EXTRUSION</em>. The choice of extrusion axis determines how the path coordinates are interpreted. In the <strong>MetaMesh </strong>script, the TYPE command has a modified form:</p>
<pre>Type Extrusion [X,Y,Z]</pre>
<p>Some usage notes:</p>
<ul>
<li>If no direction option appears in the <em>TYPE EXTRUSION</em> command, the default is <em>Z</em>. Therefore, existing scripts are interpreted correctly.</li>
<li>The new capabilities affect the extrusion shape and direction in the workbench frame. <em>SHIFT </em>and <em>ROTATION </em>operations may still be applied in the transfer to the assembly frame.</li>
<li>The same outline may be used in <strong>Geometer </strong>for multiple extrusion parts with different extrusion directions. Figure 3 shows an example.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 3. Multiple=" src="http://www.fieldp.com/myblog/images/extrusion03.png" alt="Figure 3. Multiple=" width="550" height="642" /><p class="wp-caption-text">Figure 3. Multiple extrusions with different directions from the same outline</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/improved-extrusion-model-in-geometermetamesh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic 3D meshing of printed circuits</title>
		<link>http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/</link>
		<comments>http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 14:22:26 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1144</guid>
		<description><![CDATA[<p>A recent trial user had an application that required creation of a three-dimensional mesh of a printed circuit. Such an object is thin in z with relatively complex spatial variations in x-y. The user attempted to represent the full complement of conductors as a single, thin STL solid object with thousands of facets. It would have [...]]]></description>
			<content:encoded><![CDATA[<p>A recent trial user had an application that required creation of a three-dimensional mesh of a printed circuit. Such an object is thin in <em>z</em> with relatively complex spatial variations in <em>x</em>-<em>y</em>. The user attempted to represent the full complement of conductors as a single, thin STL solid object with thousands of facets. It would have been astronomically difficult for <strong>MetaMesh </strong>to analyze such a structure. The task is equivalent to deciding whether a point is inside or outside a thread of a spider web.</p>
<p>In reviewing the application, it occurred to me that there was a much easier approach to model such a structure, based on technology that we had already incorporated in the two-dimensional <strong>Mesh </strong>program. The idea is to assign elements in a plane to regions according to values in a photographic image. The advantages are easy setup and high reliability. In this article, I will describe new <strong>MetaMesh </strong>capabilities for analyzing photographs and illustrate them with an example of a layer in a printed circuit.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Figure 1. Sample printed circuit, PNG format." src="http://www.fieldp.com/myblog/images/printed_circuit_01.png" alt="Figure 1. Sample printed circuit, PNG format." width="500" height="439" /><p class="wp-caption-text">Figure 1. Sample printed circuit, PNG format.</p></div>
<p>Figure 1 is a photograph of the test geometry. The image has only two colors — white represents thin conductors. In the benchmark example, conductors (Region 2) are mapped to a 1.0 mm layer in a uniform solution volume (air, Region 1). The first step is to set the interpretation of photographs. The following entries appear in the <em>GLOBAL</em> section of the <strong>MetaMesh </strong>script:</p>
<pre>INTERVALS  Lightness
  50.0  100.0  2
END</pre>
<p>The construct states that photographs will be interpreted in terms of lightness values (0.0 to 100.0 percent). Lighter areas will be assigned to Region 2. An <em>INTERVAL </em>section may contain up to 250 data lines — in this case, only one interval is needed. Alternatively, assignment may be via hue values (0.0 to 360.0 degrees) in the image.</p>
<p>Parts are basic building blocks in <strong>MetaMesh</strong>. The concept is flexible — parts range from simple geometric solids to complex STL shapes. We have added a new <em>PHOTO </em>part type. The following section defines a photo part in the example:</p>
<pre>PART
  Type Photo PC01.PNG 0.00  0.00  50.00  50.00
  Name PC
  Fab 1.00
END</pre>
<p>In the workbench frame, the photograph image is mapped into an <em>x</em>-<em>y</em> plane centered at <em>z</em> = 0.0 with thickness Δ<em>z</em> set by the fabrication parameter. The resulting solid can be moved to any position or orientation with optional <em>SHIFT </em>and <em>ROTATE </em>commands. In the example, the photographic image is contain in the file <em>PC01.PNG</em>. (<strong>MetaMesh </strong>also handles BMP and PCX formats.) The information is mapped to an area with spatial dimensions <em>xmin</em> = 0.0, <em>ymin </em>= 0.0, <em>xmax </em>= 50.0 and <em>ymax </em>= 50.0, independent of the image pixel dimensions. Figure 2 shows the resulting mesh in the slice plane <em>z</em> = 0.0, while Figure 3 shows a three view with perspective. The entire structure was created with the two simple statements listed above.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 2. MetaMesh screen shot, slice in the plane z = 0.0." src="http://www.fieldp.com/myblog/images/printed_circuit_02.png" alt="Figure 2. MetaMesh screen shot, slice in the plane z = 0.0." width="550" height="450" /><p class="wp-caption-text">Figure 2. MetaMesh screen shot, slice in the plane z = 0.0.</p></div>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 3. Three dimensional view, printed-circuit example." src="http://www.fieldp.com/myblog/images/printed_circuit_03.png" alt="Figure 3. Three dimensional view, printed-circuit example." width="550" height="500" /><p class="wp-caption-text">Figure 3. Three dimensional view, printed-circuit example.</p></div>
<p>Photographic analysis is a powerful new feature of <strong>MetaMesh</strong>. It greatly simplifies the representation of multi-layer printed circuits and striplines for electromagnetic analysis. Complex printed-circuit assemblies can be built in two steps:</p>
<ol>
<li>Set up a foundation mesh with element layers of the appropriate thicknesses.</li>
<li>Use photographic layouts to set conductors or dielectrics in each layer. If there are different components in a single layer, they can be represented with different colors in the photograph.</li>
</ol>
<p>The photographic method has unlimited applications. Information from up to 250 photographs may be included in a <strong>MetaMesh </strong>script. The technique applies to any three-dimensional structure with photographic slice data, such as MRI scans.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use saved views</title>
		<link>http://fieldp.com/myblog/2011/how-to-use-saved-views/</link>
		<comments>http://fieldp.com/myblog/2011/how-to-use-saved-views/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 20:42:43 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1069</guid>
		<description><![CDATA[<p>We recently added the capability to save and to load plot views (discussed in a previous post) to our two-dimensional TriComp field programs (EStat, PerMag, EMP, Nelson, TDiff, Pulse, RFE2 and WaveSim). In the interactive environment, the Save view command generates a formatted text file FPrefix.FPV where FPrefix is a descriptive name assigned by the user. [...]]]></description>
			<content:encoded><![CDATA[<p>We recently added the capability to save and to load plot views (discussed in a <a href="http://fieldp.com/myblog/2010/saved-views-in-metamesh-and-the-amaze-postprocessors/" target="_blank">previous post</a>) to our two-dimensional <strong>TriComp </strong>field programs (<strong>EStat</strong>, <strong>PerMag</strong>, <strong>EMP</strong>, <strong>Nelson</strong>, <strong>TDiff</strong>, <strong>Pulse</strong>, <strong>RFE2 </strong>and <strong>WaveSim</strong>). In the interactive environment, the <em>Save view</em> command generates a formatted text file <em>FPrefix.FPV</em> where <em>FPrefix </em>is a descriptive name assigned by the user. The file contains the complete set of plotting parameters. This excerpt illustrates the format:</p>
<pre>Program: TriComp
PlotStyle: Spatial
Outline: ON
Grid: ON
Scientific: OFF
FixedPoint: OFF
Vectors: OFF
XGMin:  3.500000E+00
XGMax:  9.000001E+00
...</pre>
<p>The file contains all necessary parameters to reconstruct spatial plots (in the <em>z-r</em> or <em>x-y</em> planes). The file includes the following information for spatial plots:</p>
<ul>
<li>Style information, like whether to display a reference grid, element outlines or field vectors.</li>
<li>Boundaries of zoomed views</li>
<li>The plot type (e.g., mesh, filled contour, contour lines,&#8230;)</li>
<li>The plotted quantity.</li>
</ul>
<p>You can also save information to reconstruct scan plots:</p>
<ul>
<li>Style information (number of scan points, symbol display,&#8230;)</li>
<li>Coordinates of the scan start and end Limits of the scan.</li>
<li> Plotted quantity.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 640px"><img title="Spatial versus scan plots in TriComp programs" src="http://www.fieldp.com/myblog/images/saved_view.png" alt="Spatial versus scan plots in TriComp programs" width="630" height="309" /><p class="wp-caption-text">Spatial versus scan plots in TriComp programs</p></div>
<p>The simplest application of saved views is to restore a complex plot when you reload the solution at a later time. We have included several features in our implementation to enable a higher level of data analysis:</p>
<ul>
<li>A saved view works even if a completely different solution than one use to create the view in loaded. In fact, views can be reloaded even if the user is running a different <strong>TriComp </strong>program. The current program analyzes the parameters and uses only ones that are relevant. For example, if a view-boundary or scan point is outside the current solution volume, the point is moved to the boundary. If a plot quantity is undefined, the first valid quantity  is used.</li>
<li>A free-form parser is employed when a view is loaded. Therefore, a file need not contain a complete set of parameters. Changes are made only to the quantities listed in the file.</li>
<li>Users can modify entries in the view file, either directly with an editor or via a Perl or Python script. You can include comments, change parameter values or remove parameter lines.</li>
</ul>
<p>Another important feature is related to the fact that analysis functions of all <strong>TriComp </strong>postprocessors may be controlled by a text script. We have added the following  script command:</p>
<pre>PLOT FSaveView FOutput Nx Ny
PLOT (DiodeRegion VIEW001 800 600)</pre>
<p>The string <em>FSaveView </em>is the prefix of a saved view file. The string <em>FOutput </em>is the prefix of a plot file in BMP format. The integer parameters give the image resolution in pixels. In response to the command, the program loads the saved view file, applies the parameters to create a plot for the currently-loaded solution and saves it as a graphics file.</p>
<p>Here are some possible scenarios:</p>
<ul>
<li>You have a set of electric field solutions with different applied voltage and possibly different boundaries and you want to check electric field levels in a critical region (<em>e.g.</em>, an electron source). Use the <em>Zoom</em> command to create the desired plot and save a view file. Remove all information lines except the view boundaries and load the view when you load a different solution.</li>
<li>You have a set of magnetic field solutions and want precision plots of field lines passing through specific points. Add a field line interactively in <strong>PerMag </strong>and save a template view file. Then edit the view file to remove unnecessary information, change the number of field lines and add coordinates for the desired points.</li>
<li>You want to create a large set of radial temperature scans moving along the axis of a probe assembly. In <strong>TDiff</strong>, create a template view file for one scan. Write a Python or Perl script with a loop of axial positions that modifies the axial scan coordinates in the view file and then runs <strong>TDiff </strong>in the analysis mode. The set of BMP files could then be stitched into an AVI movie with our <strong>Cecil_B</strong> utility.</li>
<li>A sequence of annotated view files could be employed in a training session or educational demonstration.</li>
<li>You want to show how the levels of magnetic flux induction change with changing coil currents, preserving magnitude scaling in the plots. After creating a set of solutions, load one of them adjust the view, plot style and plot quantity. Turn off autoscaling, specify values for <em>BMin </em>and <em>BMax </em>and then save a view file. Load the view for the other solutions.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/how-to-use-saved-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interaction forcing in GamBet</title>
		<link>http://fieldp.com/myblog/2011/interaction-forcing-in-gambet/</link>
		<comments>http://fieldp.com/myblog/2011/interaction-forcing-in-gambet/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 22:29:03 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1043</guid>
		<description><![CDATA[<p>Recently, a GamBet user reported calculations where the code violated conservation of energy by several orders of magnitude. This is the type of statement that generally catches my attention, so I decided to investigate the issue. An inspection of his input files showed that he was using a bremsstrahlung forcing factor of 1000. If I were [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, a <strong>GamBet </strong>user reported calculations where the code violated conservation of energy by several orders of magnitude. This is the type of statement that generally catches my attention, so I decided to investigate the issue. An inspection of his input files showed that he was using a bremsstrahlung forcing factor of 1000. If I were implementing variance reduction, I would pick a factor of 20, while a value of 100 would make me nervous (my choices are reflected in the parameters of the application examples supplied with the code). On the other hand, I never said not to use 1000 (or even 10,0000) in the instruction manual, so some guidance is needed.</p>
<p>To review, interaction forcing is used in <strong>GamBet </strong>to improve statistics for low-probability events like photon-production via bremsstrahlung or pair production. In the <strong>Penelope </strong>routines, the probability of an event is increased by <em>Fb</em>, but the weight of secondary particles (and their descendants) is decreased by 1/<em>Fb</em>. If you use <em>Fb</em> = 100 to find a bremsstrahlung spectrum, the variance between bins is decreased by about a factor of 10. At the same time, the run time should be significantly less than <em>Fb</em> times the run time with no forcing.</p>
<p>The user&#8217;s example involved a 16 MeV electron beam striking a 6 mm thick sheet of tantalum. To understand the effect of forcing factor on the validity of results, I made a series of runs with different values of <em>Fb</em>. The first plot shows the global energy balance as a function of <em>Fb</em>. Here, <strong>GamBet </strong>sums energy lost from primary and secondary particles to the escape file and to absorption in the solution volume. The code compares this value to the input energy of primaries. The plot shows that conservation of energy holds to within a few percent up to <em>Fb</em> = 100. An abrupt change occurs near <em>Fb</em> = 150 — energy conservation is lost at higher values. The second plot shows the run time versus <em>Fb</em>. It increases linearly (as expected) up to around <em>Fb</em> = 150 and then saturates.</p>
<div class="wp-caption aligncenter" style="width: 630px"><img title="Energy error as a function of forcing function" src="http://www.fieldp.com/myblog/images/intforce01.png" alt="Energy error as a function of forcing function" width="620" height="492" /><p class="wp-caption-text">Energy error as a function of forcing factor</p></div>
<p>I identified the cause of the problem as overflow of the <strong>Penelope </strong>secondary-particle stack. In a shower calculation, <strong>Penelope </strong>tracks a primary particle and stores the parameters of secondaries on the stack. Then it pops each secondary from the stack and tracks it. In the process, additional secondaries may be pushed on the stack. Tracking continues until the stack is empty, and then the code proceeds to the next primary. The <strong>Penelope </strong>routines do not halt program operation when an overflow occurs because there may be rare showers with a large number of secondaries. Rather, Penelope ignores extra secondaries leading to unaccounted energy. Application of a forcing factor increases the number of entries per shower to store on the stack by about a factor of <em>Fb</em>. Therefore, a value <em>Fb</em> = 1000 could clearly lead to trouble. I confirmed the hypothesis by increasing the stack size from 2000 to 5000 entries. In this case, energy was conserved to <em>Fb</em> = 200.</p>
<div class="wp-caption aligncenter" style="width: 643px"><a href="Run time as a function of forcing function"><img title="Run time as a function of forcing function" src="http://www.fieldp.com/myblog/images/intforce02.png" alt="" width="633" height="474" /></a><p class="wp-caption-text">Run time as a function of forcing factor</p></div>
<p>To reduce the chance of errors in future user calculations, I made some changes in <strong>GamBet</strong>:</p>
<ol>
<li>I increased the secondary stack size to 5000. The larger static array increases the code RAM utilization by only about 10 MB.</li>
<li>I added cautionary material to the section on the <em>FORCE </em>command in the <strong>GamBet </strong>reference manual.</li>
<li>I modified <strong>GamBet </strong>to count the number of instances of stack overflow. If the value exceeds zero, the code writes a warning in the listing file (<em>GLS</em>).</li>
</ol>
<p>Finally, we can gauge the utility of interaction forcing from low-<em>Fb</em> entries in the second plot. The run time was 5 seconds for <em>Fb</em> = 1. It increased to 103 seconds with Fb = 100. To get the same statistics for the bremsstrahlung spectrum with <em>Fb</em> = 1, we would need to increase the number of showers by a factor of 100, giving a run time of about 500 seconds. In this case, interaction forcing reduces the run time to achieve a given statistical accuracy by about a factor of 5.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/interaction-forcing-in-gambet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monte Carlo code particle filtering</title>
		<link>http://fieldp.com/myblog/2011/monte-carlo-code-particle-filtering/</link>
		<comments>http://fieldp.com/myblog/2011/monte-carlo-code-particle-filtering/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 13:52:36 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1000</guid>
		<description><![CDATA[<p>The two primary data outputs of our GamBet code are 1) the deposited energy distribution and 2) the particle escape list. The escape file contains the parameters of electron, photons and positrons that leave the solution volume. This information may be displayed and analyzed with GenDist, our interactive distribution utility. The information is useful for investigating [...]]]></description>
			<content:encoded><![CDATA[<p>The two primary data outputs of our <strong><a href="http://www.fieldp.com/gambet.html" target="_blank">GamBet </a></strong>code are 1) the deposited energy distribution and 2) the particle escape list. The escape file contains the parameters of electron, photons and positrons that leave the solution volume. This information may be displayed and analyzed with <strong>GenDist</strong>, our interactive distribution utility. The information is useful for investigating processes like X-ray generation, backscatter, forward scattering and flux attenuation.  The procedure in <strong>GamBet </strong>2.2 was to record all exit particles and to apply filtering in <strong>GenDist</strong>.</p>
<p>We recently released <strong>GamBet </strong>3.0 with support for parallel processing. We anticipate that users will set up large production runs with a high number of showers for improved statistics.  The corresponding larger escape files would take longer to load in <strong>GenDist</strong>. In extensive calculations to study rare events, the bulk of the particles recorded in the escape would not be of interest.</p>
<p>To increase efficiency, we added the option for escape particle filtering in <strong>GamBet </strong>3.0. Filters may be applied to limit particles recorded in the escape file by species, exit position and kinetic energy.  The procedure to define a filter is relatively easy. There is a new command of the form</p>
<pre>ESCAPEFILTER Condition1 Condition2 Condition3 ...</pre>
<p>A <em>condition </em>is short string with no delimiters. Multiple conditions are separated by spaces. Any number of conditions may be included in the line. The following conditions determine the included particle types:</p>
<pre>ElecP  PhotP  PosiP  ElecS  PhotS  PosiS</pre>
<p>Here the letters <em>P</em> and <em>S</em> designate <em>primary </em>and <em>secondary</em>. If the <em>EscapeFilter</em> command appears, the initial condition is that no particle species passes the filter. If one or more of the conditions appears, only the specified types are included. For example, this command includes only secondary electrons and photons:</p>
<pre>ESCAPEFILTER ElecS PhotS</pre>
<p>The following expression types define pass conditions for particles according to their exit positions:</p>
<pre>  X&gt;10.56  Y&lt;1.0E-8  Z&gt;15  R&gt;30.5, ....</pre>
<p>The conditions begin with a character to define the coordinate axis: <em>X</em>, <em>Y</em>, <em>Z</em> or <em>R</em>. The quantity <em>R</em> is given by  <em>R</em>^2 = <em>X</em>^2 + <em>Y</em>^2. Position conditions act differently from species conditions. In the absence of a condition, all particles pass the filter. The expression <em> Z</em>&gt;33.5  means that 1) only particles with final <em>z</em> coordinate greater than 33.5 are included and 2) particles with all values of <em>x</em> and <em>y</em> are included. As an example, the command</p>
<pre>ESCAPEFILTER X&gt;0.0 Y&gt;0.0</pre>
<p>passes only particles that exit in the first quadrant of the <em>x</em>-<em>y</em> plane. In this case, no filtering is applied in <em>z</em>. Finally, conditions of the form</p>
<pre>T&lt;5.0E6, T&gt;1500,....</pre>
<p>pass particles according to their kinetic energy. To illustrate a complex filter, consider a 500 keV photon beam passing through a slab of material with <em>Zmax</em> = 60.0 mm. To calculate the attenuation coefficient, we want to find the number of full-energy, primary photons that emerge from the exit face. The appropriate filter command is:</p>
<pre>ESCAPEFILTER PhotP T&gt;4.999E5 Z&gt;59.999</pre>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/monte-carlo-code-particle-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multicore GamBet</title>
		<link>http://fieldp.com/myblog/2011/multicore-gambet/</link>
		<comments>http://fieldp.com/myblog/2011/multicore-gambet/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 19:20:04 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=942</guid>
		<description><![CDATA[<p>Among available packages for Monte Carlo simulations of electrons and X-rays in matter, GamBet has several unique capabilities:</p>

Definition of 3D geometries in an interactive graphical-user-interface with the option for import from SolidWorks.
Dose records on conformal 3D meshes for accuracy
Option to add 3D electric and magnetic fields from HiPhi and Magnum
Import of electron distributions from Trak and [...]]]></description>
			<content:encoded><![CDATA[<p>Among available packages for Monte Carlo simulations of electrons and X-rays in matter, <strong>GamBet </strong>has several unique capabilities:</p>
<ul>
<li>Definition of 3D geometries in an interactive graphical-user-interface with the option for import from <strong>SolidWorks</strong>.</li>
<li>Dose records on conformal 3D meshes for accuracy</li>
<li>Option to add 3D electric and magnetic fields from <strong>HiPhi </strong>and <strong>Magnum</strong></li>
<li>Import of electron distributions from <strong>Trak </strong>and <strong>OmniTrak</strong>.</li>
<li>Export deposited energy for thermal calculations in <strong>TDiff </strong>and <strong>HeatWave</strong>.</li>
</ul>
<p>In a conversation with a friend who is power-user of <strong>GamBet</strong>, he stated that these features were nice but that all he cared about was speed and accuracy. Thanks to that bracing insight, we decided to proceed with a long-planned upgrade of the <strong>GamBet </strong>numerical engine. We addressed the accuracy issue by upgrading the collision physics engine to the latest version of <strong>Penelope</strong>, one of the highest-rated package for X-ray science (for a review, see the reference M.Vilches, <em>et.al</em>., <em>Monte Carlo simulation of the electron transport through thin slabs: A comparative study of penelope, geant3, geant4, egsnrc and mcnpx</em> (Nucl. Instrum. and Methods <strong>254</strong>, 219, 2007) available at this link:  <a href="http://arxiv.org/pdf/physics/0612044" target="_blank">http://arxiv.org/pdf/physics/0612044</a>). The expanded database supports particle interactions as low as 50 eV.</p>
<p>Parallel processing is clearly the key to the speed issue. Our emphasis is on <strong>Windows</strong>-based computers with multiple processors or multi-core chips — a <em>shared memory</em> architecture. Accordingly, we have integrated <strong>OpenMP</strong> in our field solution programs (<strong>HiPhi</strong>, <strong>Magnum</strong>, &#8230;). In these programs, the matrix-inversion process that occupies the bulk of the computing time is relative easy to parallelize. Threads work on separated parts of the matrix so there is no problem with conflicts. Although at first glance a Monte Carlo code would seem to be a good candidates for parallel operation, there were potential thread conflicts in <strong>GamBet</strong>:</p>
<ul>
<li>Primary and secondary particles update deposited dose on a single conformal mesh. Because of the complexity of trajectories, it would be impossible to ensure that particles from simultaneous showers are not in the same cell.</li>
<li><strong>Penelope </strong>is not written for parallel operation, and there are potential shared resource like the secondary stack. I felt it would be foolhardy to make fundamental changes to the structure of the package.</li>
</ul>
<p>For these reasons, we decided to take a <em>distributed memory</em> approach with <strong>GamBet</strong>. In this case, multiple instances of the program with independent storage run in individual threads controlled by the operating system. The resulting data files are combined at the end to a single representation with improved statistics. This approach is easily-implemented in modern <strong>Windows </strong>computers where the standard memory is 4 GB or more. The additional advantage is that <strong>GamBet </strong>can easily be adapted to large cluster computers. We would be interested in working with researchers running such machines.</p>
<p>As a reference for users of <strong>GamBet 3.0</strong>, here is how we have implemented parallel operation:</p>
<p>1) Parallel operation is initiated with the new command</p>
<pre>PARALLEL NProc [NWait]</pre>
<p>in the <em>PROCESS </em>section of the input script. The integer parameter <em>NProc </em>is the number of threads to initiate, less than or equal to the maximum number of threads on the <strong>Windows </strong>machine. For a Core i7 processor, the maximum value is 8. The parameter <em>NWait </em>is the maximum number of seconds to wait for a child process to complete before going on to the next one.</p>
<p>2) The primary process is handled by the program <strong>gambet.exe</strong>, which may be run in an interactive window or in the background under batch file control. In the absence of the <em>PARALLEL </em>command, the program runs serially as before. If the command is present, the primary process creates a common <strong>Penelope </strong>material input file and then initiates (<em>NProc</em>-1) instances of the program <strong>gambetmp.exe</strong>. This program is a background version of <strong>gambet.exe</strong> that sends start and end signals. The control program sends the following information in the command line: the script prefix <em>FPREFIX</em> and a process number in the range 1 &lt;=<em> NP</em> &lt;= (<em>NProc</em>-1).</p>
<p>3) There are shared input resources that could cause conflicts (<em>e.g.,</em> the control script, the <strong>Penelope </strong>material file and the geometry mesh). A child process reads the information, closes the files and then sends a start signal (<em>i.e.</em>, creates a file with a name <em>FPREFIX01.START, FPREFIX02.START</em>,&#8230;). The control program waits until the start signal is detected before starting the next child process.</p>
<p>4) When all child processes are running, the control program proceeds with its own calculation, issuing standard screen messages.</p>
<p>5) When the calculation is complete, the control program checks that all child processes have sent an end signal (<em>i.e.</em>, created a file with a name <em>FPREFIX01.END, FPREFIX02.END</em>,&#8230;). The program waits a maximum of <em>NWait </em>seconds for each process before going on to the next.</p>
<p>6) The data of the primary process and successful child processes are combined. Start and end signals and unnecessary files are deleted.</p>
<p>The following type of data combination are performed:</p>
<ul>
<li>The primary process and each child process creates an escape file listing parameters of particles that escape from the solution volume. Data lines from the child files are appended to the primary escape file.</li>
<li>Data from all 2D or 3D dose files are read, averaged and written to the primary dose file. For an 8-thread machine, random statistical variations are reduced by a factor of about 2.83.</li>
<li>Statistical, flux and energy conservation quantities in the listing file are read, average and recorded in the primary listing file. Other information is unchanged.</li>
</ul>
<p>Here are some concluding notes on parallel operation:</p>
<ul>
<li>Although the input and output operations are involved, everything is handled by the code. The user need only include the <em>PARALLEL </em>command in the control script.</li>
<li>The serial input and data combination operations take only a few seconds. Therefore, a quad-core computer can handle four times the number of showers in almost the same time as a serial run.</li>
<li><strong>GamBet </strong>can generate plots of sample electron, photon and positron orbits. To avoid monster files, generation of such data is best done in a serial run. Therefore, the <em>PLOTON </em>command is deactivated in a parallel run.</li>
<li>The programs <strong>gambet.exe</strong> and <strong>gambetmp.exe</strong> have been modified to ensure that there is a unique random number seed for the primary process and each child process. Otherwise, each process would generate identical information that would be summed and then divided by <em>NProc</em>. Without a unique seed, there would be no point to a parallel run.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 625px"><img class=" " title="Usage history for a six-thread run " src="http://www.fieldp.com/myblog/images/gambet_parallel.png" alt="Usage history for a six-thread run" width="615" height="464" /><p class="wp-caption-text">Usage history for a six-thread run</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/multicore-gambet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic movie generation in thermal and electromagnetic codes</title>
		<link>http://fieldp.com/myblog/2010/automatic-movie-generation-in-thermal-and-electromagnetic-codes/</link>
		<comments>http://fieldp.com/myblog/2010/automatic-movie-generation-in-thermal-and-electromagnetic-codes/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 15:32:04 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=810</guid>
		<description><![CDATA[<p>In a  previous posting, I described our plan to add automatic movie-generation capabilities to our time-domain codes. We have completed and tested the feature in the 2D TriComp codes TDiff (dynamic heat transport), Pulse (magnetic-field diffusion) and EMP (time-domain electromagnetic radiation). The plots show contour lines of temperature in TDiff, lines of magnetic flux density (B) [...]]]></description>
			<content:encoded><![CDATA[<p>In a  <a href="(http://fieldp.com/myblog/2010/advanced-3d-graphics-and-movie-capabilities/" target="_blank">previous posting</a>, I described our plan to add automatic movie-generation capabilities to our time-domain codes. We have completed and tested the feature in the 2D <strong>TriComp </strong>codes <strong>TDiff </strong>(dynamic heat transport), <strong>Pulse </strong>(magnetic-field diffusion) and <strong>EMP </strong>(time-domain electromagnetic radiation). The plots show contour lines of temperature in <strong>TDiff</strong>, lines of magnetic flux density (<strong>B</strong>) in <strong>Pulse</strong>, and electric or magnetic field lines in <strong>EMP </strong>(depending on the EM mode). We expect to complete modifications of the 3D programs <strong>HeatWave </strong>and <strong>Aether </strong>by the February 1 update.</p>
<p>Creating a movie in AVI format is easy and takes just a few minutes. Here&#8217;s how it works:</p>
<p>1) Add the <em>MOVIE </em>command to a working input script. The command has the format</p>
<pre>MOVIE NFrames  [NH  NV  QMin  QMax]
MOVIE 100 640 480 0.0 100.0</pre>
<p>The integer quantity <em>NFrames </em>is the approximate number of frames. I say approximate because <strong>TDiff </strong>and <strong>Pulse </strong>employ a variable time step. In this case, the code does its best to create <em>NFrames </em>plot files at equal time intervals. The integer quantities <em>NH </em>and <em>NV </em>are the number of horizontal and vertical pixels in the output graphics files. The default is 1024 × 768. I picked 640 × 480 for the example included for a good display on the Internet.</p>
<p>2) Run the simulation. The new feature is compatible with solution display, so you can monitor the plots during the run. The program generates approximately <em>NFrames </em>files in BMP format, at an interval o<em>TMax</em>/<em>NFrames</em> starting at <em>t</em> = 0. If the input script has the name <em>FPrefix.TIN</em>, the graphics files have names <em>FPrefix000.BMP</em>, <em>FPrefix001.BMP</em>, &#8230;.</p>
<p>3) Run our free movie-generation program <strong>CECIL_B</strong>, available at <a href="http://www.fieldp.com/cecil_b.html" target="_blank">http://www.fieldp.com/cecil_b.html</a>. Navigate to the directory that contains the BMP images and point to any file in the set. <strong>CECIL_B</strong> automatically orders the files and combines them into an AVI movie. The program uses defaults or the frames/second and codec of your choice.</p>
<p>The following example was created with <strong>TDiff </strong>in the dynamic mode. The run generated about 100 frames. They are projected at 10 frames/second.<br />
<object id="scPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation_controller.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation.mp4&amp;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/" /><param name="src" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation_controller.swf" /><param name="flashvars" value="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation.mp4&amp;blurover=false" /><param name="allowfullscreen" value="true" /><embed id="scPlayer" type="application/x-shockwave-flash" width="640" height="498" src="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation_controller.swf" base="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/" allowscriptaccess="always" scale="showall" allowfullscreen="true" flashvars="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation.mp4&amp;blurover=false" bgcolor="#FFFFFF" quality="high" data="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation_controller.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2010/automatic-movie-generation-in-thermal-and-electromagnetic-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e3865736-126b-4514-b8ea-6cea421c97d7/tdiff_movie_generation.mp4&amp;amp" length="521006" type="video/mp4" />
		</item>
	</channel>
</rss>

