wiki:rp_xml_ele_structure
Last modified 22 months ago Last modified on 06/15/13 03:23:22

<structure>

A structure is a collection of geometrical objects describing a physical structure. A structure can have embedded parameters (such as the size of certain parts of the structure) along with fields that represent numerical quantities defined within the structure.

This first example is a simple structure with three <box> elements representing layers in a 1D device:

  <structure>
    <current>
      <components>
        <box>
          <about>
            <label>GaAs</label>
            <color>green</color>
          </about>
          <corner>0</corner>
          <corner>100A</corner>
        </box>
        <box>
          <about>
            <label>AlGaAs</label>
            <color>white</color>
          </about>
          <corner>100A</corner>
          <corner>110A</corner>
        </box>
        <box>
          <about>
            <label>GaAs</label>
            <color>green</color>
          </about>
          <corner>110A</corner>
          <corner>200A</corner>
        </box>
      </components>
    </current>
  </structure>


This next example adds a <parameters> section with parameters that are specific to the device. This device has two contacts, and therefore requires two voltage settings. Another structure might have three contacts, and therefore require three settings. Any structure-dependent parameters should be embedded in the <parameters> section of the structure.

  <structure>
    <current>
      <parameters>
        <number>
          <about><label>Anode:</label></about>
          <units>V</units>
          <default>0V</default>
        </number>
        <number>
          <about><label>Cathode:</label></about>
          <units>V</units>
          <default>1V</default>
        </number>
      </parameters>

      <components>
        <box>
          <about>
            <label>P-type</label>
            <color>purple</color>
          </about>
          <corner>0</corner>
          <corner>0.1um</corner>
        </box>
        <box>
          <about>
            <label>N-type</label>
            <color>green</color>
          </about>
          <corner>0.1um</corner>
          <corner>0.2um</corner>
        </box>
      </components>
    </current>
  </structure>


This next example adds <fields>, which are numerical quantities as a function of position within a structure. Right now, only <constant> fields are supported, but different constant values can be specified in the different <box> elements that make up a structure. If the field value is the name of a parameter, then that field value can be edited interactively by the user.

  <structure>
    <current>
      <units>um</units>
      <parameters>
        <number id="doping">
          <about><label>Doping</label></about>
          <units>/cm3</units>
          <default>1.0e18/cm3</default>
        </number>
        <number id="emass">
          <about><label>Effective Mass</label></about>
          <default>0.067</default>
        </number>
      </parameters>

      <components>
        <box>
          <about>
            <label>Bulk Material</label>
          </about>
          <material>GaAs</material>
          <corner>0</corner>
          <corner>1um</corner>
        </box>
      </components>

      <fields>
        <field>
          <about>
            <label>Doping</label>
            <color>black</color>
            <scale>log</scale>
          </about>
          <units>/cm3</units>
          <component>
            <constant>doping</constant>
            <domain>box0</domain>
          </component>
        </field>

        <field>
          <about>
            <label>Effective Mass</label>
            <color>blue</color>
          </about>
          <component>
            <constant>emass</constant>
            <domain>box0</domain>
          </component>
        </field>
      </fields>
    </current>
  </structure>


Right now, Rappture doesn't have good support for 2D/3D geometries. But you can fake that support by including a 1D box region with an icon showing the 2D/3D geometry. Embed parameters for the structure right in the <parameters> section of the structure.

  <structure>
    <current>
      <parameters>
        <number id="w">
          <about><label>Channel Width W</label></about>
          <units>nm</units>
          <default>10nm</default>
        </number>
        <number id="l">
          <about><label>Channel Length L</label></about>
          <units>nm</units>
          <default>200nm</default>
        </number>
      </parameters>

      <components>
        <box>
          <about>
            <icon>
R0lGODlhvAB4AMZ8AAAAAAwA/w0B/w8D/xAE/xEF/xcL/xgL/xcM/xgM/xgN/xoP/yIX/yMX/yIY
/yMY/ywi/y0i/y4i/y0j/y4j/zMp/zQq/zgu/zku/zgv/zkv/zow/z40/z82/0M5/0M6/0Q6/05F
...
            </icon>
          </about>
          <corner>0</corner>
          <corner>1</corner>
        </box>
      </components>
    </current>
  </structure>


Structures can also contain a <molecule> element with a series of <atom> elements, representing the physical structure of a molecule.
See Molecule viewer FAQ for more information.

  <structure>
    <current>
      <components>
        <molecule>
          <about><emblems>on</emblems></about>
          <formula>pdt</formula>
          <atom id="0">
            <symbol>H</symbol>
            <xyz>-1.24935 -3.41562 0.0</xyz>
          </atom>
          <atom id="1">
            <symbol>S</symbol>
            <xyz>0.08092 -3.19426 0.0</xyz>
          </atom>
          <atom id="2">
            <symbol>C</symbol>
            <xyz>0.00055 -1.40789 0.0</xyz>
          </atom>
          <atom id="3">
            <symbol>H</symbol>
            <xyz>2.15434 -1.22709 0.0</xyz>
          </atom>
          <atom id="4">
            <symbol>H</symbol>
            <xyz>-2.1543 -1.22326 0.0</xyz>
          </atom>
          <atom id="5">
            <symbol>C</symbol>
            <xyz>1.20684 -0.69505 0.0</xyz>
          </atom>
          <atom id="6">
            <symbol>C</symbol>
            <xyz>-1.20381 -0.69647 0.0</xyz>
          </atom>
          <atom id="7">
            <symbol>C</symbol>
            <xyz>-1.20385 0.69776 0.0</xyz>
          </atom>
          <atom id="8">
            <symbol>C</symbol>
            <xyz>1.20676 0.69618 0.0</xyz>
          </atom>
          <atom id="9">
            <symbol>H</symbol>
            <xyz>-2.15434 1.22458 0.0</xyz>
          </atom>
          <atom id="10">
            <symbol>H</symbol>
            <xyz>2.15422 1.22819 0.0</xyz>
          </atom>
          <atom id="11">
            <symbol>C</symbol>
            <xyz>0.00054 1.40909 0.0</xyz>
          </atom>
          <atom id="12">
            <symbol>S</symbol>
            <xyz>0.08111 3.19538 0.0</xyz>
          </atom>
          <atom id="13">
            <symbol>H</symbol>
            <xyz>-1.24934 3.41562 0.0</xyz>
          </atom>
        </molecule>
      </components>
    </current>
  </structure>

You can see working code in the zoo of examples in the structure example or on the hub in the directory /apps/rappture/examples/zoo/structure.