NDSolve`FEM`
NDSolve`FEM`

NDEigensystem::fembdcc NDEigenvalues::fembdcc NDSolve::fembdcc NDSolveValue::fembdcc ParametricNDSolve::fembdcc ParametricNDSolveValue::fembdcc InitializePDECoefficients::femcnmd

Details

  • This message is generated when a PDE coefficient does not evaluate the necessary dimensions.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[InitializePDECoefficients::femcnmd].

Examples

Basic Examples  (2)

Consider the following diffusion coefficient :

The following PDE issues the message for the given diffusion coefficient:

This happens because during the automatic linearization a derivative of the coefficient cannot be formed. The solution is to write the coefficient not as a Piecewise returning matrices but as a matrix that contains Piecewise scalar coefficients:

Now, the evaluation works as expected:

Consider this compiled function, which is used as a PDE coefficient:

The first warning message tells you that the compiled function has been evaluated with something other than a machine-sized real number. In fact, this message comes from the evaluation of the compiled function with symbolic arguments:

The message is explained in more detail here. The compiled function then returns the body of the compiled code as a symbolic expression and NDSolve then solves the PDE. The warning message NDSolve gives indicates that this is a convection-dominant PDE and is explained here. Note, however, that NDSolve gives a solution to the PDE.

Now, one might want to work around this by specifying a compiled function that does not evaluate for symbolic input:

Using cf as a PDE coefficient in NDSolve will cause problems. To understand why and how to avoid this, a small detour is needed.

The way the PDE is set up will trigger the finite element method. What exactly triggers the finite element method is explained here. The finite element method can only deal with a very special form of PDE as explained here. The form is:

For the case under consideration, the important section is this part:

which is compared to the requested form:

In order to solve the PDE, what happens is, as explained here, that the coefficient gets pulled into the divergence and is compensated by adjusting the term such that you have:

where .

A compiled function that does not evaluate symbolically causes problems during this restructuring process of the PDE:

The reason is that finding the derivative of a compiled function does not work:

This is what NDSolve complains about. How to deal with this? There are two ways. First, if possible, you can give the symbolic coefficient and NDSolve will find the solution:

The second alternative is to manually construct the derivative and specify the coefficients:

The derivative can be used as the additional coefficient: