public void MakeContinuous(SinglePhaseField DGLevelSet, SinglePhaseField LevelSet, CellMask Domain) { CDGField.ProjectDGField(1.0, DGLevelSet, Domain); LevelSet.Clear(); CDGField.AccToDGField(1.0, LevelSet); }
protected override double RunSolverOneStep(int TimestepNo, double phystime, double dt) { origin.ProjectField((x, y) => (Math.Sin(x) + Math.Cos(x) + x - (Math.Cos(y) + 1))); // 2D //origin.ProjectField((x, y, z) => (Math.Sin(x) + Math.Cos(x) + x - (y + 1) + Math.Sin(z))); // 3D //origin.ProjectField((x, y, z) => Math.Sqrt(x.Pow2() + y.Pow2() + z.Pow2()) - 1); //origin.ProjectField((x, y) => x * x + y * y * y - x * y); //origin.ProjectField((x,y) => x + y); //origin.ProjectField((x, y) => Math.Sin(2 * Math.PI * (x / 3.0))); CellMask msk2D = CellMask.GetCellMask((BoSSS.Foundation.Grid.Classic.GridData)(this.GridData), X => (X[0] > 0.0 && X[0] < 4.0 && X[1] > 0.0 && X[1] < 1.0)); //|| (X[0] > 1.0 && X[0] < 3.0 && X[1] > 1.0 && X[1] < 2.0) //|| (X[0] > 2.0 && X[0] < 4.0 && X[1] > 2.0 && X[1] < 3.0) //|| (X[0] > 3.0 && X[0] < 4.0 && X[1] > 3.0 && X[1] < 4.0)); //CellMask msk3D = CellMask.GetCellMask(this.GridData, X => (X[0] > 0.0 && X[0] < 3.0 && X[1] > 0.0 && X[1] < 3.0 && X[2] > 0.0 && X[2] < 1.5) //|| (X[0] > 0.0 && X[0] < 1.5 && X[1] > 0.0 && X[1] < 3.0 && X[2] > 0.0 && X[2] < 3.0) //|| (X[0] > 0.0 && X[0] < 3.0 && X[1] > 0.0 && X[1] < 1.5 && X[2] > 0.0 && X[2] < 3.0)); CellMask test = null; cdgField.ProjectDGField(1.0, origin, test); cdgField.AccToDGField(1.0, result); //specField.ProjectDGField(1.0, origin, test); //specField.AccToDGField(1.0, specFieldDG); //MultidimensionalArray n4 = MultidimensionalArray.Create(3, 2); //n4[0, 0] = 0.3; //n4[0, 1] = -1; //n4[1, 0] = 0.6; //n4[1, 1] = -1; //n4[2, 0] = 0.9; //n4[2, 1] = -1; //MultidimensionalArray n11 = MultidimensionalArray.Create(3, 2); //n11[0, 0] = -0.4; //n11[0, 1] = 1; //n11[1, 0] = 0.2; //n11[1, 1] = 1; //n11[2, 0] = 0.8; //n11[2, 1] = 1; //NodeSet ns4 = new NodeSet(Grid.GetRefElement(0), n4); //NodeSet ns11 = new NodeSet(Grid.GetRefElement(0), n11); //MultidimensionalArray res4 = MultidimensionalArray.Create(1, 3); //MultidimensionalArray res11 = MultidimensionalArray.Create(1, 3); //result.Evaluate(4,1,ns4, res4); //result.Evaluate(11, 1, ns11, res11); PlotCurrentState(0.0, 0, 4); //var err = origin.CloneAs(); //err.Acc(-1.0, result); double L2err = 0.0; //err.L2Norm(); double L2jump = JumpNorm(result, test); Console.WriteLine(""); //double L2jump_specFEM = JumpNorm(specFieldDG, test); //Console.WriteLine("L2 error = " + L2err); Console.WriteLine("L2 Norm of [[u]] = " + L2jump); //Console.WriteLine("L2 Norm of [[u]] = " + L2jump_specFEM); if (L2err < 1.0e-10 && L2jump < 1.0e-12) { Console.WriteLine("Test PASSED"); passed = true; } else { Console.WriteLine("Test FAILED"); passed = false; } base.TerminationKey = true; return(0.0); }