Ejemplo n.º 1
0
        /// <summary>
        /// Absolute L2 for DG fields
        /// </summary>
        public double AbsError(ConventionalDGField f)
        {
            if (GridDat.MpiSize == ReferenceMPISize)
            {
                return(0.0);
            }

            var err = f.CloneAs();

            OverwriteDGField(err);
            err.Acc(-1.0, f);

            return(err.L2Norm());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a DG field
        /// </summary>
        public ConventionalDGField LocalError(ConventionalDGField f)
        {
            if (!object.ReferenceEquals(GridDat, f.GridDat))
            {
                throw new ArgumentException("DG field is defined on different mesh");
            }

            var Error = f.CloneAs();

            Error.Clear();
            OverwriteDGField(Error);
            Error.Scale(-1);
            Error.Acc(1.0, f);

            Error.Identification = "Error-" + f.Identification;
            return(Error);
        }