/// <summary> /// Selects algorithm variant based on the <paramref name="Option"/> /// </summary> /// <param name="ContBasis">DG basis for the continuous output data</param> /// <param name="DGBasis">DG basis for the discontinuous input data</param> /// <param name="gridData"></param> /// <param name="Option">Choice of algorithm</param> public ContinuityProjection(Basis ContBasis, Basis DGBasis, IGridData gridData, ContinuityProjectionOption Option) { myOption = Option; switch (Option) { case ContinuityProjectionOption.SpecFEM: { var ContinuousLevelSetBasis = new SpecFemBasis((BoSSS.Foundation.Grid.Classic.GridData)gridData, DGBasis.Degree + 1); MyProjection = new ContinuityProjectionSpecFem(ContinuousLevelSetBasis); break; } case ContinuityProjectionOption.ConstrainedDG: { MyProjection = new ContinuityProjectionCDG(ContBasis); break; } case ContinuityProjectionOption.None: { MyProjection = new NoProjection(); break; } default: throw new ArgumentException(); } }
/// <summary> /// Selects algorithm variant based on the <paramref name="Option"/> /// </summary> /// <param name="DGLevelSet">Discontinuous Field</param> /// <param name="gridData"></param> /// <param name="Option">Choice of algorithm</param> /// <param name="SmoothedLevelSet">The Continuous Field</param> public ContinuityProjection(SinglePhaseField DGLevelSet, Foundation.Grid.Classic.GridData gridData, ContinuityProjectionOption Option) { int k = DGLevelSet.Basis.Degree + 1; myOption = Option; switch (Option) { case ContinuityProjectionOption.SpecFEM: { var ContinuousLevelSetBasis = new SpecFemBasis(gridData, k); MyProjection = new ContinuityProjectionSpecFem(ContinuousLevelSetBasis); break; } case ContinuityProjectionOption.ContinuousDG: { var ContinuousLevelSetDGBasis = new Basis(gridData, k); MyProjection = new ContinuityProjectionCDG(ContinuousLevelSetDGBasis); break; } case ContinuityProjectionOption.None: { MyProjection = new NoProjection(); break; } default: throw new ArgumentException(); } }
/// <summary> /// Creates the LevelSet field for the Tracker based on the Option selected /// </summary> /// <param name="DGLevelSet">the unfiltered Level-set</param> /// <param name="gridData"></param> /// <param name="Option"></param> /// <returns>The filtered Level-Set Field </returns> public static LevelSet CreateField(SinglePhaseField DGLevelSet, Foundation.Grid.Classic.GridData gridData, ContinuityProjectionOption Option) { int k = DGLevelSet.Basis.Degree + 1; switch (Option) { case ContinuityProjectionOption.SpecFEM: { var ContinuousLevelSetBasis = new SpecFemBasis(gridData, k); return(new LevelSet(ContinuousLevelSetBasis.ContainingDGBasis, "Phi")); } case ContinuityProjectionOption.ConstrainedDG: { var ContinuousLevelSetDGBasis = new Basis(gridData, k); return(new LevelSet(ContinuousLevelSetDGBasis, "Phi")); } case ContinuityProjectionOption.None: { Console.WriteLine("WARNING: No additional enforcement of the level-set continuity!"); LevelSet SmoothedLevelSet = new LevelSet(DGLevelSet.Basis, "Phi"); DGLevelSet = SmoothedLevelSet; return(SmoothedLevelSet); } default: throw new ArgumentException(); } }