← Back to team overview

ffc team mailing list archive

Re: [HG FFC] Use loop to reset element tensor. Bug fix in regression test.py when same file fails for both representations.

 



Kristian Oelgaard wrote:
Quoting FFC <ffc@xxxxxxxxxx>:

One or more new changesets pushed to the primary ffc repository.
A short summary of the last three changesets is included below.

changeset:   1621:96ac3d15dc2c4dbbb5c4fdaefbc8581684c43cf2
tag:         tip
user:        "Kristian Oelgaard <k.b.oelgaard@xxxxxxxxxx>"
date:        Fri Aug 21 11:49:02 2009 +0100
files:       ffc/compiler/compiler.py ffc/compiler/integrals.py
ffc/compiler/tensor/tensorgenerator.py ffc/compiler/ufcformat.py
test/regression/reference/quadrature/Biharmonic.h
test/regression/reference/quadrature/Constant.h
test/regression/reference/quadrature/Elasticity.h
test/regression/reference/quadrature/Equation.h
test/regression/reference/quadrature/FacetIntegrals.h
test/regression/reference/quadrature/FunctionOperators.h
test/regression/reference/quadrature/Heat.h
test/regression/reference/quadrature/Mass.h
test/regression/reference/quadrature/MixedPoisson.h
test/regression/reference/quadrature/NavierStokes.h
test/regression/reference/quadrature/NeumannProblem.h
test/regression/reference/quadrature/Optimization.h
test/regression/reference/quadrature/Poisson.h
test/regression/reference/quadrature/PoissonDG.h
test/regression/reference/quadrature/PoissonSystem.h
test/regression/reference/quadrature/QuadratureElement.h
test/regression/reference/quadrature/ReactionDiffu
 sion.h test/regression/reference/quadrature/StabilisedStokes.h
test/regression/reference/quadrature/Stokes.h
test/regression/reference/quadrature/SubDomains.h
test/regression/reference/quadrature/TensorWeightedPoisson.h
test/regression/reference/quadrature/VectorLaplaceGradCurl.h
test/regression/reference/tensor/Constant.h
test/regression/reference/tensor/Elasticity.h
test/regression/reference/tensor/Equation.h
test/regression/reference/tensor/FacetIntegrals.h
test/regression/reference/tensor/Heat.h
test/regression/reference/tensor/Mass.h
test/regression/reference/tensor/MixedPoisson.h
test/regression/reference/tensor/NavierStokes.h
test/regression/reference/tensor/NeumannProblem.h
test/regression/reference/tensor/Optimization.h
test/regression/reference/tensor/Poisson.h
test/regression/reference/tensor/PoissonSystem.h
test/regression/reference/tensor/ReactionDiffusion.h
test/regression/reference/tensor/StabilisedStokes.h
test/regression/reference/tensor/Stokes.h test/regres
 sion/reference/tensor/SubDomains.h
test/regression/reference/tensor/VectorLaplaceGradCurl.h
test/regression/test.py test/unit/test_reduce_operations2.py
description:
Use loop to reset element tensor. Bug fix in regression test.py when same
file fails for both representations.

I changed the generated code inside the tabulate_tensor() function, such that we
use a loop:

// Reset values of the element tensor block
for (unsigned int j = 0; j < 10000; j++)
  A[j] = 0;

instead of:

A[0] = 0;
...
A[9999] = 0;

which saves an awful lot of lines for higher order elements.

No loop is generated if the tensor only has one entry e.g., functional:

A[0] = 0;

We can set the limit for when to use one or the other reset method to whatever
we like of course, but most compiler should be able to figure the simple loop
out with no overhead.


I would suggest always using a loop for simple problems. Compilers are pretty good with simple loops.

Garth

Kristian

changeset:   1620:d717a46398a7f43ae41bbceee72f19029c2b02ba
user:        "Kristian Oelgaard <k.b.oelgaard@xxxxxxxxxx>"
date:        Thu Aug 20 15:35:09 2009 +0100
files:       ffc/compiler/quadrature/fraction.py
ffc/compiler/quadrature/optimisedquadraturetransformer.py
test/unit/test_symbolics.py
description:
Implement __div__ for fractions (quadrature optimisations).


changeset:   1619:235921dd98b9b0322ccf6ec2be1b31c6e77c41b0
user:        "Kristian Oelgaard <k.b.oelgaard@xxxxxxxxxx>"
date:        Wed Aug 19 15:48:09 2009 +0100
files:       doc/man/man1/ffc.1.gz doc/manual/chapters/manpagecopy.tex
doc/manual/ffc-user-manual.pdf
description:
Some updates to the man page.

----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/ffc
_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev



_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev



References