plotting custom contours

4 views
Skip to first unread message

matei

unread,
Dec 10, 2009, 10:45:27 AM12/10/09
to amrita-ebook
Related to my previous post, any ideas about the easiest way to
superimpose custom contours, generated as a series of (x,y)
coordinates in other parts of the program, onto the same computational
domain.

First, can I store these values in an array, or create a list, that I
can call later using the plot line command, say? Do I have to invoke
something like Python or Perl to manipulate the lists, or can I do it
directly in amrita?

Another option would be to use gnuplot, say to handle the contour
drawing, and then combine the ps output of GNUPLOT with the ps output
of the amr_sol plot command?

thanks,
matei

James Quirk

unread,
Dec 10, 2009, 12:18:55 PM12/10/09
to matei, amrita-ebook
Matei,

On Thu, 10 Dec 2009, matei wrote:

> Related to my previous post, any ideas about the easiest way to
> superimpose custom contours, generated as a series of (x,y)
> coordinates in other parts of the program, onto the same computational
> domain.
>
> First, can I store these values in an array, or create a list, that I
> can call later using the plot line command, say? Do I have to invoke
> something like Python or Perl to manipulate the lists, or can I do it
> directly in amrita?
You could use something along the lines of:

fold::amrita { generate points
printfile points
set pi #= 4*atan(1)
set r = 10
do t=0,2*$pi,2*$pi/100
set x #= 2*$r*(cos($t)-1/2*cos(2*$t))
set y #= 2*$r*(sin($t)-1/2*sin(2*$t))
fold::print {
fold> file .= points
$x,$y
}
end do
}

postscript on
plotfile ps/tmp.ps
autoscale on -40,-40,60,60

set plot = move
fold::file points -> list
foreach point @list
$plot $point
set plot = draw
end foreach


James
>
> Another option would be to use gnuplot, say to handle the contour
> drawing, and then combine the ps output of GNUPLOT with the ps output
> of the amr_sol plot command?
>
> thanks,
> matei
>
> --
>
> You received this message because you are subscribed to the Google Groups "amrita-ebook" group.
> To post to this group, send email to amrita...@googlegroups.com.
> To unsubscribe from this group, send email to amrita-ebook...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/amrita-ebook?hl=en.
>
>
Reply all
Reply to author
Forward
0 new messages