Salome HOME
c0aa1b2792974dce364356d7349ec59369eadcda
[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 .. image:: images/field_property_panel.png
20   :align: center
21
22 .. centered::
23   Create a field
24
25 Input fields:
26
27 - **Type of shapes** selects geometrical entities to which field values will be assigned from drop-down list:
28   
29   - Vertices;
30   - Edges;
31   - Faces;
32   - Solids;
33   - Objects;
34   - Parts;
35
36 - **Type of field** selects type of field values from drop-down list:
37       
38   - Boolean;
39   - Integer;
40   - Double;
41   - String;
42   
43 - **Nb. Components** defines number of named values (components) assigned to each geometrical entity;
44 - **Stamp** sets time stamp for the current time step;
45 - **Current step** slider navigates through added steps; 
46 - table of values for each step contains:
47
48   - rows whose number depends on the number of entities selected in OCC 3D viewer;
49   - **Default value** row contains values assigned to non-selected entities of the parent shape with given type; 
50   - columns whose number depends on **Nb. Components**;
51   - to rename a component double-click a column header;  
52       
53 - **Add Step** button adds a new time step;
54 - **Remove Step** button deletes the current time step.
55
56 **Visualization of field**
57
58 When a field is created then its result in data tree looks like following.
59
60 .. image:: images/field_steps_tree.png
61   :align: center
62
63 .. centered::
64   Result of created field with two steps.
65   
66 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.
67 Step presentation shows field entities and values defined on them. For example a step defined on faces with double values looks like following.
68
69 .. image:: images/step_faces_double.png
70   :align: center
71
72 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.
73  
74 **TUI Commands**:
75
76 .. 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")])
77
78     :param part: The current part object
79     :param integer: Number of steps
80     :param text: Type of the field
81     :param integer: Number of components
82     :param list: List of components names
83     :param list: List of objects
84     :return: the created field object
85
86 .. py:function:: Field_1.addStep(step, stamp, [[0.1, 0.2], [2.1, 1.7], [3.7, 1.95]])
87
88     :param integer: step id
89     :param integer: time stamp id
90     :param list: list of lists of values with Type of field
91
92 **See Also** a sample TUI Script of :ref:`tui_create_field` operation.