LightForm-group / UoM-CSF-matflow

Matflow configuration files and task schemas for running on the University of Manchester's CSF
MIT License
8 stars 0 forks source link

Add option to visualise IPF colour in .VTK output files #16

Open Gbowker opened 3 years ago

Gbowker commented 3 years ago

Option to include IPF colour in .vtk output exists in the damask python library. This should be implemented as an option in matflow via the 'visualise' output_map_option within the simulate_volume_element_loading task.

Inputs

Output task_#_simulate_volume_element_loading/(element##)/viz/geom_load_inc###.vtr

Implementation

@aplowman previously tried:

output_map_options:
  operations:        
    - name: add_IPF_color               
      args: {'q': 'O', 'l': [0, 0, 1]}

...since the add_IPF_color method in the currently-installed version of DAMASK looks like:

    def add_IPF_color(self,q,l):
        """
        Add RGB color tuple of inverse pole figure (IPF) color.
        Parameters
        ----------
        q : str
            Label of the dataset containing the crystallographic orientation as quaternions.
        l : numpy.array of shape (3)
            Lab frame direction for inverse pole figure.
        """
        self._add_generic_pointwise(self._add_IPF_color,{'q':q},{'l':l})

However, this didn't work (Error during calculation: module 'numpy' has no attribute 'gcd'. from DAMASK).This could be MatFlow or DAMASK. "Since we will be moving to a more recent version of DAMASK soon, I think it makes sense to wait, and check it works once we are on the new version!" - Adam