---
title: "InitializePDEMethodData"
language: "en"
type: "Symbol"
summary: "InitializePDEMethodData[vd, sd, m] returns a method data object for the method specified by m according to variable data vd and solution data sd."
keywords: 
- PDE
- Partial differential equation
- Partial differential equations
- FEM
- Finite element
- Finite element method
- Variable data
- Solution data
- InitializePDEMethod
- InitializePDE
- PDEMethod
- PDEMethodData
canonical_url: "https://reference.wolfram.com/language/FEMDocumentation/ref/InitializePDEMethodData.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Finite Element Method"
    link: "https://reference.wolfram.com/language/FEMDocumentation/guide/FiniteElementMethodGuide.en.md"
related_functions: 
  - 
    title: "InitializePDECoefficients"
    link: "https://reference.wolfram.com/language/FEMDocumentation/ref/InitializePDECoefficients.en.md"
  - 
    title: "InitializeBoundaryConditions"
    link: "https://reference.wolfram.com/language/FEMDocumentation/ref/InitializeBoundaryConditions.en.md"
  - 
    title: "FEMMethodData"
    link: "https://reference.wolfram.com/language/FEMDocumentation/ref/FEMMethodData.en.md"
  - 
    title: "ToNumericalRegion"
    link: "https://reference.wolfram.com/language/FEMDocumentation/ref/ToNumericalRegion.en.md"
  - 
    title: "ToElementMesh"
    link: "https://reference.wolfram.com/language/FEMDocumentation/ref/ToElementMesh.en.md"
related_tutorials: 
  - 
    title: "Finite Element Programming"
    link: "https://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementProgramming.en.md"
  - 
    title: "NDSolve Finite Element Options"
    link: "https://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementOptions.en.md"
---
## NDSolve\`FEM\`

# InitializePDEMethodData

InitializePDEMethodData[vd, sd, m] returns a method data object for the method specified by m according to variable data vd and solution data sd.

## Details and Options

* ``InitializePDEMethodData`` initializes the PDE discretization method ``m``.

* ``InitializePDEMethodData`` computes and stores data such as geometry data.

* The ``Automatic`` method for ``InitializePDEMethodData`` is the finite element method and the initialized data is returned as a ``FEMMethodData`` object.

* Variable data ``vd`` and solution data ``sd`` are corresponding lists of variables and values. Templates for ``vd`` and ``sd`` may be generated using ``NDSolve\`VariableData`` and ``NDSolve\`SolutionData``, and components may be set using ``NDSolve\`SetSolutionDataComponent``.

* The ``"Space"`` component of ``vd`` and ``sd`` should be set to the spatial variables and the spatial mesh represented as an ``NumericalRegion`` object, respectively.

* The ``"DependentVariables"`` component of ``vd`` should be set to the list of unknown function names without arguments.

* For time-dependent problems, the ``"Time"`` component of ``vd`` and ``sd`` should be set to the temporal variable and the initial time, respectively.

* In ``InitializePDEMethodData[vd, sd, m]``, the method ``m`` may be specified by ``mname`` or ``{mname, mopts}``, where ``mname`` is the method name and ``mopts`` are method specific options. Currently only the ``"FiniteElement"`` method is supported.

* ``InitializePDEMethodData[vd, sd]`` uses the ``"FiniteElement"`` method by default.

* The ``"FiniteElement"`` method accepts the following options:

|                           |           |                                                             |
| ------------------------- | --------- | ----------------------------------------------------------- |
| "IntegrationOrder"        | Automatic | sets the element integration order                          |
| "InterpolationOrder"      | Automatic | sets the order of interpolation for each dependent variable |
| "MeshOptions"             | Automatic | specifies options for mesh generation                       |
| "PrecomputeGeometryData"  | Automatic | precomputes geometry data                                   |

* With an ``ElementMesh`` having ``"MeshOrder"`` $$p$$``, the ``"InterpolationOrder"`` can be at most ``$$p$$`` and ``"InterpolationOrder" -> Automatic`` defaults to the order ``$$p$$``. Multiple dependent variables may have a different interpolation order; at least one interpolation order needs to be set to the maximum mesh order ``$$p$$.

* The ``"IntegrationOrder"`` is the order of accuracy used to integrate the finite element operators. For ``"InterpolationOrder" -> 2``, the ``"IntegrationOrder"`` defaults to fourth order and for ``"InterpolationOrder" -> 1``, the ``"IntegrationOrder"`` defaults to second order.

* For the ``"FiniteElement"`` method, if the ``NumericalRegion`` does not contain an ``ElementMesh``, then one is created automatically using ``ToElementMesh``, with the options given in the setting of ``"MeshOptions"``.

* Setting the option from ``NDSolve`` and related functions is explained in [NDSolve Finite Element Options](https://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementOptions.en.md).

---

## Examples (6)

### Basic Examples (1)

Load the finite element package:

```wl
In[1]:= Needs["NDSolve`FEM`"]
```

Set up a ``NumericalRegion`` :

```wl
In[2]:= nr = ToNumericalRegion[Rectangle[{0, 0}, {1, 1 / 2}]]

