.. _accessSuper: ============ Superelement ============ .. role:: red .. role:: big Routines for reading and writing the attributes of super elements. Geometric values (coordinates, lengths and areas) are related to the globally set unit (see :any:`settings` > `gobal_unit`). The vector values are cartesian coordinates if not otherwise indicated. Refer to :any:`trans` for transformation functions to other coordinate systems. :big:`Overview` ---------------------------------------------------------------------- +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ | Identifier | Nr of values| Unit | Acces get/set | Description | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |valid | 1 | \- | g | validity | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |key | 1 | \- | g | key (id) of this super element | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |srkey | 1 | \- | g | key of subregion | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |elkeys | [N] | \- | g | keys of all N elements of this superelement | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |ndkeys | [N] | \- | g | keys of all N nodes included in this superelement | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |ndchn | [N] | \- | g | keys of all N node chains included in this superelement | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |bndkeys | [N] | \- | g | keys of all N boundary nodes of this superelement | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |col | 1 | \- | g | color [1:255] | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |mcvtyp | 1 | \- | g/s | type of material curve (0: no curve, 1: Soft iron B(H), | | | | | | 2: permanent magnet B(H), 3: Soft iron B(H,alfa), | | | | | | 4: Permanent magnet B(H,Br), 5: Permanent magnet B(H,alfa), | | | | | | 6: soft iron punching, 7: Soft iron Tension, 8: Soft iron Temperature)| +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |condtyp | 1 | \- | g/s | Type of conductor (0: no wdg, 1: wire current, 2: wire flux, | | | | | | 3: bar current, 4: bar flux, 5: wire voltage, 6: bar voltage, | | | | | | 7: wire extern, 8: bar extern) | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |conduc | 1 | S/m | g/s | electrical conductivity | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |rlength | 1 | \- | g/s | relative length | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |velsys | 2 | \- | g/s | coordinate system of velocity (cartes, polar, cylind) | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |velo | 2 | m/s | g/s | velocity vector in coordinate system "velsys" | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |area | 1 | gu² | g | area of superelement | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |curd | 2 | A/mm² | g/s | (eddy) current density (Real, Imag) | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |cur | 2 | A | g | (eddy)current (Real, Imag) in superelement | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |curlos | 1 | W/gu | g | (eddy)current losses (mean) in superelement per unit length | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |spezwe | 1 | kg/m³ | g/s | specific mass density | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |thcond | 1 | W/(m*K) | g/s | thermal conductivity | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |thheat | 1 | J/(kg*K)| g/s | thermal heat capacity | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |temp | 1 | K | g/s | temperature of Subregion (FEMAG-ME) resp.. start temperature (FEMAG-TH)| +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |emodul | 1 | N/m² | g/s | elasticity modul | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |poisson | 1 | \- | g/s | ratio of transverse to axial strain | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ |linexp | 1 | 1/K | g/s | linear expansion coefficient | +------------+--------------+---------+-----------------+------------------------------------------------------------------------+ gu = global unit of length :big:`Befehlsbeschreibung` ---------------------------------------------------------------------- .. admonition:: Function: *key* = get_spel_key(x, y) Gibt die Nummer eines Superelementes zurück, das über die kartesischen Koordinaten x und y adressiert wird. **Parameter** | [in] :red:`x` Coordinate 1 | [in] :red:`y` Coordiante 2 **Return values** | :red:`key` Superelement number **Beispiel** .. code-block:: lua key = get_spel_key(x, y) -- Get the superelement's number print("super-element key = %d", key) -- Output to shell .. admonition:: Command: get_spel_keys(x, y, "var") Gibt die Nummern aller Superelemente einer Subregion zurück. Die Subregion wird über die kartesischen Koordinaten x und y adressiert. **Parameter** | [in] :red:`x` Coordinate 1 | [in] :red:`y` Coordiante 2 | [out] :red:`var` Bezeichner des Arrays in dem die Superelementnummern zurückgegeben werden **Beispiel** .. code-block:: lua get_spel_keys(x, y, "keys") -- Get all superelements of the subregion addressed by x,y N = table.getn(keys) -- Number of elements in array .. admonition:: Command: get_spel_keys("var") Gibt die Nummern aller Superelemente des Modells zurück **Parameter** | [out] :red:`var` Bezeichner des Arrays in dem die Superelementnummern zurückgegeben werden **Beispiel** .. code-block:: lua get_spel_keys("keys") -- Get all superelements of the model N = table.getn(keys) -- Number of elements in array .. admonition:: Function: *d1, d2, ...* = get_spel_data("identifier", key) Liest Daten eines Superelementes und gibt diese zurück. **Parameter** | [in] :red:`identifier` Art der auszulesenden Daten (siehe Tabelle) | [in] :red:`key` Superelement number **Return values** | :red:`d1` First return value | :red:`d2` Second return value **Beispiel: Ermittlung der Fläche eines Superelements** .. code-block:: lua A = get_spel_data("area", key) Alternativ zu key kann das Superelement auch über kartesische Koordinaten in der globalen Einheit adressiert werden. .. code-block:: lua A = get_spel_data("area", x, y) .. admonition:: Command: set_spel_data("identifier", key, d1, d2, ...) Weist einem Superelement die angegebenen Eigenschaften zu. **Parameter** | :red:`identifier` Art der zuzuweisenden Eigenschaft (siehe Tabelle) | :red:`key` Superelement number | :red:`d1` First refering value | :red:`d2` Second refering value **Beispiel: Vorgabe der Stromdichte eines Superelements** .. code-block:: lua set_spel_data("curd", key, 4.24, 1.5) Anwendungsbeispiel ^^^^^^^^^^^^^^^^^^ Ermittlung der Nummern aller in einer Subregion enthaltenen Superelemente und zyklisches Lesen einer Größe, hier die Fläche der Superelemente. .. code-block:: lua get_spel_keys(x, y, "keys") -- get all superelememt keys in subregion addressed by x,y N = table.getn(keys) -- number of keys for i = 1,N do draw_spel(keys[i], "red", 0) -- draw considered superelement A = get_spel_data("area", keys[i]) -- get property of superelement printf("%d %g", i, A) -- output result to shell end Rückgabe der Randknoten und Darstellung der Kontur eines Superelements. .. code-block:: lua bndkeys = get_spel_data("bndkeys", x0, y0) -- get all boarder node keys grf_clear() for j = 1,#bndkeys-1 do -- loop over all keys x1, y1 = get_node_data("xy", bndkeys[j]) -- get the node coordinates x2, y2 = get_node_data("xy", bndkeys[j+1]) point(x1, y1, "black", "x") -- draw nodes line(x1, y1, x2, y2, "black") -- draw the contour text(x1, y1, tostring(bndkeys[j]), "black", 0.1) -- print node numbers end x1, y1 = get_node_data("xy", bndkeys[1]) -- add the last node and close contour point(x2, y2, "black", "x") line(x1, y1, x2, y2, "black") text(x2, y2, tostring(bndkeys[#bndkeys]), "black", 0.1) ..