4

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.

Karsten7
  • 27,448
  • 5
  • 73
  • 134
  • 4
    Try Length[ifun["ElementMesh"]["Coordinates"]] where ifun is the generated InterpolatingFunction. – ilian Oct 05 '15 at 04:57

1 Answers1

4

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
m_goldberg
  • 107,779
  • 16
  • 103
  • 257