-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example/example re assembling fields #1726
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1726 +/- ##
==========================================
- Coverage 86.93% 86.65% -0.29%
==========================================
Files 83 83
Lines 9937 9937
==========================================
- Hits 8639 8611 -28
- Misses 1298 1326 +28 |
@luisaFelixSalles Thanks for the example. I think it would be good to have a follow-up on this one to explain users how to create their own matrix fields "by hand". Dpf Matrix Fields are created "by column" and not "by row", and we are not documenting it anywhere. This also affects the way the generalized_dot_product operator is working. @PProfizi This caused a bug in the past, so I think it is something we would like to properly document. In addition, it works differently in numpy, so it is not very straigthforward to use without an example |
@luisaFelixSalles I think this remark could go both in a specific tutorial on Field creation, and in the User Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice example, just a few things to change
import ansys.dpf.core.operators.math as maths | ||
|
||
############################################################################### | ||
# Open an example and print the ``Model`` object. Here a result file from a crankshaft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Open an example and print the ``Model`` object. Here a result file from a crankshaft | |
# Load an example and print the ``Model`` object. Here a result file from a crankshaft |
# | ||
my_model = dpf.Model(examples.find_complex_rst()) | ||
my_mesh = my_model.metadata.meshed_region | ||
# print(my_model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comment the print?
# There are different methods to re-assemble the components | ||
|
||
# 1) With the class :class:'assemble_scalars_to_matrices_fc <ansys.dpf.core.operators.utility.assemble_scalars_to_matrices_fc.assemble_scalars_to_matrices_fc>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there is only one
Co-authored-by: Paul Profizi <100710998+PProfizi@users.noreply.github.com>
Co-authored-by: Paul Profizi <100710998+PProfizi@users.noreply.github.com>
Co-authored-by: Paul Profizi <100710998+PProfizi@users.noreply.github.com>
This new example shows how to do some matrix operations, including basic mathematical operation (power, add and multiply by
a constant, add field containers and invert ) and separating and assembling fields and fields containers