Hi JJ, you would solve a variational problem
VV = VectorFunctionSpace(..) u = TrialFunction(VV) v = TestFunction(VV) a = dot(u,v)*dx L = dot(grad(scalar1), v)*dx problem = VariationalProblem(a,L) c = problem.solve() Kent On 25 February 2011 19:25, JJ Jiang <[email protected]>wrote: > New question #146882 on DOLFIN: > https://answers.launchpad.net/dolfin/+question/146882 > > Hi all, > This should be a naive question since I am about 14 days new to Dolfin at > this point. > I want to calculate gradients for either a scalar or a vector field. > Both scalar or vector fields are read from external files. The mesh below > refers to a triangulated surface. > > V = FunctionSpace(mesh, "CG", 1) > scalar1 = Function(V, "1.xml") > c = grad(scalar1) > > I want to have c as a vector so that I can save that to a vtk file for > visualization or do some further operations on that. > outfile = File("example.pvd") > outfile << c > Alternatively, I could convert c to 3 different scalar functions. Is there > anyway to do such operation in Dolfin. > > For a vector field v(x,y,z), the gradient operation will create a > tensor/matrix. How can I manipulate them? For instance, I only need dv/dx, > dv/dy and dv/dz. Thanks so much for your help. > > Best regards, > --JJ > > > -- > You received this question notification because you are a member of > DOLFIN Team, which is an answer contact for DOLFIN. > > _______________________________________________ > Mailing list: https://launchpad.net/~dolfin > Post to : [email protected] > Unsubscribe : https://launchpad.net/~dolfin > More help : https://help.launchpad.net/ListHelp >
_______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : [email protected] Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp

