octave-maintainers
[Top][All Lists]
Advanced

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

Re: problem with fem-fenics


From: Juan Pablo Carbajal
Subject: Re: problem with fem-fenics
Date: Sat, 20 Jul 2013 22:24:55 +0200

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,

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).

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?

Cheers

JPi,


reply via email to

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