Hi FEniCS family,
I am using the form generation of spatial coordinate of mesh in my variational formulation.
- I want to know what location of x are included in this form. Kindly consider the following MWE.
from __future__ import print_function
from dolfin import *
import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
mesh= UnitCubeMesh(1,1,1)
Ve = VectorElement("CG", mesh.ufl_cell(), 1,dim=3)
V = FunctionSpace(mesh, Ve)
x = SpatialCoordinate(mesh)
print(x[1])
Indexed(SpatialCoordinate(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 95)), MultiIndex((FixedIndex(1),)))
My query is
- Is x[1] contains x2 coordinates over all cells at nodal points or other location.
Can you explain me through example? I want to use the guass point location when I incorporate x[2] in the variational formulation.
mesh.coordinates()
array([[0., 0., 0.],
[1., 0., 0.],
[0., 1., 0.],
[1., 1., 0.],
[0., 0., 1.],
[1., 0., 1.],
[0., 1., 1.],
[1., 1., 1.]])
- Suppose I perform assemble operation for dx and ds to know which x2 coordinates are chosen.
How does this integration over dx is performed to get me 0.5 for above example. Does they take location of mid-point only? Kindly tell me similar for ds.
assemble((x[2])*dx)
0.5000000000000001
assemble((x[2])*ds)
3.0
- I changed the order of integration to 2 and mesh to (5,5,5), but still I got the same result as previous.
mesh=UnitCubeMesh(5,5,5)
Ve = VectorElement("CG", mesh.ufl_cell(), 2,dim=3)
V = FunctionSpace(mesh, Ve)
x = SpatialCoordinate(mesh)
assemble((x[2])*dx)
0.5000000000000001
I am not able to find this basic understanding and neither any resource to resolve this. Any help is greatly appreciated.