octave-maintainers
[Top][All Lists]
Advanced

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

Re: fem-fenics


From: c.
Subject: Re: fem-fenics
Date: Wed, 3 Jul 2013 08:06:31 +0200

On 2 Jul 2013, at 18:52, Marco Vassallo <address@hidden> wrote:

> Hi all,
> 
> I need to execute a shell command from inside a dld function: I have seen 
> that we can use the command
> system(). Is it the best way of doing it?

why do you need this? I don't think you should do it, you should use m-files 
for this.
In general, if there is something you can do within an m-file, try not to use a 
dld function for it.

> After the discussion we had at OctConf, someone suggested me that I should 
> put some dolfin_init() command at the beginning of evert m-file, for setting 
> the environment..what exactly does it mean?

this was probably me.
You need to register new classes in the Octave interpreter before you can use 
them, 
see for example the file simple.h in openmpi_ext [1] that defines a new class 
derived
from octave_base_value to represent an MPI communicator.
All functions in openmpi_ext check that the new type is registered and, if not, 
they call 
the method simple::register_type to do it.
I think it would make more sense to have a function to register all the types 
at once at the beginning
and issue an error when a user tries to use any function in the package before 
initialization.

> Where should I find the fem-fenics repository for uploading the code?
it seems you found it as you already pushed one change ;)

> Thanks
> Marco

c.


[1] 
http://sourceforge.net/p/octave/code/12097/tree/trunk/octave-forge/main/openmpi_ext/src/simple.h
[2] 
http://sourceforge.net/p/octave/code/12097/tree/trunk/octave-forge/main/openmpi_ext/src/MPI_Recv.cc#l713
[3] 
http://sourceforge.net/p/octave/code/12097/tree/trunk/octave-forge/main/openmpi_ext/src/MPI_Send.cc#l777

reply via email to

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