Beispiel #1
0
    def __init__(self, eid, ul, ud, k, z, s=None, comment=''):
        """creates a GENEL card

        The required input is the {UL} list and the lower triangular
        portion of [K] or [Z].  Additional input may include the {UD}
        list and [S].  If [S] is input, must also be input.  If {UD} is
        input but [S] is omitted, [S] is internally calculated. In this
        case, {UD} must contain six and only six degrees-of freedom.
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.eid = eid
        self.ul = ul
        self.ud = ud
        if k is not None:
            self.k = np.asarray(k)
            self.z = None
        else:
            self.z = np.asarray(z)
            self.k = None

        if s is not None:
            s = np.asarray(s)
        self.s = s

        self.ul_nodes_ref = None
        self.ud_nodes_ref = None
Beispiel #2
0
 def __init__(self, lid_s0, seid, lid_se, comment=''):
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.lid_s0 = lid_s0
     self.seid = seid
     self.lid_se = lid_se
Beispiel #3
0
    def __init__(self, seid, label, comment=''):
        BaseCard.__init__(self)
        if comment:
            self.comment = comment

        self.seid = seid
        self.label = label
Beispiel #4
0
 def __init__(self,
              sid,
              eid,
              t,
              tpy,
              tpz,
              tc,
              td,
              te,
              tf,
              eids,
              comment=''):
     BaseCard.__init__(self)
     self.comment = comment
     self.sid = sid
     self.eid = eid
     self.t = t
     self.tpy = tpy
     self.tpz = tpz
     self.tc = tc
     self.td = td
     self.te = te
     self.tf = tf
     self.eids = eids
     assert len(eids) > 0, str(self)
     self.eid_ref = None
     self.eids_ref = None
Beispiel #5
0
 def __init__(self, sid, sets, comment=''):
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.sid = sid
     self.sets = expand_thru(sets)
     self.sets.sort()
Beispiel #6
0
    def __init__(self, sid, dload, wg, x0, V=None, comment=''):
        """
        Creates a GUST card, which defines a stationary vertical gust
        for use in aeroelastic response analysis.

        Parameters
        ----------
        sid : int
            gust load id
        dload : int
            TLOADx or RLOADx entry that defines the time/frequency
            dependence
        wg : float
            Scale factor (gust velocity/forward velocity) for gust
            velocity
        x0 : float
            Streamwise location in the aerodynamic coordinate system of
            the gust reference point.
        V : float; default=None
            float : velocity of the vehicle (must be the same as the
                    velocity on the AERO card)
            None : ???
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.sid = sid
        self.dload = dload
        self.wg = wg
        self.x0 = x0
        self.V = V
Beispiel #7
0
    def __init__(self, sid, factors, comment=''):
        """
        Creates an FLFACT card, which defines factors used for flutter
        analysis.  These factors define either:
         - density
         - mach
         - velocity
         - reduced frequency
        depending on the FLUTTER method chosen (e.g., PK, PKNL, PKNLS)

        Parameters
        ----------
        sid : int
            the id of a density, reduced_frequency, mach, or velocity table
            the FLUTTER card defines the meaning
        factors : varies
            values : List[float, ..., float]
                list of factors
            List[f1, THRU, fnf, nf, fmid]
                f1 : float
                    first value
                THRU : str
                    the word THRU
                fnf : float
                    second value
                nf : int
                    number of values
                fmid : float; default=(f1 + fnf) / 2.
                    the mid point to bias the array
                TODO: does f1 need be be greater than f2/fnf???
        comment : str; default=''
            a comment for the card
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.sid = sid
        #self.f1 = f1
        #self.fnf = fnf
        #self.nf = nf
        #self.fmid = fmid

        # the dumb string_types thing is because we also get floats
        if len(factors) > 1 and isinstance(factors[1], string_types) and factors[1] == 'THRU':
            #msg = 'embedded THRUs not supported yet on FLFACT card\n'
            nfactors = len(factors)
            if nfactors == 4:
                (f1, _thru, fnf, nf) = factors
                fmid = (f1 + fnf) / 2.
            elif nfactors == 5:
                (f1, _thru, fnf, nf, fmid) = factors
                #assert _thru.upper() == 'THRU', 'factors=%s' % str(factors)
            else:
                raise RuntimeError('factors must be length 4/5; factors=%s' % factors)
            i = np.linspace(0, nf, nf, endpoint=False) + 1
            factors = (
                (f1*(fnf - fmid) * (nf-i) + fnf * (fmid - f1) * (i-1)) /
                (   (fnf - fmid) * (nf-i) +       (fmid - f1) * (i-1))
            )
        self.factors = np.asarray(factors)
Beispiel #8
0
    def __init__(self, seid, nodes_seid, nodes0, comment=''):
        """
        Creates an SELOC card, which transforms the superelement SEID
        from PA to PB.  Basically, define two CORD1Rs.

        Parameters
        ----------
        seid : int
            the superelement to transform
        nodes_seid : List[int, int, int]
            the nodes in the superelement than define the resulting coordinate system
        nodes0 : List[int, int, int]
            the nodes in the superelement than define the starting coordinate system
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment

        self.seid = seid
        #:  Identifiers of grids points. (Integer > 0)
        self.nodes_0 = expand_thru(nodes0, set_fields=False, sort_fields=False)
        self.nodes_seid = expand_thru(nodes_seid,
                                      set_fields=False,
                                      sort_fields=False)
        self.nodes_0_ref = None
        self.nodes_seid_ref = None
