Exemplo n.º 1
0
    def __repr__(self):
        """
        .. todo:: support double precision
        """
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % (self.type, self.name)
        list_fields = [
            self.type, self.name, 0, self.ifo, self.tin, self.tout, self.polar,
            None, self.ncol
        ]
        msg += print_card(list_fields)

        if self.isComplex():
            for (GCi, GCj, reali, imagi) in zip(self.GCi, self.GCj, self.Real,
                                                self.Complex):
                list_fields = [
                    self.type, self.name, GCj[0], GCj[1], None, GCi[0], GCi[1],
                    reali, imagi
                ]
                msg += print_card(list_fields)
        else:
            for (GCi, GCj, reali) in zip(self.GCi, self.GCj, self.Real):
                list_fields = [
                    self.type, self.name, GCj[0], GCj[1], None, GCi[0], GCi[1],
                    reali, None
                ]
                msg += print_card(list_fields)
        return msg
Exemplo n.º 2
0
    def write_bdf(self, size, card_writer):
        """
        .. todo:: support double precision
        """
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % (self.type, self.name)
        list_fields = [self.type, self.name, 0, self.ifo, self.tin,
                  self.tout, self.polar, None, self.ncol]
        msg += print_card(list_fields)

        if self.is_complex():
            if self.is_polar():
                for (GCi, GCj, reali, imagi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                    magi = sqrt(reali**2 + complexi**2)
                    if reali == 0.0:
                        phasei = 0.0
                    else:
                        phasei = degrees(atan2(complexi, reali))
                    list_fields = [self.type, self.name, GCj[0], GCj[1],
                              None, GCi[0], GCi[1], magi, phasei]
                    msg += print_card(list_fields)
            else:
                for (GCi, GCj, reali, imagi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                    list_fields = [self.type, self.name, GCj[0], GCj[1],
                              None, GCi[0], GCi[1], reali, imagi]
                    msg += print_card(list_fields)
        else:
            for (GCi, GCj, reali) in zip(self.GCi, self.GCj, self.Real):
                list_fields = [self.type, self.name, GCj[0], GCj[1],
                          None, GCi[0], GCi[1], reali, None]
                msg += print_card(list_fields)
        return msg
Exemplo n.º 3
0
    def write_bdf(self, size, card_writer):
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % ('DMI', self.name)
        list_fields = ['DMI', self.name, 0, self.form, self.tin,
                  self.tout, None, self.nRows, self.nCols]
        msg += print_card(list_fields)
        #msg += self.print_card(list_fields,size=16,isD=False)

        if self.is_complex():
            for (GCi, GCj, reali, imagi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                list_fields = ['DMI', self.name, GCj, GCi, reali, imagi]
                msg += print_card(list_fields)
        else:
            for (GCi, GCj, reali) in zip(self.GCi, self.GCj, self.Real):
                list_fields = ['DMI', self.name, GCj, GCi, reali]
                msg += print_card(list_fields)
        return msg
Exemplo n.º 4
0
    def write_bdf(self, size, card_writer):
        """
        .. todo:: support double precision
        """
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % (self.type, self.name)
        list_fields = [
            self.type, self.name, 0, self.ifo, self.tin, self.tout, self.polar,
            None, self.ncol
        ]
        msg += print_card(list_fields)

        if self.isComplex():
            if self.isPolar():
                for (GCi, GCj, reali, imagi) in izip(self.GCi, self.GCj,
                                                     self.Real, self.Complex):
                    magi = sqrt(reali**2 + complexi**2)
                    if reali == 0.0:
                        phasei = 0.0
                    else:
                        phasei = degrees(atan2(complexi, reali))
                    list_fields = [
                        self.type, self.name, GCj[0], GCj[1], None, GCi[0],
                        GCi[1], magi, phasei
                    ]
                    msg += print_card(list_fields)
            else:
                for (GCi, GCj, reali, imagi) in izip(self.GCi, self.GCj,
                                                     self.Real, self.Complex):
                    list_fields = [
                        self.type, self.name, GCj[0], GCj[1], None, GCi[0],
                        GCi[1], reali, imagi
                    ]
                    msg += print_card(list_fields)
        else:
            for (GCi, GCj, reali) in izip(self.GCi, self.GCj, self.Real):
                list_fields = [
                    self.type, self.name, GCj[0], GCj[1], None, GCi[0], GCi[1],
                    reali, None
                ]
                msg += print_card(list_fields)
        return msg
Exemplo n.º 5
0
    def write_bdf(self, size, card_writer):
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % ('DMI', self.name)
        list_fields = [
            'DMI', self.name, 0, self.form, self.tin, self.tout, None,
            self.nRows, self.nCols
        ]
        msg += print_card(list_fields)
        #msg += self.print_card(list_fields,size=16,isD=False)

        if self.isComplex():
            for (GCi, GCj, reali, imagi) in izip(self.GCi, self.GCj, self.Real,
                                                 self.Complex):
                list_fields = ['DMI', self.name, GCj, GCi, reali, imagi]
                msg += print_card(list_fields)
        else:
            for (GCi, GCj, reali) in izip(self.GCi, self.GCj, self.Real):
                list_fields = ['DMI', self.name, GCj, GCi, reali]
                msg += print_card(list_fields)
        return msg
Exemplo n.º 6
0
    def __repr__(self):
        """
        .. todo:: support double precision
        """
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % (self.type, self.name)
        list_fields = [self.type, self.name, 0, self.ifo, self.tin,
                  self.tout, self.polar, None, self.ncol]
        msg += print_card(list_fields)

        if self.isComplex():
            for (GCi, GCj, reali, imagi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                list_fields = [self.type, self.name, GCj[0], GCj[1],
                          None, GCi[0], GCi[1], reali, imagi]
                msg += print_card(list_fields)
        else:
            for (GCi, GCj, reali) in zip(self.GCi, self.GCj, self.Real):
                list_fields = [self.type, self.name, GCj[0], GCj[1],
                          None, GCi[0], GCi[1], reali, None]
                msg += print_card(list_fields)
        return msg