Out[2]= NumericalRegion[FullRegion[2], {{0, 1}, {0, (1/2)}}]
```

Set up variable and solution data:

```wl
In[3]:=
vd = NDSolve`VariableData[{"DependentVariables", "Space"} -> {{u}, {x, y}}];
sd = NDSolve`SolutionData["Space" -> nr];
```

Initialize the partial differential equation data:

```wl
In[4]:= InitializePDEMethodData[vd, sd]

Out[4]= FEMMethodData[<1261,{2},4>]
```

### Options (5)

#### "IntegrationOrder" (1)

The integration order is a submethod option for the finite element method that specifies the numerical integration order used by the method.

Set the integration order to 2:

```wl
In[1]:= InitializePDEMethodData[vd, sd, Method -> {"FiniteElement", "IntegrationOrder" -> 2}]

Out[1]= FEMMethodData[<1261,{2},2>]
```

In the case where an ``ElementMesh`` with ``"MeshOrder"`` 2 is given, the ``Automatic`` setting chooses an integration order of 4. For an ``ElementMesh`` with ``"MeshOrder"`` 1, an integration order of 2 is chosen. The maximum order is 5.

#### "InterpolationOrder" (1)

The interpolation order is a submethod for the finite element method option and specifies the interpolation order for each dependent variable:

```wl
In[1]:=
vd2 = vd;sd2 = sd;nr2 = nr;
NDSolve`SetSolutionDataComponent[vd2, "DependentVariables", {u, v}];
NDSolve`SetSolutionDataComponent[sd2, "Space", nr2];
```

Specify that the dependent variable ``u`` is to be interpolated as second order, while the dependent variable ``v`` is interpolated with first order:

```wl
In[2]:= InitializePDEMethodData[vd2, sd2, Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 1}}]

Out[2]= FEMMethodData[<1696,{2, 1},4>]
```

#### "MeshOptions" (1)

``"MeshOptions"`` is a submethod option for the finite element method that specifies the options to be passed to ``ToElementMesh``.

Initialize the partial differential equation data with a first-order mesh:

```wl
In[1]:= InitializePDEMethodData[vd, sd, Method -> {"FiniteElement", "MeshOptions" -> {"MeshOrder" -> 1}}]

Out[1]= FEMMethodData[<480,{1},2>]
```

Inspect the mesh order in the numerical region:

```wl
In[2]:= nr["ElementMesh"]["MeshOrder"]

Out[2]= 1
```

#### Method (1)

The default method uses a finite element method:

```wl
In[1]:= InitializePDEMethodData[vd, sd] === InitializePDEMethodData[vd, sd, Method -> {"FiniteElement"}]

Out[1]= True
```

#### "PrecomputeGeometryData" (1)

Precomputing geometry data is a submethod option for the finite element method that computes and stores geometry data needed by the method. Setting this to ``False`` may save some memory:

```wl
In[1]:= InitializePDEMethodData[vd, sd, Method -> {"FiniteElement", "PrecomputeGeometryData" -> False}]

Out[1]= FEMMethodData[<1261,{2},4>]

In[2]:= ByteCount[%]

Out[2]= 127560

In[3]:=
InitializePDEMethodData[vd, sd, Method -> {"FiniteElement"}]
ByteCount[%]

Out[3]= FEMMethodData[<1261,{2},4>]

Out[3]= 282608
```

## See Also

* [InitializePDECoefficients](https://reference.wolfram.com/language/FEMDocumentation/ref/InitializePDECoefficients.en.md)
* [InitializeBoundaryConditions](https://reference.wolfram.com/language/FEMDocumentation/ref/InitializeBoundaryConditions.en.md)
* [FEMMethodData](https://reference.wolfram.com/language/FEMDocumentation/ref/FEMMethodData.en.md)
* [ToNumericalRegion](https://reference.wolfram.com/language/FEMDocumentation/ref/ToNumericalRegion.en.md)
* [ToElementMesh](https://reference.wolfram.com/language/FEMDocumentation/ref/ToElementMesh.en.md)

## Tech Notes

* [Finite Element Programming](https://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementProgramming.en.md)
* [NDSolve Finite Element Options](https://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementOptions.en.md)

## Related Guides

* [Finite Element Method](https://reference.wolfram.com/language/FEMDocumentation/guide/FiniteElementMethodGuide.en.md)