Beispiel #9
0
    def __init__(self, seid_a, seid_b, tol, loc, nodes_a, nodes_b, comment=''):
        """
        Parameters
        ----------
        SEIDA : int
            Partitioned superelement identification number.
        SEIDB : int
            Identification number of superelement for connection to SEIDA.
        TOL : float; default=1e-5
            Location tolerance to be used when searching for or checking boundary
            grid points.
        LOC : str; default='YES'
            Coincident location check option for manual connection.
            {YES, NO}
        GIDAi : int
            Identification number of a grid or scalar point in superelement SEIDA,
            which will be connected to GIDBi.
        GIDBi : int
            Identification number of a grid or scalar point in superelement SEIDB,
            which will be connected to GIDAi.

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.seid_a = seid_a
        self.seid_b = seid_b
        self.tol = tol
        self.loc = loc
        self.nodes_a = nodes_a
        self.nodes_b = nodes_b
        self.nodes_a_ref = None
        self.nodes_b_ref = None
Beispiel #10
0
    def __init__(self,
                 sid: int,
                 nroots: int,
                 machs: List[float],
                 comment: str = ''):
        """
        Creates an DIVERG card, which is used in divergence
        analysis (SOL 144).

        Parameters
        ----------
        sid : int
            The name
        nroots : int
            the number of roots
        machs : List[float, ..., float]
            list of Mach numbers
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.sid = sid
        self.nroots = nroots
        self.machs = machs
Beispiel #11
0
    def __init__(self, sid, ring_id, hid, scale, f_rtz, comment=''):
        """
        Creates a PLOADX1 card, which defines surface traction for
        axisymmetric elements.

        Parameters
        ----------
        sid: int
            Load set identification number.
        ring_id : int
            RINGAX entry identification number.
        hid: int
            Harmonic identification number or a sequence of harmonics.
        scale : float
            Scale factor for the force.
        f_rtz
            Force components in r, φ, z directions.
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.sid = sid
        self.ring_id = ring_id
        self.hid = hid
        self.scale = scale
        self.f_rtz = np.asarray(f_rtz)
        self.ring_id_ref = None
Beispiel #12
0
 def __init__(self, seid, p1, p2, p3, comment=''):
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.seid = seid
     self.nodes = [p1, p2, p3]
     self.nodes_ref = None
Beispiel #13
0
 def __init__(self, seid, superelements, comment=''):
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.seid = seid
     #:  Identifiers of grids points. (Integer > 0)
     self.superelements = expand_thru(superelements)
     self.superelements_ref = None
Beispiel #14
0
 def __init__(self, sid, eid, tbar, tprime, t_stress, comment=''):
     BaseCard.__init__(self)
     self.comment = comment
     self.sid = sid
     self.eid = eid
     self.tbar = tbar
     self.tprime = tprime
     self.t_stress = t_stress
Beispiel #15
0
 def __init__(self, side, coord, nids, comment=''):
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.side = side
     self.coord = coord
     self.nids = expand_thru(nids)
     assert coord in ['T1', 'T2', 'T3', 'R', 'C', 'S'], coord
Beispiel #16
0
    def __init__(self,
                 icavity,
                 gitb=4,
                 gips=4,
                 cier=4,
                 error_tol=0.1,
                 zero_tol=1e-10,
                 warp_tol=0.01,
                 rad_check=3,
                 comment=''):
        """
        Creates a VIEW3D, which defines a 3D view factor

        Parameters
        ----------
        icavity : int
            Radiant cavity identification number on RADCAV entry. (Integer > 0)
        gitb : int; default=4
            Gaussian integration order to be implemented in calculating net
            effective view factors in the presence of third-body shadowing.
            (Integer 2, 3, 4, 5, 6 or 10)
        gips : int; default=4
            Gaussian integration order to be implemented in calculating net
            effective view factors in the presence of self-shadowing.
            (Integer 2, 3, 4, 5, 6 or 10)
        cier : int; default=4
            Discretization level used in the semi-analytic contour integration
            method. (1 < Integer < 20)
        error_tol : float; default=0.1
            Error estimate above which a corrected view factor is calculated
            using the semi-analytic contour integration method. (Real > 0.0)
        zero_tol : float; default=1e-10
            Assumed level of calculation below which the numbers are considered
            to be zero. (Real > 0.0)
        warp_tol : float; default=0.01
            Assumed degree of warpage above which the actual value of will be
            calculated. (0.0 < Real < 1.0)
        rad_check : int; default=3
             Type of diagnostic output desired for the radiation exchange surfaces.
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment

        #: Material identification number
        self.icavity = icavity
        self.gitb = gitb
        self.gips = gips
        self.cier = cier
        self.error_tol = error_tol
        self.zero_tol = zero_tol
        self.warp_tol = warp_tol
        self.rad_check = rad_check
