← Back to team overview

ffc team mailing list archive

Re: [HG FFC] merge.

 

On Mon, Oct 19, 2009 at 11:52:47AM +0100, Garth N. Wells wrote:
>
>
> Anders Logg wrote:
> > On Mon, Oct 19, 2009 at 12:30:32PM +0200, FFC wrote:
> >> One or more new changesets pushed to the primary ffc repository.
> >> A short summary of the last three changesets is included below.
> >>
> >> changeset:   1691:661f4a92d611
> >> tag:         tip
> >> parent:      1690:940341b3725e
> >> parent:      1689:9c35a629d382
> >> user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
> >> date:        Mon Oct 19 11:30:28 2009 +0100
> >> description:
> >> merge.
> >>
> >>
> >> changeset:   1690:940341b3725e
> >> parent:      1688:5dd1a706c6c1
> >> user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
> >> date:        Mon Oct 19 11:30:13 2009 +0100
> >> files:       ffc/compiler/language/README ffc/compiler/language/algebra.py
> >> description:
> >> Remove old directory.
> >
> > Did you read the README file?
> >
>
> Yes.

Well, I guess I can always do 'hg update 0' when I become sentimental.

You should try the same in DOLFIN. Pretty interesting. Here's src/problems/poisson/main.C:

int main(int argc, char **argv)
{
  // Set problem
  dolfin_set_problem("poisson");

   // Set parameters
  dolfin_set_parameter("problem description", "Poisson's equation on the unit cube");
  dolfin_set_parameter("output file prefix",  "poisson");
  //dolfin_set_parameter("grid file", "../../../data/grids/tetgrid_8_8_8.inp");

  // For 2d problems
  dolfin_set_parameter("grid file",
  "../../../data/grids/trigrid.gid");
  dolfin_set_parameter("space dimension", 2);

  // Set boundary conditions
  dolfin_set_boundary_conditions(my_bc);

  // Set the right-hand side
  dolfin_set_function("source",f);

  // Initialize dolfin
  dolfin_init(argc,argv);

  // Save parameters
  dolfin_save_parameters();

  // Solve the problem
  dolfin_solve();

  // Finished
  dolfin_end();

  return 0;
}

And here's src/modules/poisson/EquationPoisson.hh:

class EquationPoisson: public Equation{
public:

  EquationPoisson():Equation(3){

         AllocateFields(1);
         field[0] = &f;

  }

  real IntegrateLHS(ShapeFunction &u, ShapeFunction &v){
         return ( u.dx*v.dx + u.dy*v.dy + u.dz*v.dz );
  }
  real IntegrateRHS(ShapeFunction &v){
         return ( f * v );
  }

private:

  LocalField f;

};

Pretty interesting.

--
Anders

Attachment: signature.asc
Description: Digital signature


References