Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sessionPath">Path where everything is stored</param>
        /// <param name="tsi">A time step from the database</param>
        public InflectionPointFinder(string sessionPath, ITimestepInfo tsi)
        {
            this.SessionPath = sessionPath;
            this.tsi         = tsi;

            this.gridData = (GridData)tsi.Fields.First().GridDat;

            if (tsi.Fields.Where(f => f.Identification == "rho").SingleOrDefault() is XDGField)
            {
                XDGField densityField = (XDGField)tsi.Fields.Where(f => f.Identification == "rho").SingleOrDefault();
                XDGField avField      = (XDGField)tsi.Fields.Where(f => f.Identification == "artificialViscosity").SingleOrDefault();

                this.densityField = new SinglePhaseField(new Basis(gridData, densityField.Basis.Degree), "rho");

                this.densityField.Acc(1.0, densityField.GetSpeciesShadowField("B"));
                this.levelSetField = (SinglePhaseField)tsi.Fields.Where(f => f.Identification == "levelSet").SingleOrDefault();
            }
            else
            {
                this.densityField  = (SinglePhaseField)tsi.Fields.Where(f => f.Identification == "rho").SingleOrDefault();
                this.avField       = (SinglePhaseField)tsi.Fields.Where(f => f.Identification == "artificialViscosity").SingleOrDefault();
                this.levelSetField = (SinglePhaseField)tsi.Fields.Where(f => f.Identification == "levelSet").SingleOrDefault();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sessionPath">Path where everything is stored</param>
        /// <param name="session">The session from the database</param>
        /// <param name="input">
        /// Lenghts --> [0]: numOfPoints, [1]: maxIterations + 1, [2]: 5
        /// [2]: x | y | function values | second derivatives | step sizes
        /// </param>
        /// <param name="inputExtended">
        /// Lenghts --> [0]: numOfPoints, [1]: 3
        /// [1]: IterationsNeeded | Converged | jCell
        /// </param>
        public LevelSetReconstruction(string sessionPath, ISessionInfo session, MultidimensionalArray input, MultidimensionalArray inputExtended)
        {
            this.SessionPath   = sessionPath;
            this.Session       = session;
            this.input         = input;
            this.inputExtended = inputExtended;

            ITimestepInfo myTimestep = session.Timesteps.Last();

            this.gridData = (GridData)myTimestep.Fields.First().GridDat;

            if (myTimestep.Fields.Where(f => f.Identification == "rho").SingleOrDefault() is XDGField)
            {
                XDGField densityField = (XDGField)myTimestep.Fields.Where(f => f.Identification == "rho").SingleOrDefault();
                this.densityField = new SinglePhaseField(new Basis(gridData, densityField.Basis.Degree), "rho");
                this.densityField.Acc(1.0, densityField.GetSpeciesShadowField("B"));
            }
            else
            {
                this.densityField = (SinglePhaseField)myTimestep.Fields.Where(f => f.Identification == "rho").SingleOrDefault();
            }

            this.geometryLevelSetField = (SinglePhaseField)myTimestep.Fields.Where(f => f.Identification == "levelSet").SingleOrDefault();
        }