예제 #1
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="noOfIntegralsPerCell"></param>
 /// <param name="context"></param>
 /// <param name="rule"></param>
 /// <param name="cs">integrate in physical or reference coordinates?</param>
 public EdgeQuadrature(int[] noOfIntegralsPerCell, IGridData context, ICompositeQuadRule <QuadRule> rule, CoordinateSystem cs = Quadrature.CoordinateSystem.Physical)
     : base(noOfIntegralsPerCell, context, rule, cs) //
 {
     foreach (IChunkRulePair <QuadRule> crp in rule)
     {
         NodeCoordinateSystem ncs = crp.Rule.Nodes.GetNodeCoordinateSystem(context);
         if (ncs != NodeCoordinateSystem.EdgeCoord)
         {
             throw new ArgumentException("Illegal node set for edge quadrature. Found some node set defined for: " + ncs.ToString() + ".");
         }
     }
 }
예제 #2
0
파일: BasisData.cs 프로젝트: xyuan/BoSSS
        /// <summary>
        /// Number of degrees-of-freedom for polynomial degree <paramref name="Degree"/>.
        /// </summary>
        /// <param name="j0"></param>
        /// <param name="Len"></param>
        /// <param name="Degree"></param>
        /// <param name="Ns"></param>
        /// <returns></returns>
        private int GetNdim(int j0, int Len, int Degree, NodeSet Ns)
        {
            int Ndim;
            NodeCoordinateSystem NsSys = Ns.GetNodeCoordinateSystem(this.m_Owner);

            switch (NsSys)
            {
            case NodeCoordinateSystem.CellCoord: {
                int iKref = this.m_Owner.iGeomEdges.GetRefElementIndex(j0);
                Ndim = this.GetOrthonormalPolynomials(Degree)[iKref].Count;
#if DEBUG
                for (int j = 0; j < Len; j++)
                {
                    int jCell = j + j0;
                    Debug.Assert(iKref == this.m_Owner.iGeomEdges.GetRefElementIndex(jCell));
                }
#endif
                break;
            }

            case NodeCoordinateSystem.EdgeCoord: {
                int iKref = this.m_Owner.iGeomCells.GetRefElementIndex(this.m_Owner.iGeomEdges.CellIndices[j0, 0]);
                Ndim = this.GetOrthonormalPolynomials(Degree)[iKref].Count;

#if DEBUG
                for (int j = 0; j < Len; j++)
                {
                    int iEdge = j + j0;


                    Debug.Assert(iKref == this.m_Owner.iGeomCells.GetRefElementIndex(this.m_Owner.iGeomEdges.CellIndices[iEdge, 0]));
                    if (this.m_Owner.iGeomEdges.CellIndices[iEdge, 1] >= 0)
                    {
                        Debug.Assert(iKref == this.m_Owner.iGeomCells.GetRefElementIndex(this.m_Owner.iGeomEdges.CellIndices[iEdge, 1]));
                    }
                }
#endif
                break;
            }

            default: throw new NotImplementedException("Todo.");
            }
            return(Ndim);
        }