Subject: [Viper-dev] Viper plot

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 18 Jun 2009 15:50:50 +0100

When plotting a function from a C++ program using plot(u), I only get a 
plot of the mesh. When plotting from Python, I get the contour plot as 
expected. Any ideas what's up?

Garth

---

From: Ola Skavhaug <[email-masked]>
Date: Thu, 18 Jun 2009 16:52:28 +0200

> expected. Any ideas what's up?

Not really; will dig into this tomorrow. Do you have a reproducable example?

>
> Garth
> _______________________________________________
> DOLFIN-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>

-- 
Ola Skavhaug

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 18 Jun 2009 16:01:26 +0100

> Not really; will dig into this tomorrow. Do you have a reproducable example?

The Poisson demo.

Garth

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 19 Jun 2009 09:41:34 +0200

>> Not really; will dig into this tomorrow. Do you have a reproducable

Is this still an issue? I have no problems when plotting from c++ with
the newest Viper.

Ola

-- 
Ola Skavhaug

---

From: "Garth N. Wells" <[email-masked]>
Date: Fri, 19 Jun 2009 08:43:30 +0100

> Is this still an issue? I have no problems when plotting from c++ with

No. I fixed it last night. I think it was a problem with templated 
functions in File.cpp.

I would be nice if SWIG could do just-in-time compilation to deal with 
for templates :).

Garth

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 19 Jun 2009 10:02:28 +0200

On Fri, Jun 19, 2009 at 9:43 AM, Garth N. Wells<[email-masked]> wrote:
> No. I fixed it last night. I think it was a problem with templated functions
> in File.cpp.
>
> I would be nice if SWIG could do just-in-time compilation to deal with for
> templates :).
>
> Garth

Sure. The big problem is that there are almost no limit to how many
templates that _might_ be instantianted by SWIG.
Hence the %template directive.

Ola

-- 
Ola Skavhaug

---

From: "Garth N. Wells" <[email-masked]>
Date: Fri, 19 Jun 2009 09:03:41 +0100

> Hence the %template directive.

That's why I say 'just-in-time compilation' so it would be done on demand.

Garth

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 19 Jun 2009 10:19:52 +0200

On Fri, Jun 19, 2009 at 10:03 AM, Garth N. Wells<[email-masked]> wrote:
>>> functions
>>> for

Aha, I see. Perhaps there is a clever way of using Instant for this?
We would still need to declare the templated types, but then Instant
could generate the correct instances on demand. What do you think,
Kent?

Ola

-- 
Ola Skavhaug

---

From: Johan Hake <[email-masked]>
Date: Fri, 19 Jun 2009 15:28:54 +0200

On Friday 19 June 2009 10:19:52 Ola Skavhaug wrote:
> >>>>>> On Thu, Jun 18, 2009 at 4:50 PM, Garth N. Wells<[email-masked]>
> >>>>>>
> >>>>>> wrote:

I say urk...

This will create one extension module for each instantiated template and I do 
not know if the new instantiated types can be recognized by the original swig 
interface, ie, the main PyDOLFIN interface.

If it ever is possible I think this has to be implemented in swig by someone 
who knows the runtime type recognitions nativley. 

Johan

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 19 Jun 2009 15:39:20 +0200

> interface, ie, the main PyDOLFIN interface.

No problem; templates are fully defined in the headers, so the
run-time issue should be trivial.

> who knows the runtime type recognitions nativley.

Just apply the ordinary typemaps, import dolffin.i and you should be good.

-- 
Ola Skavhaug

---

From: "Garth N. Wells" <[email-masked]>
Date: Sat, 20 Jun 2009 22:08:42 +0100

> Just apply the ordinary typemaps, import dolffin.i and you should be good.

So would this be feasible? I wouldn't advocate it just yet for DOLFIN, 
but it would be a really neat way to get around the awkwardness of 
combing C++ with templates and scripting languages.

Garth