taskpyFormex - Tasks: task #12341, Reassigned to another tracker...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #12341: Reassigned to another tracker [was: encode, decode: in arraytools?]

Submitter:  gianluca de santis <gianlucadesi>
Submitted:  Mon 10 Dec 2012 03:27:22 PM UTC
   
 
Should Start On:  Mon 10 Dec 2012 12:00:00 AM UTC Should be Finished on:  Mon 10 Dec 2012 12:00:00 AM UTC
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  bverheg Percent Complete:  0%
Open/Closed:  Closed Effort:  0.00

Mon 10 Dec 2012 04:15:03 PM UTC, comment #1: 

THIS ITEM WAS REASSIGNED TO SR #108202


Please, do not post any new comments to this item.

Benedict Verhegghe <bverheg>
Group administrator
Mon 10 Dec 2012 03:27:22 PM UTC, original submission:  

THIS ITEM WAS REASSIGNED TO SR #108202
Should encode/decode be re-introduced in pyFormex? Maybe in arraytools.py?
Or are there some other functions which may reproduce the same array functionality of decode/encode (not necessarily on a connectivity table)?

I would suggest to re-introduce encode (and enmagic2), decode (and demagic2) and move them to arraytools. 

The example below shows something that can be done with encode: in a mesh with repeated elements, find the elements that are repeated N times. NB: to be able to run it, you need to uncomment the encode function in connectivity.py lines 1052-1123.


#build basic blocks
from elements import Hex8
h0=Mesh(Hex8).toFormex()
#change order of nodes to make it more difficult to find multiple rows
h1=Formex([h0.points()[[1, 5, 6, 2, 0, 4, 7, 3]]], eltype='hex8')
draw(h0)
drawNumbers(h0.coords)
draw(h1.translate([2., 2., 2]), color='red')
drawNumbers(h1.translate([2., 2., 2]).coords, color='red')

clear()
H4=h0.replic(4, 1, 0).replic(4, 1, 1).replic(4, 1, 2).toMesh()
H3=h1.replic(3, 1, 0).replic(3, 1, 1).replic(3, 1, 2).toMesh()
H2=h0.replic(2, 1, 0).replic(2, 1, 1).replic(2, 1, 2).toMesh()
H1=h1.replic(1, 1, 0).replic(1, 1, 1).replic(1, 1, 2).toMesh()

H=Mesh.concatenate([H1, H2, H3, H4]).compact().renumber().setProp(0)
smooth()
draw(H, mode='wireframe')
perspective(False)
#find elems which are repeated N times
N=3
cod, mag=encode(H.elems,permutations=True, return_magic=True)
mult, uniq = multiplicity(cod)
order = uniqueOrdered(cod, return_index=False, return_inverse=True)
orderedmult = mult[order[1]]
draw(H.select(orderedmult==N), mode='smoothwire', color='red')
lights(True)

exit()

gianluca de santis <gianlucadesi>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gianlucadesi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-12-10 bverheg Reassign ItempyFormex, task #12341 pyFormex, sr #108202

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code