@@ -29,20 +29,22 @@ Basic maths
2929.. |norm | replace :: :class: `norm<ansys.dpf.core.operators.math.norm.norm> `
3030.. |norm_fc | replace :: :class: `norm_fc<ansys.dpf.core.operators.math.norm_fc.norm_fc> `
3131
32- This tutorial demonstrate how to do some basic mathematical operations with PyDPF-Core.
32+ This tutorial demonstrates how to do some basic mathematical operations with PyDPF-Core.
3333
34- We use |Field | and |FieldsContainer | created from scratch to facilitate the understanding on how the mathematical operators works.
35- For more information on creating a field from scratch check :ref: `ref_tutorials_data_structures `.
34+ Here, we use |Fields | and |FieldsContainers | created from scratch to facilitate the understanding on how the
35+ mathematical operators works.
36+ For more information on creating a |Field | from scratch check :ref: `ref_tutorials_data_structures `.
3637
3738Define the |Field | and |FieldsContainer |
3839----------------------------------------
3940
40- Define the |Fields | and |FieldsContainers | by choosing the number of entities, defining their ids, location and adding data.
41+ Define the |Fields | and |FieldsContainers | by choosing the number of entities, defining their ids,
42+ defining their location and adding data.
4143
42- If not specified the location is nodal by default.
44+ If not specified the location is `` nodal `` by default.
4345
4446We need to provide information about the scoping. DPF needs to know the IDs of the data we provide,
45- so that it can apply an operator on the correspondent entities. For more detailed explanation see `Scoping handling `_
47+ so that it can apply an operator on the corresponding entities. For more detailed explanation see `Scoping handling `_
4648
4749.. code-block :: python
4850
@@ -108,7 +110,7 @@ so that it can apply an operator on the correspondent entities. For more detaile
108110 fc1 = dpf.fields_container_factory.over_time_freq_fields_container(fields = [field1, field2])
109111 fc2 = dpf.fields_container_factory.over_time_freq_fields_container(fields = [field3, field4])
110112
111- # Check the Fields and FieldsContainer
113+ # Check the Fields and FieldsContainers
112114 print (" Field 1" ," \n " , field1 , " \n " )
113115 print (" Field 2" ," \n " , field2 , " \n " )
114116 print (" Field 3" ," \n " , field3 , " \n " )
@@ -139,7 +141,7 @@ so that it can apply an operator on the correspondent entities. For more detaile
139141 print("FieldsContainer1", "\n ",fc1 , "\n ")
140142 print("FieldsContainer2", "\n ",fc2 , "\n ")
141143
142- To make the mathematics operations, instantiate the operator and use ``eval() `` to compute and retrieve the result
144+ To make the mathematics operations, instantiate the operators and use ``eval() `` to compute and retrieve the results.
143145
144146Addition and Subtraction
145147------------------------
@@ -157,7 +159,7 @@ b) |accumulate| and |accumulate_fc| operators for the total sum of each componen
157159a) |add | and |add_fc | operators
158160~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159161
160- - |add |: Sum between the data vectors for the correspondent entity id
162+ - |add |: Sum between the data vectors for the corresponding entity id.
161163
162164.. code-block :: python
163165
@@ -176,7 +178,7 @@ a) |add| and |add_fc| operators
176178 add_field = maths.add(fieldA=field1, fieldB=field2).eval()
177179 print("Addition Fields",add_field , "\n ")
178180
179- - |add_fc |: Selects all fields with the same label space in the input |FieldsContainers | and add those together
181+ - |add_fc |: Selects all fields with the same label space in the input |FieldsContainers | and add those together.
180182
181183.. code-block :: python
182184
@@ -211,9 +213,9 @@ b) |accumulate| and |accumulate_fc| operators
211213- |accumulate | : Sums all the elementary data of a field to produce one elementary data for each vector component.
212214 You can give a scale ("ponderation") argument.
213215
214- Mind the |Fields | dimension: Our |Fields | represent 3D vectors so one elementary data is a 3D vector.
215- The optional "ponderation" field is a field which attributes one value to multiply each data component per entity,
216- so we need to change its dimensionality (1D).
216+ Mind the |Fields | dimension: Our |Fields | represents 3D vectors, so one elementary data is a 3D vector.
217+ The optional "ponderation" | Field | is a | Field | that attributes the values to be multiplied by each data
218+ component of the entities. Thus, we need to change its dimensionality (1D).
217219
218220.. code-block :: python
219221
@@ -309,7 +311,7 @@ Subtraction
309311
310312Here we use:
311313
312- a) |minus | operator to compute the difference between the data vectors for the correspondent entity id of |Fields |
314+ a) |minus | operator to compute the difference between the data vectors of the corresponding entities of |Fields |;
313315b) |minus_fc | operator that selects all fields with the same label space in the input |FieldsContainers |
314316 and compute their difference.
315317
@@ -370,7 +372,7 @@ This section shows how the basic product and division operators works.
370372Component-wise division
371373^^^^^^^^^^^^^^^^^^^^^^^
372374
373- These operators computes the component-wise division between two |Fields | (with the |component_wise_divide | operator)
375+ These operators compute the component-wise division between two |Fields | (with the |component_wise_divide | operator)
374376or between two |FieldsContainers|(with the |component_wise_divide_fc | operator) with same dimensionality.
375377
376378.. code-block :: python
@@ -420,7 +422,7 @@ or between two |FieldsContainers|(with the |component_wise_divide_fc| operator)
420422Cross product
421423^^^^^^^^^^^^^
422424
423- These operators computes the cross product between two vector |Fields | (with the |cross_product | operator)
425+ These operators compute the cross product between two vector |Fields | (with the |cross_product | operator)
424426or between two |FieldsContainers|(with the |cross_product_fc | operator and with |Fields | with same label space).
425427The |Fields | can have the same location or Elemental Nodal and Nodal locations.
426428
@@ -470,7 +472,7 @@ The |Fields| can have the same location or Elemental Nodal and Nodal locations.
470472Dot product
471473^^^^^^^^^^^
472474
473- These operators computes a general notion of inner product between between two vector |Fields |
475+ These operators compute a general notion of inner product between between two vector |Fields |
474476(with the |generalized_inner_product | operator) or between two |FieldsContainers |
475477(with the |generalized_inner_product_fc | operator and with |Fields | with same label space).
476478The |Fields | may have different dimensionality.
@@ -522,7 +524,7 @@ Overall dot
522524^^^^^^^^^^^
523525
524526The |overall_dot | operator computes a dot product between the entities of same ID of two |Fields | and then adds
525- all the entities data to return a scalar
527+ all the entities data to return a scalar.
526528
527529.. code-block :: python
528530
@@ -571,7 +573,7 @@ This section shows how the basic power operators works.
571573Squared
572574^^^^^^^
573575
574- These operators computes the element-wise data squared of a |Field | (with the |sqr | operator) and of |Fields | from a
576+ These operators compute the element-wise data to the power of two of a |Field | (with the |sqr | operator) and of |Fields | from a
575577|FieldsContainer | (with the |sqr_fc | operator).
576578
577579.. code-block :: python
@@ -620,8 +622,8 @@ These operators computes the element-wise data squared of a |Field| (with the |s
620622Power
621623^^^^^
622624
623- These operators computes the element-wise data power a factor of a |Field | (with the |pow | operator) and of | Fields | from a
624- |FieldsContainer | (with the |pow_fc | operator).
625+ These operators compute the element-wise data to the power of a given factor of a |Field | (with the |pow | operator)
626+ and of | Fields | from a |FieldsContainer | (with the |pow_fc | operator).
625627
626628.. code-block :: python
627629
@@ -672,7 +674,7 @@ These operators computes the element-wise data power a factor of a |Field| (with
672674Norm
673675----
674676
675- These operators computes the element-wise Lp norm (Default Lp=L2 ) of a |Field | elementary data (with the |norm |
677+ These operators compute the element-wise Lp norm (Default Lp=L2 ) of a |Field | elementary data (with the |norm |
676678operator) and of |Fields | elementary data from a |FieldsContainer | (with the |norm_fc | operator).
677679
678680.. code-block :: python
@@ -722,9 +724,8 @@ operator) and of |Fields| elementary data from a |FieldsContainer| (with the |no
722724Scoping handling
723725----------------
724726
725- DPF needs to know the IDs of the data on the fields, so that it can apply an operator on on the correspondent entities.
726-
727- By providing these integers we only select the data with an ID in common.
727+ DPF needs to know the IDs of the data on the fields. By providing these integers we only select
728+ the data with an ID in common when using an operator
728729
729730Here we will use two different fields to understand this functioning:
730731
@@ -769,7 +770,7 @@ Here we will use two different fields to understand this functioning:
769770 print(field6.data,"\n ")
770771
771772
772- Here the only entities with matching ids the third one of the first field, and the first one of the
773+ Here the only entities with matching ids are the third one of the first field, and the first one of the
773774second field. Other entities elementary data is not taken into account when using an operator that needs two operands.
774775
775776For example the |add | operator:
0 commit comments