Modelling a Poisson Equation on piecewise constant material, ElementMarkers
on the PointElements
are used for the boundary conditions (using InitializeBoundaryConditions
). This works fine.
In the same way I want to use markers on the MeshElements
to determine the DiffusionCoefficient
matrix on the specific element.
How can one retrieve the ElementMarkers in InitializePDECoefficients to implement a piecewise constant diffusion coefficient?
Based on the implicit region definition's inequalities, this code works:
pdeCoefficients = InitializePDECoefficients[
variableData, solutionData,
"DiffusionCoefficients" -> {{
If[-0.5 <= x <= 0.5 && -0.5 <= y <= 0.5,
{{-11, 0}, {0, -11}}, {{-1, 0}, {0, -1}}] }},
"DampingCoefficients" -> {{1}}]
The following code does run but the result is not the same. The diffusion matrix seems to be equal to the unity matrix everywhere.
sigma = Which[
ElementMarker == 0, {{-1, 0}, {0, -1}},
ElementMarker == 1, {{-11, 0}, {0, -11}}];
pdeCoefficients =
InitializePDECoefficients[
variableData, solutionData,
"DiffusionCoefficients" -> {{sigma}},
"DampingCoefficients" -> {{1}}]
What syntax options are allowed in DiffusionCoefficients
?
Does anybody have a description on the FEM package that is more in-depth than Wolfram Reference?
stipulate
this for you. Then I could try to improve that. Also I am not sure I can follow you when you saythat markers must be disjoint
. There is no automatic marker assignment on boundaries except during the conversion from the boundary mesh to the full mesh. Also, I am not sure I understand how that relates to the question you posted here. If you could help understand that a bit better I could improve the documentation for future use if necessary. $\endgroup$ – user21 Mar 29 '16 at 21:06