-
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
Example/example re assembling fields #1726
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1726 +/- ##
=======================================
Coverage 88.10% 88.10%
=======================================
Files 83 83
Lines 9951 9951
=======================================
Hits 8767 8767
Misses 1184 1184 |
@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 <[email protected]>
Co-authored-by: Paul Profizi <[email protected]>
Co-authored-by: Paul Profizi <[email protected]>
f276ba3
to
354b8ca
Compare
95f9404
to
354b8ca
Compare
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