octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: problem with fem-fenics


From: Marco Vassallo
Subject: RE: problem with fem-fenics
Date: Mon, 22 Jul 2013 16:29:29 +0200

> Date: Sat, 20 Jul 2013 22:24:55 +0200
> Subject: Re: problem with fem-fenics
> From: address@hidden
> To: address@hidden
> CC: address@hidden
>
> On Fri, Jul 19, 2013 at 10:17 AM, Marco Vassallo
> <address@hidden> wrote:
> > Hi all,
> >
> > for the fem-fenics pkg, I have to solve some issues but I can't exactly
> > figure out how we can do it.
> >
> > The pkg is supposed to solve a Problem which is defined by the user.
> >
> > The user defines the problem in a file myproblem.ufl.
> >
> > Then our pkg should compile it: at the moment, I'm doing it with a script
> > file which
> > calls the compiler [1] :
> >
> > command = "ffc -l dolfin myproblem.ufl"
> > [output, text] = system (command);
> >
> > This script generates a .h file, myproblem.h, which contains the definition
> > of some classes
> > which I should use in my DLD function.
> >
> > Then, what I need is to include the header in a function, compile it with
> > mkoctfile and to execute it.
> >
> > A sketch of what I'm doing right now is available here [2], but I don't know
> > if it could work properly inside a pkg.
> >
> > [1]
> > https://sourceforge.net/p/octave/fem-fenics/ci/default/tree/inst/fem_ffc.m
> > [2]
> > https://sourceforge.net/p/octave/fem-fenics/ci/default/tree/example/fem_func_space.m
> >
>
> Hi Marco,
>
Hi JPi,

first of all thanks for your answer.

> Creating the CC function requires good text edition and parsing
> functions. I think you can do it with Octave but in the past I have
> opted for Python/Perl scripts to do this (preferring python since it
> is widespread on most platforms).
>
I don't know very well neither Python or Perl, and so I was wondering if
there is some technical reason for using them instead of Octave/C++
 or if it is just easier but one can definitely do the same things.
I would really appreciate also if you could tell me if I can see somewhere
this code that you have produced in the past.
 
> As I understand, at the moment you have a template file that you copy
> and fill in with the right information. It may be better that you have
> an object, lets say "code_maintainer" that defines the fixed data of
> this file, knows how to add the information on the right places and
> also knows the commands to compile the file (which may be system
> dependent). That is, code_maintainer creates the code on the fly and
> writes it to a file (the name may be user defined at this point and
> not predefined as yours which complicated simultaneous multiple
> problem definitions)
>
> This code_maintainer object may make your life easier in the future
> when adding features, adapting to changes in fenics or fixing bugs.
> Additionally, all the operations do not need to be applied directly to
> a string or file (as you do now) but the final file can be abstracted
> in a structure (even better an xml DOM) that at the very end generates
> a string.
>
> Does this help?
>
This is exactly what I would like to do, but I have to study more to understand
exactly what you are suggesting to do.

Thanks a lot again

marco

> Cheers
>
> JPi,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]