Hi Michael

Here we go!

my .pro file is attached!

In order to use them in my python based scripting
I also had to convert them  to matrixmarket format
for which I used
the attached script

My pet peeve with getdp is that i only does simple linear
tetrehedral elements in 3D in contract to gmsh that goes up to fourth order!

regards

Moritz




On Thu, Jan 12, 2012 at 1:11 PM,  <[email protected]> wrote:
> Dear Moritz,
>
> I'm glad that you managed to extract the matrices.
> Unfortunately I failed :-(
> Therefore it would be great, if you could send me
> an example of how to do it (if it's not confidential).
>
> By the way, what version of GetDP and what operating
> system are you using? I've tried it with GetDP 2.1.0
> on Windows.
>
> Kind regards and many thanks in advance!
> Michael
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of moritz braun
> Sent: Thursday, January 12, 2012 10:29 AM
> To: [email protected]
> Subject: [Gmsh] How to only print lower triangle of symmetric matrix with 
> print[A] in getdp
>
> Hi All
> Hi Ruth
>
> I have managed to extract the two  matrices
> of my generalized eigenvalue problem  as matlab scripts
> However it spits out the whole matrix .i.e both upper and lower
> triangel. which makes
> conversion into matrixmarket tedious.
> Is there a way to change the print format?
>
> regards
>
> Moritz
>
> --
> Prof M Braun         Tel.:27-12-4298006/8027
> Physics Department  Fax.: 27-12-4293643
> University of South Africa (UNISA)
> [email protected]
> P.O. Box 392
> 0003
> UNISA
>  South Africa
>
> _______________________________________________
> gmsh mailing list
> [email protected]
> http://www.geuz.org/mailman/listinfo/gmsh



-- 
Prof M Braun         Tel.:27-12-4298006/8027
Physics Department  Fax.: 27-12-4293643
University of South Africa (UNISA)
[email protected]
P.O. Box 392
0003
UNISA
 South Africa

Attachment: harm_osc_eigen.pro
Description: Binary data

# conversion script from matlab output of getdp to matrixmarket
from numpy import *
from StringIO import StringIO
import sys
mname=sys.argv[1]
mfile=open(mname,"r")
rl=mfile.readlines()
l1=rl[0]
l2=rl[1]
size= eval((l1.split("="))[1].split()[0])
lines=rl[5:-3]
S="".join(lines)
f=StringIO(S)
M=loadtxt(f)
Mlower=[ [int(i),int(j),aij] for i,j,aij in M  if i >= j]
nz=len(Mlower)
print "%%MatrixMarket matrix coordinate real symmetric"
print "#file created by python conversion script matmtomtx.py from matlab matrix"
print size,size,nz
for i,j,aij in Mlower:
    print int(i),int(j),aij

_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to