Exemplo n.º 1
0
    def __init__(self,coords,elems):
        """Create new model data.

        coords is an array with nodal coordinates
        elems is either a single element connectivity array, or a list of such.
        In a simple case, coords and elems can be the arrays obtained by 
        ``coords, elems = F.feModel()``.
        This is however limited to a model where all elements have the same
        number of nodes. Then you can use the list of elems arrays. The 'fe'
        plugin has a helper function to create this list. E.g., if ``FL`` is a
        list of Formices (possibly with different plexitude), then
        ``fe.mergeModels([Fi.feModel() for Fi in FL])``
        will return the (coords,elems) tuple to create the Model.

        The model can have node and element property numbers.
        """
        Dict.__init__(self)
        if not type(elems) == list:
            elems = [ elems ]
        self.coords = Coords(coords)
        self.elems = [ Connectivity(e) for e in elems ]
        nelems = [ e.nelems() for e in self.elems ]
        nplex = [ e.nplex() for e in self.elems ]
        self.celems = cumsum([0]+nelems)
        GD.message("Number of nodes: %s" % self.coords.shape[0])
        GD.message("Number of elements: %s" % self.celems[-1])
        GD.message("Number of element groups: %s" % len(nelems))
        GD.message("Number of elements per group: %s" % nelems)
        GD.message("Plexitude of each group: %s" % nplex)
Exemplo n.º 2
0
    def __init__(self,kind=None,keys=None,set=None,
                 type='FIELD',variable='PRESELECT'):
        """ Create new output request.
        
        kind = None, 'NODE', or 'ELEMENT' (first character suffices)

        For kind=='':

          type =  'FIELD' or 'HISTORY'
          variable = 'ALL' or 'PRESELECT'

        For kind=='NODE' or 'ELEMENT':

          keys is a list of output identifiers (compatible with kind type)
        
          set is single item or a list of items, where each item is either:
            - a property number
            - a node/elem set name
            for which the results should be written
          If no set is specified, the default is 'Nall' for kind=='NODE'
          and 'Eall' for kind='ELEMENT'
        """
        if kind:
            kind = kind[0].upper()
        if set is None:
            set = "%sall" % kind
        Dict.__init__(self,{'kind':kind})
        if kind is not None:
            self.update({'keys':keys,'set':set})
        else:
            self.update({'type':type,'variable':variable})
Exemplo n.º 3
0
    def __init__(self,kind,keys,set=None,output='FILE',freq=1,time=False,
                 **kargs):
        """Create new result request.
        
        kind = 'NODE' or 'ELEMENT' (actually, the first character suffices)

        keys is a list of output identifiers (compatible with kind type)
        
        set is single item or a list of items, where each item is either:
          - a property number
          - a node/elem set name
          for which the results should be written
        If no set is specified, the default is 'Nall' for kind=='NODE'
        and 'Eall' for kind='ELEMENT'
        
        output is either 'FILE' (.fil) or 'PRINT' (.dat)(Standard only)
        freq is the output frequency in increments (0 = no output)

        Extra keyword arguments are available: see the writeNodeResults and
        writeElemResults functions for details.
        """
        kind = kind[0].upper()
        if set is None:
            set = "%sall" % kind
        Dict.__init__(self,{'keys':keys,'kind':kind,'set':set,'output':output,
                            'freq':freq})
        self.update(dict(**kargs))
Exemplo n.º 4
0
    def __init__(self,kind=None,keys=None,set=None,type='FIELD',variable='PRESELECT',extra='',**options):
        """ Create new output request.

        - `type`: 'FIELD' or 'HISTORY'
        - `kind`: None, 'NODE', or 'ELEMENT' (first character suffices)
        - `extra`: an extra string to be added to the command line. This
          allows to add Abaqus options not handled by this constructor.
          The string will be appended to the command line preceded by a comma.

        For kind=='':

          - `variable`: 'ALL', 'PRESELECT' or ''
          
        For kind=='NODE' or 'ELEMENT':

          - `keys`: a list of output identifiers (compatible with kind type)
          - `set`: a single item or a list of items, where each item is either
            a property number or a node/element set name for which the results
            should be written. If no set is specified, the default is 'Nall'
            for kind=='NODE' and 'Eall' for kind='ELEMENT'
        """
        if 'history' in options:
            GD.warning("The `history` argument in an output request is deprecated.\nPlease use `type='history'` instead.")
        if 'numberinterval' in options:
            GD.warning("The `numberinterval` argument in an output request is deprecated.\nPlease use the `extra` argument instead.")

        if kind:
            kind = kind[0].upper()
        if set is None:
            set = "%sall" % kind
        Dict.__init__(self,{'kind':kind})
        if kind is None:
            self.update({'type':type,'variable':variable,'extra':extra})
        else:
            self.update({'keys':keys,'set':set})
Exemplo n.º 5
0
 def __init__(self,mat='',sec=''):
     """Create a new properties database."""
     setMaterialDB(mat)
     setSectionDB(sec)
     Dict.__init__(self)
     self.prop = []
     self.nprop = []
     self.eprop = []
Exemplo n.º 6
0
 def __init__(self, mat='', sec=''):
     """Create a new properties database."""
     setMaterialDB(mat)
     setSectionDB(sec)
     Dict.__init__(self)
     self.prop = []
     self.nprop = []
     self.eprop = []
