Salome HOME
Issue #3223: Improve Python dump readability
[modules/shaper.git] / src / CollectionPlugin / doc / fieldFeature.rst
1 .. |field.icon|    image:: images/field.png
2
3 Field
4 =====
5
6 A field object assigns some values to geometrical entities. These values can be later transferred to mesh entities generated on the geometrical entities during export to MED file in Mesh module. Geometrical fields can be stored in/restored from XAO format files. Note that only integer and double values can be exported into the MED file.
7
8 The field can hold several named values (components) per geometrical entity.
9
10 The field can include several sets of data called steps, each dedicated to a certain time moment.
11
12 To create a Field in the active part:
13
14 #. select in the Main Menu *Features - > Field* item  or
15 #. click |field.icon| **Field** button in the toolbar:
16
17 The following property panel appears. 
18
19 .. figure:: images/field_property_panel.png
20   :align: center
21
22   Create a field
23
24 Input fields:
25
26 - **Type of shapes** selects geometrical entities to which field values will be assigned from drop-down list:
27   
28   - Vertices;
29   - Edges;
30   - Faces;
31   - Solids;
32   - Objects;
33   - Parts;
34
35 - **Type of field** selects type of field values from drop-down list:
36       
37   - Boolean;
38   - Integer;
39   - Double;
40   - String;
41   
42 - **Nb. Components** defines number of named values (components) assigned to each geometrical entity;
43 - **Stamp** sets time stamp for the current time step;
44 - **Current step** slider navigates through added steps; 
45 - table of values for each step contains:
46
47   - rows whose number depends on the number of entities selected in OCC 3D viewer;
48   - **Default value** row contains values assigned to non-selected entities of the parent shape with given type; 
49   - columns whose number depends on **Nb. Components**;
50   - to rename a component double-click a column header;  
51       
52 - **Add Step** button adds a new time step;
53 - **Remove Step** button deletes the current time step.
54
55 **Visualization of field**
56
57 When a field is created then its result in data tree looks like following.
58
59 .. figure:: images/field_steps_tree.png
60   :align: center
61
62   Result of created field with two steps.
63   
64 It consists of a Field result object and steps as sub-objects. Only one object can be displayed at one moment: field or one of its step. Field result presentation repersents entities used for the Field definition.
65 Step presentation shows field entities and values defined on them. For example a step defined on faces with double values looks like following.
66
67 .. figure:: images/step_faces_double.png
68   :align: center
69
70 Color bar for displayed step is shown only if the setep is selected in **Object Browser**. Desirable parameters of the Color bar (position, number of intervals, text color) can be defined in **Preferences** dialog box.
71  
72 **TUI Commands**:
73
74 .. py:function:: model.addField(Part_1_doc, 2, "DOUBLE", 2, ["DX", "DY"], [model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Top")])
75
76     :param part: The current part object
77     :param integer: Number of steps
78     :param text: Type of the field
79     :param integer: Number of components
80     :param list: List of components names
81     :param list: List of objects
82     :return: the created field object
83
84 .. py:function:: Field_1.addStep(step, stamp, [[0.1, 0.2], [2.1, 1.7], [3.7, 1.95]])
85
86     :param integer: step id
87     :param integer: time stamp id
88     :param list: list of lists of values with Type of field
89
90 **See Also** a sample TUI Script of :ref:`tui_create_field` operation.