# Control the Solution Process

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

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

Specify a region and create a mesh with minimal bandwidth.

 In:= 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= Specify a plane strain operator.

 In:= 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:= 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= Inspect finite element data.

 In:= Xnds["FiniteElementData"]["Properties"]
 Out= Extract the method data.

 In:= XmethodData = nds["FiniteElementData"]["FEMMethodData"]
 Out= Extract the PDE coefficient data.

 In:= XpdeData = nds["FiniteElementData"]["PDECoefficientData"]
 Out= Extract the solution data.

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

Discretize the PDE.

 In:= XdPDE = DiscretizePDE[pdeData, methodData, solutionData]
 Out= Extract and visualize the stiffness matrix.

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

Questions? Comments? Contact a Wolfram expert »