Discussion:
[Pyublas] Is it possible to make a noncollinear mesh with put_quadmesh of SiloFile(pyvisfile.silo._internal.DBFile)?
Daniele Rosa
2015-01-03 03:00:04 UTC
Permalink
Is it possible to make a noncollinear mesh with put_quadmesh of SiloFile(pyvisfile.silo._internal.DBFile)?

I don't get any error at creation:

osf = silo.SiloFile('quadmesh.silo',create=True,mode=silo.DB_CLOBBER,target=silo.DB_LOCAL,fileinfo='drosa: created for testing')
q = np.array([[0., 1., 3., 3.5],[0., 1., 2.5, 3.5],[0.7, 1.3, 2.3, 3.5]])
p = np.array([[0., 0., 0., 0.],[1.5, 1.5, 1.25, 1.5],[3., 2.75, 2.75, 3.]])
qoords = np.array([q, p])
osf.put_quadmesh('quadmeshNoncoll', qoords,coordtype=silo.DB_NONCOLLINEAR)

But when I open it in visit to visualize it I see axes with values of 10^249
quadmeshNoncoll_coord0
[0, 0] = {0, 1, 3, 3.5, 0, 1, 2.5, 3.5, 0.7, 1.3, 2.3, 3.5, 0, 0, 0, 0, 1.5, 1.5, 1.25, 1.5, 3, 2.75, 2.75, 3, 1.02765654334979e-321,
[2, 1] = 3.2114266979681e-322, 6.92674607129056e-310, 2.00500455784868e-314, 4.94065645841247e-324, 4.44659081257122e-323, 1.63730804513399e-306, 0,
[2, 8] = 3.16202013338398e-322, 4.0019317313141e-322, 6.92674607114436e-310, 2.00500455784868e-314, 4.94065645841247e-324, 1.58101006669199e-322,
[3, 2] = 2.57083620116598e-316, 2.57991831349409e-316, 2.57084410621631e-316, 2.53154019595835e-316, 0, 4.0019317313141e-322, 6.92674607114505e-310,
[3, 9] = 2.00500455784868e-314, 4.94065645841247e-324, 1.48219693752374e-322, 7.49090278881396e+247, 1.91452861422062e+214, 6.01737316420643e+175,
[4, 3] = 1.01435485991491e-314, 3.95252516672997e-322, 4.0019317313141e-322, 6.92674607130044e-310, 2.00500455784868e-314, 4.94065645841247e-324,
[4, 9] = 1.58101006669199e-322, 0, 4.94065645841247e-324, 9.88131291682493e-324, 0, 0, 4.79243676466009e-322, 6.92674607128888e-310,
[5, 5] = 2.00500455784868e-314, 4.94065645841247e-324, 2.76676761671098e-322, 2.57082908662068e-316, 2.57084015369114e-316, 9.88131291682493e-324, 0,
[6, 0] = 0, 0, 2.57084884924651e-316, 4.0019317313141e-322, 6.92674607128972e-310, 2.00500455784868e-314, 4.94065645841247e-324,
[6, 7] = 7.90505033345994e-323, 9.88131291682493e-324, 8.41887860513484e-321, 0, 0, 3.95252516672997e-322, 4.79243676466009e-322,
[7, 2] = 4.94065645841247e-324, 6.92675776054081e-310, 2.57836022807336e-316, 9.88131291682493e-324, 2.56060627552945e-316, 2.56060706603448e-316, 0,
[7, 9] = 6.92675776067045e-310, 6.92661866093233e-310, 0, 4.74303020007597e-322, 3.87841531985379e-321, 0, 0, 0, 0, 0, 0, 1.21574998896944e-152,
[8, 9] = 6.92675748273837e-310, 6.92675069608665e-310, 0, 0, 0, 0, 0, 0, -1.1622618895564e+30, 6.92675951614735e-310, 6.9267502877323e-310,
[9, 8] = 1.68584250192376e+116, 6.9267514609975e-310, 2.56830065627152e-316, 0, 0, 0, -2.44729696940123e+120, 6.92675070912682e-310,
[10, 4] = 6.92675069608665e-310, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.48293257296151e-270, 6.92675070912445e-310, 6.92675069608665e-310, 0, 0, 0, 0, 0, 0, 0}


Any suggestion?

