Beispiel #1
0
 /// <summary>
 /// adds multiple fixed rules to the quadrature scheme <paramref name="scheme"/>;
 /// this can be used to explicitly specify a quadrature rule, the choice of the order during the compilation of the scheme
 /// (see <see cref="QuadratureScheme{A,B}.Compile"/>) will have no effect.
 /// </summary>
 public static CellQuadratureScheme AddFixedRuleS <TQuadRule>(this CellQuadratureScheme scheme, IEnumerable <TQuadRule> fixedRules, CellMask[] domain = null)
     where TQuadRule : QuadRule
 {
     if (domain != null)
     {
         if (domain.Count() != fixedRules.Count())
         {
             throw new ArgumentException();
         }
     }
     for (int i = 0; i < fixedRules.Count(); i++)
     {
         scheme.AddFactoryDomainPair(new FixedRuleFactory <TQuadRule>(fixedRules.ElementAt(i)), (domain != null) ? domain[i] : null);
     }
     return(scheme);
 }
Beispiel #2
0
 /// <summary>
 /// Compilation of a cell volume scheme, even if it is null!
 /// </summary>
 public static ICompositeQuadRule <QuadRule> SaveCompile(this CellQuadratureScheme scheme, IGridData g, int order)
 {
     // sometimes, a bit of repetition seems easier ...
     scheme = (scheme ?? new CellQuadratureScheme(true));
     return(scheme.Compile(g, order));
 }
Beispiel #3
0
 /// <summary>
 /// adds a standard(Gaussian) quadrature rule to the quadrature scheme <paramref name="scheme"/>.
 /// </summary>
 public static CellQuadratureScheme AddStandardRule(this CellQuadratureScheme scheme, Grid.RefElements.RefElement s)
 {
     scheme.AddFactoryDomainPair(new StandardQuadRuleFactory(s), null);
     return(scheme);
 }
Beispiel #4
0
        /// <summary>
        /// adds rules with fixed quadrature order to the quadrature scheme <paramref name="scheme"/>;
        /// this can be used to explicitly specify the quadrature order, the choice of the order during the compilation of the scheme
        /// (see <see cref="QuadratureScheme{A,B}.Compile"/>) will have no effect.
        /// </summary>
        public static CellQuadratureScheme AddFixedOrderRules(this CellQuadratureScheme scheme, IGridData GridDat, int order)
        {
            var QRs = GridDat.iGeomCells.RefElements.Select(Kref => Kref.GetQuadratureRule(order));

            return(scheme.AddFixedRuleS <QuadRule>(QRs));
        }
Beispiel #5
0
 /// <summary>
 /// adds a factory to a cell quadrature scheme
 /// </summary>
 public static CellQuadratureScheme AddFactory <TQuadRule>(this CellQuadratureScheme scheme, IQuadRuleFactory <TQuadRule> factory)
     where TQuadRule : QuadRule
 {
     scheme.AddFactoryDomainPair(factory, default(CellMask));
     return(scheme);
 }