syfi team mailing list archive
-
syfi team
-
Mailing list archive
-
Message #00299
Re: [HG syfi] Updates to SFC manual.
For the example with the nonlinear Jacobian I suggest nonlinear
convection + diffusion:
In the "old syntax" this was like:
from swiginac import *
from SyFi import *
from SFC.symbolic_utils import grad
def sum(u_char,fe):
ujs = symbolic_matrix(1,fe.nbf(), u_char)
u = 0
for j in range(0,fe.nbf()):
u += ujs.op(j)*fe.N(j)
u = u.evalm()
return u,ujs
initSyFi(2)
nsd = cvar.nsd = 2
polygon = ReferenceTriangle()
fe = VectorLagrange(polygon, 2)
# create sum u_i N_i
u, ujs = sum("u", fe)
Jinv = symbolic_matrix(2,2,"Jinv")
for i in range(0,fe.nbf()):
# compute diffusion term
fi_diffusion = inner(grad(u, Jinv), grad(fe.N(i), Jinv))
# compute convection term
uxgradu = (u.transpose()*grad(u, Jinv))
fi_convection = inner(uxgradu, fe.N(i), True)
fi = fi_diffusion + fi_convection
Fi = polygon.integrate(fi)
for j in range(0,fe.nbf()):
# differentiate to get the Jacobian
uj = ujs.op(j)
Jij = diff(Fi, uj)
print "J[%d,%d]=%s;\n"%(i,j,Jij.evalf().printc())
ons, 22.08.2007 kl. 11.51 +0200, skrev SyFi:
> One or more new changesets pushed to the primary SyFi repository.
> A short summary of the last three changesets is included below.
>
> changeset: 690:26eb8aef82270c6e9853c91de4869a0fe0dab97a
> tag: tip
> user: "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date: Wed Aug 22 11:52:17 2007 +0200
> files: doc/manual/syfi-user-manual.pdf doc/manual/syfi-user-manual.tex python/sfc/TODO.TXT python/sfc/UserForm.py
> description:
> Updates to SFC manual.
>
>
> changeset: 689:709957483f840e4fc7010f09684f2ad574969f4b
> user: "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date: Tue Aug 21 14:27:38 2007 +0200
> files: python/sfc/common/__init__.py
> description:
> Missing file.
>
>
> changeset: 688:09e52c5235ac84abddf6b717701fb80d61fc679d
> user: "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date: Tue Aug 21 14:26:40 2007 +0200
> files: python/ufccodegen/__init__.py python/ufccodegen/affine_map.py python/ufccodegen/clean.sh python/ufccodegen/code_generator.py python/ufccodegen/dof_map.py python/ufccodegen/dof_map_discontinuous.py python/ufccodegen/dof_map_simplex.py python/ufccodegen/finite_element.py python/ufccodegen/finite_element_simplex.py python/ufccodegen/form.py python/ufccodegen/form_simplex.py python/ufccodegen/forms.py python/ufccodegen/function.py python/ufccodegen/logger.py python/ufccodegen/nonlinear_form.py python/ufccodegen/options.py python/ufccodegen/quad_tables.py python/ufccodegen/quadrature.py python/ufccodegen/sign_on_basis.py python/ufccodegen/strings.py python/ufccodegen/symbolic_utils.py python/ufccodegen/ufc_code_gen.py
> description:
> Removed ufccodegen, should've been removed a long time ago???
>
>
> ----------------------------------------------------------------------
> For more details, visit http://www.fenics.org/hg/syfi
> _______________________________________________
> SyFi-dev mailing list
> SyFi-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/syfi-dev
References