← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Implemented replacement for CoefficientSet

 

On Thu, Oct 01, 2009 at 11:42:00AM +0200, DOLFIN wrote:
> One or more new changesets pushed to the primary dolfin repository.
> A short summary of the last three changesets is included below.
>
> changeset:   7207:4091d99bf41e
> tag:         tip
> user:        Anders Logg <logg@xxxxxxxxx>
> date:        Thu Oct 01 11:42:04 2009 +0200
> files:       ChangeLog dolfin/fem/Form.cpp dolfin/fem/Form.h dolfin/function/CoefficientAssigner.cpp dolfin/function/CoefficientAssigner.h
> description:
> Implemented replacement for CoefficientSet

I've added a couple of new functions to the Form class. There are now
various versions of set_coefficient() and set_coefficients().

One may set a coefficient based on its number of its name. One may
also set a whole bunch of coefficients at once (possibly a subset).

In particular, one may use a map from strings to coefficient pointers.

void set_coefficients(std::map<std::string, const Coefficient*> coefficients);

void set_coefficients(std::map<std::string, boost::shared_ptr<const Coefficient> > coefficients);

Then one may do

  my_coefficients["f"] = &f;
  my_coefficients["g"] = &g;

and then

  a.set_coefficients(my_coefficients);

Does this cover it?

--
Anders

Attachment: signature.asc
Description: Digital signature


References