Beispiel #17
0
    def __init__(self, seid, comp, nids, comment=''):
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.seid = seid
        self.comp = comp

        #:  Identifiers of grids points. (Integer > 0)
        self.nids = expand_thru(nids)
        self.nids_ref = None
Beispiel #18
0
    def __init__(self, seid, psid, nodes, comment=''):
        BaseCard.__init__(self)
        if comment:
            self.comment = comment

        self.seid = seid
        self.psid = psid
        #:  Identifiers of grids points. (Integer > 0)
        self.nodes = expand_thru(nodes)
        self.nodes_ref = None
Beispiel #19
0
    def __init__(self, seid_a, seid_b, ids, comment=''):
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.seid_a = seid_a
        self.seid_b = seid_b

        #:  Identifiers of grids points. (Integer > 0)
        self.ids = expand_thru(ids)
        self.ids_ref = None
Beispiel #20
0
 def __init__(self, eid, nodes, comment=''):
     """
     Defines a 1D dummy element used for plotting.
     +--------+-----+-----+-----+
     |   1    |  2  |  3  |  4  |
     +========+=====+=====+=====+
     | PLOTEL | EID | G1  | G2  |
     +--------+-----+-----+-----+
     """
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.eid = eid
     self.nodes = nodes
Beispiel #21
0
 def __init__(self, set_id, n, comment=''):
     """
     Parameters
     ----------
     set_id : int / str
         Partitioned superelement identification number.
         (Integer > 0 or Character='ALL')
     n : int; default=0
         Number of internally generated scalar points for dynamic
         reduction generalized coordinates (Integer > 0).
     """
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.set_id = set_id
     self.n = n
Beispiel #22
0
    def __init__(self, eid, nodes, comment=''):
        """
        Adds a PLOTEL card

        Parameters
        ----------
        eid : int
            Element ID
        nodes : List[int, int]
            Unique GRID point IDs
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.eid = eid
        self.nodes = nodes
Beispiel #23
0
    def __init__(self, aestat_id, label, comment=''):
        """
        Creates an AESTAT card, which is a variable to be used in a TRIM analysis

        Parameters
        ----------
        id : int
            unique id
        label : str
            name for the id
        comment : str; default=''
            a comment for the card
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.aestat_id = aestat_id
        self.label = label
Beispiel #24
0
    def __init__(self, sid, temperature, comment=''):
        """
        Creates a TEMPD card

        Parameters
        ----------
        sid : int
            Load set identification number. (Integer > 0)
        temperature : float
            default temperature
        comment : str; default=''
            a comment for the card
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.sid = sid
        self.temperature = temperature
Beispiel #25
0
    def __init__(self, sid, mach, q, labels, uxs, aeqr=1.0, comment=''):
        """
        Creates a TRIM card for a static aero (144) analysis.

        Parameters
        ----------
        sid : int
            the trim id; referenced by the Case Control TRIM field
        mach : float
            the mach number
        q : float
            dynamic pressure
        labels : List[str]
            names of the fixed variables
        uxs : List[float]
            values corresponding to labels
        aeqr : float
            0.0 : rigid trim analysis
            1.0 : elastic trim analysis (default)
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        #: Trim set identification number. (Integer > 0)
        self.sid = sid
        #: Mach number. (Real > 0.0 and != 1.0)
        self.mach = mach
        #: Dynamic pressure. (Real > 0.0)
        self.q = q

        #: The label identifying aerodynamic trim variables defined on an
        #: AESTAT or AESURF entry.
        self.labels = labels

        #: The magnitude of the aerodynamic extra point degree-of-freedom.
        #: (Real)
        self.uxs = uxs

        #: Flag to request a rigid trim analysis (Real > 0.0 and < 1.0;
        #: Default = 1.0. A value of 0.0 provides a rigid trim analysis.
        self.aeqr = aeqr
