User Tools

Site Tools


code_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
code_examples [2016/12/23 18:27]
daniel [N-Body]
code_examples [2016/12/25 12:45] (current)
daniel [N-Body]
Line 388: Line 388:
 Then we continue with the annotation of the individual functions that form the body of the ''​for-loop''​ of the ''​main()''​ function. Then we continue with the annotation of the individual functions that form the body of the ''​for-loop''​ of the ''​main()''​ function.
  
-First the ''​velocities()''​ function takes the array ''​pos''​ as input, make a certain operation with each individual element of the and stores the result in the same position of the output array ''​frc''​. ​ This execution pattern can be annotated with the ''​map''​ directive with the operation for each element defined as ''​CALCFORCE''​.+First the ''​bodyForce()''​ function takes the array ''​pos''​ as input, make a certain operation with each individual element of the and stores the result in the same position of the output array ''​frc''​. ​ This execution pattern can be annotated with the ''​map''​ directive with the operation for each element defined as ''​CALCFORCE''​.
  
 The ''​CALCFORCE''​ operator receives the whole array ''​pos''​ as input and has ''​frc[i]''​ as output, internally it uses the whole array ''​pos'',​ even if this is the same element for all the executions of ''​CALCFORCE''​ it should be annotated as it is used by ADDFORCE. The ''​CALCFORCE''​ operator receives the whole array ''​pos''​ as input and has ''​frc[i]''​ as output, internally it uses the whole array ''​pos'',​ even if this is the same element for all the executions of ''​CALCFORCE''​ it should be annotated as it is used by ADDFORCE.
code_examples.txt ยท Last modified: 2016/12/25 12:45 by daniel