Skip to content
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

Add vm2 #728

Merged
merged 20 commits into from
Dec 1, 2021
Merged

Add vm2 #728

merged 20 commits into from
Dec 1, 2021

Conversation

RomanIlchenko1308
Copy link
Contributor

This PR adds VM2.

Copy link
Contributor Author

@RomanIlchenko1308 RomanIlchenko1308 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial implementation of changes suggested in code review.

@akaszynski
Copy link
Collaborator

akaszynski commented Nov 25, 2021

Looks like we're getting an error when evaluating:

a = mapdl.post_processing.plot_nodal_eqv_stress()
~/ansys/source/pymapdl-reader/ansys/mapdl/reader/mesh.py in _surf(self)
     65         """External surface"""
     66         if self._surf_cache is None:
---> 67             self._surf_cache = self._grid.extract_surface()
     68         return self._surf_cache
     69 

~/ansys/source/pymapdl/ansys/mapdl/core/mesh_grpc.py in _grid(self)
    462         if self._grid_cache is None:
    463             self._update_cache()
--> 464             self._grid_cache = self._parse_vtk(force_linear=True)
    465         return self._grid_cache
    466 

~/ansys/source/pymapdl-reader/ansys/mapdl/reader/mesh.py in _parse_vtk(self, allowable_types, force_linear, null_unallowed, fix_midside, additional_checking)
    158 
    159         # Store original ANSYS element and node information
--> 160         grid.point_data['ansys_node_num'] = nnum
    161         grid.cell_data['ansys_elem_num'] = self.enum
    162         grid.cell_data['ansys_real_constant'] = self.elem_real_constant

~/.local/lib/python3.8/site-packages/pyvista/core/datasetattributes.py in __setitem__(self, key, value)
    216 
    217         has_arr = key in self
--> 218         self.set_array(value, name=key)
    219 
    220         # do not make array active if it already exists.  This covers

~/.local/lib/python3.8/site-packages/pyvista/core/datasetattributes.py in set_array(self, data, name, deep_copy)
    595 
    596         """
--> 597         vtk_arr = self._prepare_array(data, name, deep_copy)
    598         self.VTKObject.AddArray(vtk_arr)
    599         self.VTKObject.Modified()

~/.local/lib/python3.8/site-packages/pyvista/core/datasetattributes.py in _prepare_array(self, data, name, deep_copy)
    749             data = tmparray
    750         if data.shape[0] != array_len:
--> 751             raise ValueError(f'data length of ({data.shape[0]}) != required length ({array_len})')
    752 
    753         if data.dtype == np.bool_:

ValueError: data length of (10) != required length (17)

@akaszynski
Copy link
Collaborator

We're now tracking this in #736

Copy link
Collaborator

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggestions. Most notable is using get_value instead of get.

Additionally, use nplot or kplot to visualize the engineering problem from MAPDL whenever possible.

@akaszynski akaszynski self-requested a review December 1, 2021 03:09
@akaszynski akaszynski marked this pull request as ready for review December 1, 2021 03:09
Copy link
Collaborator

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made several changes to clean up the style a bit. Note how I added a sphinx cross reference to the function:

:py:meth:`Mapdl.get_value <ansys.mapdl.core.Mapdl.get_value>`.

See:
https://stackoverflow.com/questions/22700606/how-would-i-cross-reference-a-function-generated-by-autodoc-in-sphinx

You may want to also consider building the documentation locally. I think pycharm does a good job rendering the example rst, but there are some idiosyncrasies to our doc build that may not be rendered in sphinx.

Final suggestion:
Would it be possible to work out the hand-calculations for this? I'm fine with not having them, but if you've already worked out the hand calculations, you can just include it in the analytical section at the beginning of the example.

@RomanIlchenko1308 RomanIlchenko1308 merged commit b7297f8 into main Dec 1, 2021
@RomanIlchenko1308 RomanIlchenko1308 deleted the doc/vm2 branch December 1, 2021 17:14
@akaszynski akaszynski mentioned this pull request Dec 1, 2021
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants