← Back to team overview

dolfin team mailing list archive

Re: Viper plot

 

On Fri, Jun 19, 2009 at 3:28 PM, Johan Hake<hake@xxxxxxxxx> wrote:
> On Friday 19 June 2009 10:19:52 Ola Skavhaug wrote:
>> On Fri, Jun 19, 2009 at 10:03 AM, Garth N. Wells<gnw20@xxxxxxxxx> wrote:
>> > Ola Skavhaug wrote:
>> >> On Fri, Jun 19, 2009 at 9:43 AM, Garth N. Wells<gnw20@xxxxxxxxx> wrote:
>> >>> Ola Skavhaug wrote:
>> >>>> On Thu, Jun 18, 2009 at 5:01 PM, Garth N. Wells<gnw20@xxxxxxxxx> wrote:
>> >>>>> Ola Skavhaug wrote:
>> >>>>>> On Thu, Jun 18, 2009 at 4:50 PM, Garth N. Wells<gnw20@xxxxxxxxx>
>> >>>>>>
>> >>>>>> wrote:
>> >>>>>>> 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?
>> >>>>>>
>> >>>>>> Not really; will dig into this tomorrow. Do you have a reproducable
>> >>>>>> example?
>> >>>>>
>> >>>>> The Poisson demo.
>> >>>>>
>> >>>>> Garth
>> >>>>
>> >>>> Is this still an issue? I have no problems when plotting from c++ with
>> >>>> the newest Viper.
>> >>>
>> >>> 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.
>> >
>> > That's why I say 'just-in-time compilation' so it would be done on
>> > demand.
>> >
>> > Garth
>>
>> 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?
>
> 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.

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

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

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

> Johan
>
>> Ola
>>
>> >> Ola
>> >>
>> >>>> Ola
>> >>>>
>> >>>>>>> Garth
>> >>>>>>> _______________________________________________
>> >>>>>>> DOLFIN-dev mailing list
>> >>>>>>> DOLFIN-dev@xxxxxxxxxx
>> >>>>>>> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
>
>



-- 
Ola Skavhaug


Follow ups

References