Пример #1
0
 /// <summary>
 /// Protected constructor with parameters
 /// </summary>
 /// <param name="parameters">Element parameters</param>
 protected Element(ElementParams parameters)
 {
     ID            = parameters.ID;
     Dim           = parameters.Dim;
     CornerNodeIDs = IntSet.FromArray(parameters.CornerNodes);
     NodeIDs       = IntSet.FromArray(parameters.Nodes);
     PropertyID    = parameters.PropertyID;
 }
Пример #2
0
 /// <summary>
 /// Protected constructor with parameters
 /// </summary>
 /// <param name="parameters">Element parameters</param>
 protected Element(ElementParams parameters)
 {
     // Initializing
     ID            = parameters.ID;
     Dim           = parameters.Dim;
     CornerNodeIDs = IntSet.FromArray(parameters.CornerNodes);
     NodeIDs       = IntSet.FromArray(parameters.Nodes);
     PropertyID    = parameters.PropertyID;
     Coords        = parameters.Coords;
 }
Пример #3
0
        /// <summary>
        /// Returns the specific creator of the element using the data contained in the passed parameters
        /// </summary>
        /// <param name="parameters">Element parameters</param>
        /// <returns>A specific instance of the element creator</returns>
        public static ElementCreator GetElementCreatorByParams(ElementParams parameters)
        {
            ElementCreator creator = null;
            var            type    = parameters.TypeName;

            // TODO: Hide the implementation of selecting a specific creator, so that the registration of a specific type occurs somewhere in a separate place
            if (type == "CQUAD4")
            {
                creator = new CQUAD4Creator(parameters);
            }
            else if (type == "CTRIA3")
            {
                creator = new CTRIA3Creator(parameters);
            }
            else
            {
                throw new ArgumentOutOfRangeException("Unknown type of element");
            }

            // TODO: Insert new type of elements

            return(creator);
        }
Пример #4
0
 /// <summary>
 /// Protected base constructor for implementing abstract parameter passing when creating a specific element class.
 /// </summary>
 /// <param name="parameters">Element parameters</param>
 protected ElementCreator(ElementParams parameters)
 {
 }