Skip to content

Conversation

@Gbowker
Copy link
Collaborator

@Gbowker Gbowker commented Jan 22, 2026

Laguerre tesselations include the extra parameter weights which allows the grains of the tesselation to be elongated in one of the primary directions:

eg. [2, 1, 1] generates grains in a voronoi tesselation but with greater length in the x direction than the y and z directions.

This should be quite an easy addition to matflow - it's the same task as from_voronoi except with an extra parameter 'weights'.

See commits:

  • Added script which does same as gen_VE_from_voronoi but uses damask laguerre function instead
  • Added this task to task_schemas.yaml
  • Added weights parameter to 'template_components/parameters'

However I've tested this with a basic workflow and it doesnt yet work:
TEST_laguerre.yaml:

tasks:
  - schema: generate_volume_element_from_laguerre
    inputs:
      homog_label: SX
      VE_grid_size: [32, 32, 32]
      scale_morphology: [1, 1, 1] # scales gridsize
      weights: [5, 1, 1] # scales grains
      microstructure_seeds::from_random:
        box_size: [1, 1, 1]
        num_seeds: 2000
        random_seed: 1
        phase_label: Al

  - schema: visualise_VE_VTK

@aplowman @gcapes or @dkfellows
Can you try and test this?
My build details:

matflow                 0.3.0a224
hpcflow                 0.2.0a299
damask                  3.0.2
damask-parse            0.5.1

For creating VEs with weighted dimensions.
Another option for creating VEs.
@Gbowker Gbowker requested a review from a team as a code owner January 22, 2026 17:07
@Gbowker Gbowker requested a review from aplowman January 22, 2026 17:09
@Gbowker Gbowker self-assigned this Jan 22, 2026
@Gbowker Gbowker requested a review from dkfellows January 22, 2026 17:09
@Gbowker
Copy link
Collaborator Author

Gbowker commented Jan 23, 2026

When I test this on the build described I get the following error in workflow_dir/artifacts/submissions/0/js_std/0/js_0.sh_<job_number>.out

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/mnt/iusers01/jf01/y15576gb/.conda/envs/python3.11-env/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/mnt/iusers01/jf01/y15576gb/.conda/envs/python3.11-env/lib/python3.11/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
           ^^^^^^^^^^^^^^^^
  File "/mnt/iusers01/jf01/y15576gb/.matflow/rot_loads-env/lib/python3.11/site-packages/damask/_geomgrid.py", line 543, in _find_closest_seed
    return np.argmin(np.sum((np.broadcast_to(point,(len(seeds),3))-seeds)**2,axis=1) - weights)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
ValueError: operands could not be broadcast together with shapes (54000,) (81,) 
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/net/scratch/y15576gb/matflow-demos/TEST_laguerre_2026-01-22_164859/artifacts/submissions/0/scripts/generate_volume_element_from_laguerre_act_0.py", line 168, in <module>
    outputs = generate_volume_element_laguerre(**func_kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/net/scratch/y15576gb/matflow-demos/TEST_laguerre_2026-01-22_164859/artifacts/submissions/0/scripts/generate_volume_element_from_laguerre_act_0.py", line 50, in generate_volume_element_laguerre
    grid_obj = grid_cls.from_Laguerre_tessellation(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/iusers01/jf01/y15576gb/.matflow/rot_loads-env/lib/python3.11/site-packages/damask/_geomgrid.py", line 595, in from_Laguerre_tessellation
    material_ = np.array(result.get()).reshape(cells)
                         ^^^^^^^^^^^^
  File "/mnt/iusers01/jf01/y15576gb/.conda/envs/python3.11-env/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
ValueError: operands could not be broadcast together with shapes (54000,) (81,) 

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