Beispiel #26
0
    def __init__(self):
        """
        Common class for AERO, AEROS

        Attributes
        ----------
        acsid : int; default=0
            aerodyanmic coordinate system
            defines the direction of the wind
        sym_xz : int; default=0
            xz symmetry flag (+1=symmetry; -1=antisymmetric)
        sym_xy : int; default=0
            xy symmetry flag (+1=symmetry; -1=antisymmetric)
        """
        BaseCard.__init__(self)
        self.sym_xy = None
        self.sym_xz = None
        self.acsid = None
        self.acsid_ref = None
Beispiel #27
0
    def __init__(self, machs, reduced_freqs, comment=''):
        """
        Creates an MKAERO1 card, which defines a set of mach and
        reduced frequencies.

        Parameters
        ----------
        machs : List[float]
            series of Mach numbers
        reduced_freqs : List[float]
            series of reduced frequencies
        comment : str; default=''
            a comment for the card
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.machs = np.unique(machs)
        self.reduced_freqs = np.unique(reduced_freqs)
Beispiel #28
0
    def __init__(self, sid, sets, comment=''):
        """
        Creates an NSMADD card, which sum NSM sets

        Parameters
        ----------
        sid : int
            the NSM Case Control value
        sets : List[int]
            the NSM, NSM1, NSML, NSML1 values
        comment : str; default=''
            a comment for the card
        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.sid = sid
        self.sets = expand_thru(sets)
        self.sets.sort()
Beispiel #29
0
    def __init__(self,
                 iview,
                 icavity,
                 shade='BOTH',
                 nbeta=1,
                 ngamma=1,
                 dislin=0.0,
                 comment=''):
        """
        Creates a VIEW, which defines a 2D view factor

        Parameters
        ----------
        iview : int
            Identification number
        icavity : int
            Cavity identification number for grouping the radiant exchange faces of
            CHBDYi elements
        shade : str; default='BOTH'
            Shadowing flag for the face of CHBDYi element
            - NONE means the face can neither shade nor be shaded by other faces
            - KSHD means the face can shade other faces
            - KBSHD means the face can be shaded by other faces
            - BOTH means the face can both shade and be shaded by other faces
        nbeta / ngamma : int; default=1 / 1
            Subelement mesh size in the beta/gamma direction. (Integer > 0)
        dislin : float; default=0.0
            The displacement of a surface perpendicular to the surface
        comment : str; default=''
            a comment for the card

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment

        #: Material identification number
        self.iview = iview
        self.icavity = icavity
        self.shade = shade
        self.nbeta = nbeta
        self.ngamma = ngamma
        self.dislin = dislin
Beispiel #30
0
    def __init__(self,
                 seid,
                 superelement_type,
                 rseid,
                 method='AUTO',
                 tol=1e-5,
                 loc='YES',
                 unitno=None,
                 comment=''):
        """
        Parameters
        ----------
        seid : int
            Partitioned superelement identification number.
        Type : str
            Superelement type.
            {PRIMARY, REPEAT, MIRROR, COLLCTR, EXTERNAL, EXTOP2}
        rseid : int; default=0
            Identification number of the reference superelement,
            used if TYPE = 'REPEAT' and 'MIRROR'.
        method : str; default='AUTO'
            Method to be used when searching for boundary grid points.
            {AUTO, MANUAL}
        tol : float; default=1e-5
            Location tolerance to be used when searching for boundary grid points.
        loc : str; default='YES'
            Coincident location check option for manual conection option.
            {YES, NO}
        unitno : int / None
            FORTRAN unit number for the OUTPUT2 file (applicable and
            meaningful only when TYPE='EXTOP2').

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.seid = seid
        self.superelement_type = superelement_type
        self.rseid = rseid
        self.method = method
        self.tol = tol
        self.loc = loc
        self.unitno = unitno
Beispiel #31
0
    def __init__(self, friction_id: int, mu1: float, fstiff=None, comment=''):
        """
        Creates a BFRIC card, which defines a frictional contact.

        Parameters
        ----------
        friction_id : int
            Friction identification number.
        mu1 : float
            Coefficient of static friction.
        fstiff : float; default=None
            Frictional stiffness in stick. See Remarks 2 and 3
            Default=automatically selected by the program.

        """
        BaseCard.__init__(self)
        if comment:
            self.comment = comment
        self.friction_id = friction_id
        self.fstiff = fstiff
        self.mu1 = mu1
Beispiel #32
0
 def __init__(self, sid, temperature, comment=''):
     BaseCard.__init__(self)
     if comment:
         self.comment = comment
     self.sid = sid
     self.temperature = temperature