Example #1
0
        /// <summary>
        /// Add elements classified on the entity of dimension `dim' and tag `tag'.
        /// `types' contains the MSH types of the elements (e.g. `2' for 3-node
        /// triangles: see the Gmsh reference manual). `elementTags' is a vector of
        /// the same length as `types'; each entry is a vector containing the tags
        /// (unique, strictly positive identifiers) of the elements of the
        /// corresponding type. `nodeTags' is also a vector of the same length as
        /// `types'; each entry is a vector of length equal to the number of elements
        /// of the given type times the number N of nodes per element, that contains
        /// the node tags of all the elements of the given type, concatenated: [e1n1,
        /// e1n2, ..., e1nN, e2n1, ...].
        /// </summary>
        //public void AddElements(int dim, int tag, ElementTypes[] elementTypes, long[][] elementTags, long[][] nodeTags)
        //{
        //    GMshNativeMethods.gmshModelMeshAddNodes(dim, tag, nodeTags, nodeTags.Length.ToUint(), coord, coord.Length.ToUint(), parametricCoord, parametricCoord.Length.ToUint(), ref ierr);
        //}

        public void AddElementsByType(ElementTypes elementType, long[] elementTags, long[] nodeTags, int tag = -1)
        {
            GMshNativeMethods.gmshModelMeshAddElementsByType(tag, (int)elementType, elementTags, elementTags.Length.ToUint(), nodeTags, nodeTags.Length.ToUint(), ref ierr);
            if (ierr != 0)
            {
                throw new GMshException(ierr);
            }
        }