← Back to team overview

dolfin team mailing list archive

Re: New Function implementation

 

"in" is a reserved keyword in python. Suggestions: "f.in_space(V)" or
"f.in_function_space(V)" or "f.member(V)"

As mentioned before, these are not threadsafe:

    /// Access current cell (available during assembly for
user-defined function)
    const Cell& cell() const;

    /// Access current facet (available during assembly for
user-defined function)
    uint facet() const;

    /// Access current facet normal (available during assembly for
user-defined function)
    Point normal() const;

If we keep these instead of making them arguments to eval,
the user must create one Function for each thread to use
it in a parallell shared memory application.

-- 
Martin



2008/10/16 Garth N. Wells <gnw20@xxxxxxxxx>:
>  From inspection it looks nice to me. Cleaner and easier to follow than
> the current version, and the ownership issues are ironed out.
>
> Is there a sensible way to test it other than renaming NewFunction ->
> Function?
>
> Garth
>
>
> Anders Logg wrote:
>> I've finished up the new implementation of the Function class.
>> It's untested, but I'm pretty sure it works... :-) I'm very happy with
>> the way it turned out.
>>
>> Anyway, it would be good if anyone interested would review the design
>> and implementation (in detail, including function names etc).
>>
>> The Function class is central so it would be good if we could agree on
>> a design and keep it stable for some time (like we've managed with the
>> linear algebra interfaces).
>>
>> The main changes compared to the old/current design are as follows:
>>
>> 1. Introduction of a FunctionSpace class. A FunctionSpace is defined
>> by a Mesh, a FiniteElement and a DofMap.
>>
>> 2. Removal of the class hierarchy. Only one class Function remains.
>> This acts dynamically either as a user-defined function (if the vector
>> of coefficients is null) or as the old DiscreteFunction.
>>
>> 3. The proliferation of constructors has been removed. There is
>> essentially only one constructor, namely
>>
>>   v = Function(V)
>>
>> An additional class named Constant should be added to handle constant
>> functions, overloading eval() and providing a bunch of constructors
>> (scalar, vector, tensor).
>>
>> When we've settled on the design/implementation of Function and
>> FunctionSpace, we need to do a round of editing of the DofMap class.
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> DOLFIN-dev mailing list
>> DOLFIN-dev@xxxxxxxxxx
>> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>


Follow ups

References