/// <summary> /// Test on a square 2D Voronoi mesh /// </summary> /// <param name="Res"> /// number of randomly chosen Delaunay vertices /// </param> /// <param name="deg"> /// polynomial degree /// </param> /// <param name="NoOfLlyodsIter"> /// Number of Llyods iterations. /// </param> /// <param name="mirror"> /// Mirror vertices of boundary cells along boundary to approximate boundary /// </param> /// <param name="solver_name"> /// Name of solver to use. /// </param> /// <returns></returns> public static SipControl TestVoronoi_Square( int Res, int deg = 1, int NoOfLlyodsIter = 10, bool mirror = false, LinearSolverCode solver_name = LinearSolverCode.classic_pardiso, Foundation.IO.IDatabaseInfo db = null) { return(TestGrid(new VoronoiGrids.Square(Res, NoOfLlyodsIter), deg, solver_name, db)); }
/// <summary> /// Test on a L-shaped 2D Voronoi mesh /// </summary> /// <param name="Res"> /// number of randomly chosen Delaunay vertices /// </param> /// <param name="deg"> /// polynomial degree /// </param> /// <param name="NoOfLlyodsIter"> /// Number of Llyods iterations. /// </param> /// <param name="mirror"> /// Mirror vertices of boundary cells along boundary to approximate boundary /// </param> /// <param name="solver_name"> /// Name of solver to use. /// </param> /// <returns></returns> public static SipControl TestVoronoi_LDomain( int Res, int deg = 1, int NoOfLlyodsIter = 10, bool mirror = false, LinearSolverConfig.Code solver_name = LinearSolverConfig.Code.classic_pardiso, Foundation.IO.IDatabaseInfo db = null) { VoronoiGrid grid = new VoronoiGrids.LDomain(Res, NoOfLlyodsIter); return(TestGrid(grid, deg, solver_name, db)); }
//Base case for Voronoi Testing static SipControl TestGrid( VoronoiGrid grid, int deg = 1, LinearSolverCode solver_name = LinearSolverCode.classic_pardiso, Foundation.IO.IDatabaseInfo db = null) { var R = new SipControl { ProjectName = "SipPoisson-Voronoi", SessionName = "testrun" }; R.ImmediatePlotPeriod = 1; if (db != null) { R.savetodb = true; R.SetDatabase(db); } R.FieldOptions.Add("T", new FieldOpts() { Degree = deg, SaveToDB = FieldOpts.SaveToDBOpt.TRUE }); R.FieldOptions.Add("Tex", new FieldOpts() { Degree = deg * 2 }); R.InitialValues_Evaluators.Add("RHS", X => 1.0); R.InitialValues_Evaluators.Add("Tex", X => X[0]); R.ExactSolution_provided = false; R.LinearSolver.NoOfMultigridLevels = int.MaxValue; R.LinearSolver.SolverCode = solver_name; R.LinearSolver.NoOfMultigridLevels = 1; //R.TargetBlockSize = 100; grid.SetGridAndBoundaries(R); return(R); }