In order to write a differential equation in a mathematical natural way we have developed an expression framework, that allowes exacly this. Instead of adding abstract operator-classes to the problem definition we implement the coefficient functions of the operators using mathematical operators. An example is the following bilinearform
In order to write a differential equation in a mathematical natural way we have developed an expression framework, that allowes exacly this. Instead of adding abstract operator-classes to the problem definition we implement the coefficient functions of the operators using mathematical operators. An example is the following bilinearform
Assume that ``\phi`` represents a DOFVector, i.e. a discrete representation of a function in a function-space, that is known in advance, or given by an iterative solution procedure from the last iteration. Here we use a solution component of the problem `prob`:
<momaxsize="1">(</mo>
<mi>c</mi>
<mo>,</mo>
<mi>ϑ</mi>
<momaxsize="1">)</mo>
<mo>:</mo>
<mo>=</mo>
<mo>〈</mo>
<mfrac>
<mrow>
<mn>1</mn>
</mrow>
<mrow>
<mi>ϵ</mi>
</mrow>
</mfrac>
<momaxsize="1">(</mo>
<msup>
<mrow>
<mi>ϕ</mi>
</mrow>
<mrow>
<mn>2</mn>
</mrow>
</msup>
<mo>-</mo>
<mn>1</mn>
<momaxsize="1">)</mo>
<mi>c</mi>
<mo>,</mo>
<mspacewidth="0.278em"></mspace>
<mi>ϑ</mi>
<mo>〉</mo>
<mo>+</mo>
<mo>〈</mo>
<mo>max</mo>
<momaxsize="1">(</mo>
<msup>
<mrow>
<mn>10</mn>
</mrow>
<mrow>
<mo>-</mo>
<mn>5</mn>
</mrow>
</msup>
<mo>,</mo>
<mspacewidth="0.278em"></mspace>
<momaxsize="1">(</mo>
<mi>ϕ</mi>
<mo>+</mo>
<mn>1</mn>
<momaxsize="1">)</mo>
<momaxsize="1">)</mo>
<mo>∇</mo>
<mi>c</mi>
<mo>,</mo>
<mspacewidth="0.278em"></mspace>
<mo>∇</mo>
<mi>ϑ</mi>
<mo>〉</mo>
</mrow>
</math>
<!-- end MathToWeb -->
Assume that φ represents a DOFVector, i.e. a discrete representation of a function in a function-space, that is known in advance, or given by an iterative solution procedure from the last iteration. Here we use a solution component of the problem `prob`:
```c++
```c++
DOFVector<double>*phi=prob->getSolution(0);
DOFVector<double>*phi=prob->getSolution(0);
```
```
The bilinearform consists of two individual parts, a term of zeroth derivative order (ZOT) and a term that contains two derivatives, of ``c`` and ``\vartheta``, i.e. of the trial and test function. We have to implement the corresponding coefficient functions of these two terms individually and add the term using the functions `addZOT`, respective `addSOT` to the operator. Lets assume the trial and test functions are in the finite element space`feSpace` given as the first space of the problem, then we can define the bilinearform as
The bilinearform consists of two individual parts, a term of zeroth derivative order (ZOT) and a term that contains two derivatives, of c and ϑ, i.e. of the trial and test function. We have to implement the corresponding coefficient functions of these two terms individually and add the term using the functions `addZOT`, respective `addSOT` to the operator. Lets assume the trial and test functions are in the finite element space`feSpace` given as the first space of the problem, then we can define the bilinearform as