4
$\begingroup$

I am using Mathematica version 10 to solve a 2-D elliptic equation by the finite element method. I created a finite element model with a very fine mesh. Would you please suggest me a command to show the total number of nodes in the model. This is because it is difficult to find it from the plot.

$\endgroup$
1
  • 4
    $\begingroup$ Try Length[ifun["ElementMesh"]["Coordinates"]] where ifun is the generated InterpolatingFunction. $\endgroup$
    – ilian
    Commented Oct 5, 2015 at 4:57

1 Answer 1

4
$\begingroup$

Based on Ilian's comment, but modified to fit your situation.

Needs["NDSolve`FEM`"];
Ω = 
  MeshRegion[
    {{0, 0}, {2/Sqrt[3], 0}, {1/Sqrt[3], 1}}, 
    {Line[{{1, 2}, {2, 3}, {3, 1}}]}]; 
mesh = ToElementMesh[Ω, MaxCellMeasure -> 0.01, "MeshOrder" -> 1];
mesh["Coordinates"] // Length
59
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.