Exemplo n.º 7
0
 def __init__(self,label=None,value=None):
     """Create a new element load. Empty by default.
     
     An element load can hold the following sub-properties:
     - label: the distributed load type label.
     - value: the magnitude of the distibuted load.
     """          
     Dict.__init__(self,{'label':label,'value':value})
Exemplo n.º 8
0
 def __init__(self):
     """Create a new properties database."""
     Dict.__init__(self)
     self.mats = MaterialDB()
     self.sect = SectionDB()
     self.prop = []
     self.nprop = []
     self.eprop = []
Exemplo n.º 9
0
 def __init__(self, edge=-1, label=None, value=None):
     """Create a new element edge load. Empty by default.
     
     An element edgeload can hold the following sub-properties:
     - edge: the element edge number
     - label: the distributed load type label ('x','y','z').
     - value: the magnitude of the distibuted load.
     """
     Dict.__init__(self, {'edge': edge, 'label': label, 'value': value})
Exemplo n.º 10
0
 def __init__(self,edge=-1,label=None,value=None):
     """Create a new element edge load. Empty by default.
     
     An element edgeload can hold the following sub-properties:
     - edge: the element edge number
     - label: the distributed load type label ('x','y','z').
     - value: the magnitude of the distibuted load.
     """          
     Dict.__init__(self,{'edge':edge,'label':label,'value':value})
Exemplo n.º 11
0
    def __init__(self, data={}, default=None):
        """Creates a new Config instance.

        The configuration can be initialized with a dictionary, or
        with a variable that can be passed to the read() function.
        The latter includes the name of a config file, or a multiline string
        holding the contents of a configuration file.
        """
        Dict.__init__(self, default=default)
        if isinstance(data, dict):
            self.update(data)
        elif data:
            self.read(data)
Exemplo n.º 12
0
    def __init__(self,data={},default=None):
        """Creates a new Config instance.

        The configuration can be initialized with a dictionary, or
        with a variable that can be passed to the read() function.
        The latter includes the name of a config file, or a multiline string
        holding the contents of a configuration file.
        """
        Dict.__init__(self,default=default)
        if isinstance(data,dict):
            self.update(data)
        elif data:
            self.read(data)
Exemplo n.º 13
0
    def __init__(self,label=None,value=None,dir=None):
        """Create a new element load. Empty by default.
        
        An element load can hold the following sub-properties:

        - label: the distributed load type label
        - value: the magnitude of the distibuted load
        - dir: vector specifying the direction of the load
        """
        if label == 'GRAV':
            if dir is None:
                dir = [0, 0 ,-1]
            if value is None:
                value = 9.81
        Dict.__init__(self,{'label':label,'value':value,'dir':dir})
Exemplo n.º 14
0
    def __init__(self, label=None, value=None, dir=None):
        """Create a new element load. Empty by default.
        
        An element load can hold the following sub-properties:

        - label: the distributed load type label
        - value: the magnitude of the distibuted load
        - dir: vector specifying the direction of the load
        """
        if label == 'GRAV':
            if dir is None:
                dir = [0, 0, -1]
            if value is None:
                value = 9.81
        Dict.__init__(self, {'label': label, 'value': value, 'dir': dir})
Exemplo n.º 15
0
    def __init__(self,kind,keys,set=None,output='FILE',freq=1,time=False,
                 **kargs):
        """Create new result request.
        
        - `kind`: 'NODE' or 'ELEMENT' (first character suffices)
        - `keys`: a list of output identifiers (compatible with kind type)
        - `set`: a single item or a list of items, where each item is either
           a property number or a node/element set name for which the results
           should be written. If no set is specified, the default is 'Nall'
           for kind=='NODE' and 'Eall' for kind='ELEMENT'
        - `output` is either ``FILE`` (for .fil output) or ``PRINT`` (for .dat
          output)(Abaqus/Standard only)
        - `freq` is the output frequency in increments (0 = no output)

        Extra keyword arguments are available: see the `writeNodeResults` and
        `writeElemResults` methods for details.
        """
        kind = kind[0].upper()
        if set is None:
            set = "%sall" % kind
        Dict.__init__(self,{'keys':keys,'kind':kind,'set':set,'output':output,
                            'freq':freq})
        self.update(dict(**kargs))
Exemplo n.º 16
0
 def __init__(self,**kargs):
     """Create a new set of CanvasSettings."""
     Dict.__init__(self)
     self.reset(kargs)
Exemplo n.º 17
0
 def __init__(self,**kargs):
     """Create a new set of CanvasSettings, possibly changing defaults."""
     Dict.__init__(self)
     self.reset(kargs)
Exemplo n.º 18
0
    def __init__(self,data={}):
        """Initialize a database.

        The database can be initialized with a dict.
        """
        Dict.__init__(self,data)
Exemplo n.º 19
0
 def __init__(self, **kargs):
     """Create a new set of CanvasSettings."""
     Dict.__init__(self)
     self.reset(kargs)
Exemplo n.º 20
0
    def __init__(self, data={}):
        """Initialize a database.

        The database can be initialized with a dict.
        """
        Dict.__init__(self, data)