Dear sir:
I want to obtain the area and normal direction of each face in a tetrahedra, which function can resolve this.
Regards
I haven't used grids with tetrahedra, but I guess it should be similar to hexahedra. You go to each face and use transfomations to get the normals like this.
for (int i = 0; i < mesh->GetNumFaces();; i++)
{
T = pmesh->GetInteriorFaceTransformations(i);
CalcOrtho(T->Face->Jacobian(), nor);
}
The vector nor also contains information about the surface area. If you just get the magnitude of the vector, it is the surface area.
If you just need the face normal and area, it is cheaper to use Mesh::GetFaceTransformation; also before calling the method ElementTransformation::Jacobian you should set the point at which you want to compute the normal and the area, for example:
Vector nor;
const int nfaces = mesh->GetNumFaces();
for (int i = 0; i < nfaces; i++)
{
ElementTransformation *T = mesh->GetFaceTransformation(i);
// Evaluate the Jacobian at the center of the face:
T->SetIntPoint(&Geometries.GetCenter(mesh->GetFaceBaseGeometry(i)));
CalcOrtho(T->Jacobian(), nor);
// Use 'nor' ...
}
Hi @v-dobrev ,
How to get the direction of every normal vector?
Most helpful comment
If you just need the face normal and area, it is cheaper to use
Mesh::GetFaceTransformation; also before calling the methodElementTransformation::Jacobianyou should set the point at which you want to compute the normal and the area, for example: