1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<< "KrancThorn.m";
groups = {{"phi_g", {phi}}};
derivatives =
{
PDstandard[1] -> DPlus[1]
};
PD = PDstandard;
f[x_] := Exp[-(x/0.1)^2];
initialGaussianCalc =
{
Name -> "initial_gaussian",
Schedule -> {"AT INITIAL"},
Equations ->
{
phi -> f[t+x]
}
};
evolveCalc =
{
Name -> "calc_rhs",
Schedule -> {"at EVOL"},
Where -> Interior,
Equations ->
{
dot[phi] -> PD[phi,1]
}
};
integrateCalc =
{
Name -> "rk1",
Schedule -> {"at EVOL after calc_rhs"},
Where -> Interior,
Equations ->
{
phi -> phi + dt dot[phi]
}
};
CreateKrancThornTT[groups, ".",
"AdvectCaKernel",
Calculations -> {initialGaussianCalc(* , evolveCalc, integrateCalc *)},
PartialDerivatives -> derivatives,
UseCaKernel -> True,
EvolutionTimelevels -> 1,
DeclaredGroups -> {"phi_g"}];
|