mesh.Mesh.replicate_multi#

Mesh.replicate_multi(n=(2, 2, 2), dir=(0, 1, 2), step=(1.0, 1.0, 1.0))#

Repeatedly replicate a Mesh in different directions

This method applies replicate() multiple times in sequence. Each replication uses the corresponding values from the parameter lists.

Parameters#

n: tuple of int

Number of copies to create in the subsequent replications.

dir: tuple of int (0,1,2) or tuple of float array_like (3,)

Subsequent translation vectors. See replicate().

step: tuple of floats

The step for the subsequent replications.

Returns#

Mesh

A Mesh with the concatenation of prod(n) copies of the original, translated as specified by the dir and step parameters. The first of the copies is equal to the original.

Note#

If the parameter lists n, dir, step have different lengths, the operation is executed only for the shortest of the three.

Important

Use replicate_multi() when multiple replications operations are needed. This is more efficient as this avoids multiple fuse operations.

See Also#

replicate(): replicate in a single direction

Examples#

>>> M = Mesh(eltype='line2')
>>> print(M)
Mesh: n_nodes: 2, n_elems: 1, plexitude: 2, level: 1, eltype: line2
  BBox: [0. 0. 0.], [1. 0. 0.]
  Size: [1. 0. 0.]
  Length: 1.0
>>> M1 = M.replicate_multi((2,2), dir=(0,1), step=(1.0,1.0))
>>> print(M1.report(full=True))
Mesh: n_nodes: 6, n_elems: 4, plexitude: 2, level: 1, eltype: line2
  BBox: [0. 0. 0.], [2. 1. 0.]
  Size: [2. 1. 0.]
  Length: 4.0
  Coords: [[0. 0. 0.]
           [1. 0. 0.]
           [2. 0. 0.]
           [0. 1. 0.]
           [1. 1. 0.]
           [2. 1. 0.]]
  Elems: [[0 1]
          [1 2]
          [3 4]
          [4 5]]