예제 #1
0
파일: Query.cs 프로젝트: xj361685640/BoSSS
        /// <summary>
        /// Computes the L2 error of field <paramref name="fieldName"/> with
        /// respect to a field with the same name stored in the time-step with
        /// <see cref="Guid"/> <paramref name="timestepGuid"/> within the
        /// current database.
        /// </summary>
        /// <param name="fieldName">
        /// The name of the field to be evaluated
        /// </param>
        /// <param name="timestepGuid">
        /// The time-step id containing the reference field
        /// </param>
        /// <returns>
        /// The error of <paramref name="fieldName"/> in the L2 norm.
        /// </returns>
        public static Query L2Error(string fieldName, Guid timestepGuid)
        {
            return(delegate(IApplication <AppControl> app, double time) {
                DGField field = app.IOFields.Single(f => f.Identification == fieldName);
                DGField referenceField = GetStoredField(app.GridData, timestepGuid, fieldName);

                return L2Error(fieldName, referenceField)(app, time);
            });
        }
예제 #2
0
파일: Query.cs 프로젝트: xj361685640/BoSSS
        /// <summary>
        /// Computes the L2 error of field <paramref name="fieldName"/> with
        /// respect to a field with the same name stored in the time-step with
        /// <see cref="TimestepNumber"/> <paramref name="timestepNumber"/> within the
        /// current database.
        /// </summary>
        /// <param name="fieldName">
        /// The name of the field to be evaluated
        /// </param>
        /// <param name="timestepNumber">
        /// The time-step containing the reference field
        /// </param>
        /// <returns>
        /// The error of <paramref name="fieldName"/> in the L2 norm.
        /// </returns>
        public static Query L2Error(string fieldName, TimestepNumber timestepNumber)
        {
            return(delegate(IApplication <AppControl> app, double time) {
                ITimestepInfo ts = app.CurrentSessionInfo.Timesteps.Single(t => t.TimeStepNumber.Equals(timestepNumber));
                DGField field = app.IOFields.Single(f => f.Identification == fieldName);
                DGField referenceField = GetStoredField(app.GridData, ts.ID, fieldName);

                return L2Error(fieldName, referenceField)(app, time);
            });
        }