Thank you
Best
Daniele
Andreas Kloeckner
2015-01-05 22:37:26 UTC
Permalink
Daniele,
Post by Daniele Rosa
Is it possible to make a noncollinear mesh with put_quadmesh of SiloFile(pyvisfile.silo._internal.DBFile)?
osf = silo.SiloFile('quadmesh.silo',create=True,mode=silo.DB_CLOBBER,target=silo.DB_LOCAL,fileinfo='drosa: created for testing')
q = np.array([[0., 1., 3., 3.5],[0., 1., 2.5, 3.5],[0.7, 1.3, 2.3, 3.5]])
p = np.array([[0., 0., 0., 0.],[1.5, 1.5, 1.25, 1.5],[3., 2.75, 2.75, 3.]])
qoords = np.array([q, p])
osf.put_quadmesh('quadmeshNoncoll', qoords,coordtype=silo.DB_NONCOLLINEAR)
But when I open it in visit to visualize it I see axes with values of 10^249
quadmeshNoncoll_coord0
[0, 0] = {0, 1, 3, 3.5, 0, 1, 2.5, 3.5, 0.7, 1.3, 2.3, 3.5, 0, 0, 0, 0, 1.5, 1.5, 1.25, 1.5, 3, 2.75, 2.75, 3, 1.02765654334979e-321,
[2, 1] = 3.2114266979681e-322, 6.92674607129056e-310, 2.00500455784868e-314, 4.94065645841247e-324, 4.44659081257122e-323, 1.63730804513399e-306, 0,
[2, 8] = 3.16202013338398e-322, 4.0019317313141e-322, 6.92674607114436e-310, 2.00500455784868e-314, 4.94065645841247e-324, 1.58101006669199e-322,
[3, 2] = 2.57083620116598e-316, 2.57991831349409e-316, 2.57084410621631e-316, 2.53154019595835e-316, 0, 4.0019317313141e-322, 6.92674607114505e-310,
[3, 9] = 2.00500455784868e-314, 4.94065645841247e-324, 1.48219693752374e-322, 7.49090278881396e+247, 1.91452861422062e+214, 6.01737316420643e+175,
[4, 3] = 1.01435485991491e-314, 3.95252516672997e-322, 4.0019317313141e-322, 6.92674607130044e-310, 2.00500455784868e-314, 4.94065645841247e-324,
[4, 9] = 1.58101006669199e-322, 0, 4.94065645841247e-324, 9.88131291682493e-324, 0, 0, 4.79243676466009e-322, 6.92674607128888e-310,
[5, 5] = 2.00500455784868e-314, 4.94065645841247e-324, 2.76676761671098e-322, 2.57082908662068e-316, 2.57084015369114e-316, 9.88131291682493e-324, 0,
[6, 0] = 0, 0, 2.57084884924651e-316, 4.0019317313141e-322, 6.92674607128972e-310, 2.00500455784868e-314, 4.94065645841247e-324,
[6, 7] = 7.90505033345994e-323, 9.88131291682493e-324, 8.41887860513484e-321, 0, 0, 3.95252516672997e-322, 4.79243676466009e-322,
[7, 2] = 4.94065645841247e-324, 6.92675776054081e-310, 2.57836022807336e-316, 9.88131291682493e-324, 2.56060627552945e-316, 2.56060706603448e-316, 0,
[7, 9] = 6.92675776067045e-310, 6.92661866093233e-310, 0, 4.74303020007597e-322, 3.87841531985379e-321, 0, 0, 0, 0, 0, 0, 1.21574998896944e-152,
[8, 9] = 6.92675748273837e-310, 6.92675069608665e-310, 0, 0, 0, 0, 0, 0, -1.1622618895564e+30, 6.92675951614735e-310, 6.9267502877323e-310,
[9, 8] = 1.68584250192376e+116, 6.9267514609975e-310, 2.56830065627152e-316, 0, 0, 0, -2.44729696940123e+120, 6.92675070912682e-310,
[10, 4] = 6.92675069608665e-310, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.48293257296151e-270, 6.92675070912445e-310, 6.92675069608665e-310, 0, 0, 0, 0, 0, 0, 0}
Any suggestion?
Right now, that's not possible. This line here is the offender:

https://github.com/inducer/pyvisfile/blob/3fa8cac160d6b9b0748f72de0a66a1dd733b622c/src/wrapper/wrap_silo.cpp#L1148

It assumes collinear coordinates. I'd love to have a patch if you were
to create one. Alternatively, the Vtk interface supports this:

https://github.com/inducer/pyvisfile/blob/3fa8cac160d6b9b0748f72de0a66a1dd733b622c/examples/vtk-structured-2d-curved.py

Andreas

Loading...