# Control the Solution Process

Extract internal detail or intercept and control many aspects of the solution process.

 In[1]:= XNeeds["NDSolve`FEM`"]

Specify a region and create a mesh with minimal bandwidth.

 In[2]:= X\[CapitalOmega] = ImplicitRegion[ 0 <= x <= 2 && 0 <= y <= 0.5 && ! (x >= 1 && y <= 0.1) && ! (x >= 1 && y >= 0.4), {x, y}]; \[CapitalMu] = ToElementMesh[\[CapitalOmega], "NodeReordering" -> True]
 Out[2]=

Specify a plane strain operator.

 In[3]:= XplaneStrainOperator[ Y_, \[Nu]_] := {Inactive[ Div][({{0, -((Y \[Nu])/((1 - 2 \[Nu]) (1 + \[Nu])))}, {-(Y/( 2 (1 + \[Nu]))), 0}}.Inactive[Grad][v[x, y], {x, y}]), {x, y}] + Inactive[ Div][({{-((Y (1 - \[Nu]))/((1 - 2 \[Nu]) (1 + \[Nu]))), 0}, {0, -(Y/(2 (1 + \[Nu])))}}.Inactive[Grad][ u[x, y], {x, y}]), {x, y}], Inactive[ Div][({{0, -(Y/(2 (1 + \[Nu])))}, {-(( Y \[Nu])/((1 - 2 \[Nu]) (1 + \[Nu]))), 0}}.Inactive[Grad][ u[x, y], {x, y}]), {x, y}] + Inactive[ Div][({{-(Y/(2 (1 + \[Nu]))), 0}, {0, -(( Y (1 - \[Nu]))/((1 - 2 \[Nu]) (1 + \[Nu])))}}.Inactive[ Grad][v[x, y], {x, y}]), {x, y}]};

Set up the equations.

 In[4]:= X{nds} = NDSolve`ProcessEquations[{planeStrainOperator[10^3, 33/100] == {0, NeumannValue[-1, x == 2]}, DirichletCondition[{u[x, y] == 0., v[x, y] == 0.}, x == 0]}, {u, v}, {x, y} \[Element] \[CapitalMu]]
 Out[4]=

Inspect finite element data.

 In[5]:= Xnds["FiniteElementData"]["Properties"]
 Out[5]=

Extract the method data.

 In[6]:= XmethodData = nds["FiniteElementData"]["FEMMethodData"]
 Out[6]=

Extract the PDE coefficient data.

 In[7]:= XpdeData = nds["FiniteElementData"]["PDECoefficientData"]
 Out[7]=

Extract the solution data.

 In[8]:= XsolutionData = nds["SolutionData"][[1]];

Discretize the PDE.

 In[9]:= XdPDE = DiscretizePDE[pdeData, methodData, solutionData]
 Out[9]=

Extract and visualize the stiffness matrix.

 In[10]:= Xs = dPDE["StiffnessMatrix"]; MatrixPlot[s]
 Out[10]=

## Mathematica + Mathematica Online

Questions? Comments? Contact a Wolfram expert »