Example #1
0
from abapy.postproc import FieldOutput, TensorFieldOutput, VectorFieldOutput, Identity_like

data11 = [0., 0., 1.]
data22 = [0., 0., -1]
data12 = [1., 2., 0.]
labels = range(1, len(data11) + 1)
fo11 = FieldOutput(labels=labels, data=data11, position='node')
fo22 = FieldOutput(labels=labels, data=data22, position='node')
fo12 = FieldOutput(labels=labels, data=data12, position='node')
tensor = TensorFieldOutput(data11=fo11, data22=fo22, data12=fo12)
tresca = tensor.tresca()
print(tresca)
from abapy.postproc import FieldOutput, TensorFieldOutput, VectorFieldOutput, Identity_like
data11 = [0., 0., 1.]
data22 = [0., 0., -1]
data12 = [1., 2., 0.]
labels = range(1, len(data11) + 1)
fo11 = FieldOutput(labels=labels, data=data11, position='node')
fo22 = FieldOutput(labels=labels, data=data22, position='node')
fo12 = FieldOutput(labels=labels, data=data12, position='node')
tensor = TensorFieldOutput(data11=fo11, data22=fo22, data12=fo12)
t1, t2, t3, v1, v2, v3 = tensor.eigen()
from abapy.postproc import FieldOutput, TensorFieldOutput, VectorFieldOutput, Identity_like
data11 = [0., 0., 1.]
data22 = [0., 0., -1]
data12 = [1., 2., 0.]
labels = range(1,len(data11)+1)
fo11 = FieldOutput(labels = labels, data=data11,position='node')
fo22 = FieldOutput(labels = labels, data=data22,position='node')
fo12 = FieldOutput(labels = labels, data=data12,position='node')
tensor = TensorFieldOutput(data11 = fo11, data22 = fo22, data12 = fo12 )
tresca = tensor.tresca()
tresca
Example #4
0
from abapy.postproc import FieldOutput, TensorFieldOutput, VectorFieldOutput
data11 = [1., 1., 1.]
data22 = [2., 4., -1]
data12 = [1., 2., 0.]
labels = range(1, len(data11) + 1)
fo11 = FieldOutput(labels=labels, data=data11, position='node')
fo22 = FieldOutput(labels=labels, data=data22, position='node')
fo12 = FieldOutput(labels=labels, data=data12, position='node')
tensor = TensorFieldOutput(data11=fo11, data22=fo22, data12=fo12)
tensor2 = TensorFieldOutput(data11=fo22)
tensor
print(tensor)
print(tensor[1, 2])
print(tensor * 2. + 1.)
print(tensor**2)  # Piecewise power
vector = VectorFieldOutput(data1=fo11)
print(tensor * vector)  # Matrix product
print(tensor * tensor2)  # Contracted tensor product
from abapy.postproc import FieldOutput, TensorFieldOutput, VectorFieldOutput, Identity_like
data11 = [0., 0., 1.]
data22 = [0., 0., -1]
data12 = [1., 2., 0.]
labels = range(1,len(data11)+1)
fo11 = FieldOutput(labels = labels, data=data11,position='node')
fo22 = FieldOutput(labels = labels, data=data22,position='node')
fo12 = FieldOutput(labels = labels, data=data12,position='node')
tensor = TensorFieldOutput(data11 = fo11, data22 = fo22, data12 = fo12 )
t1, t2, t3, v1, v2, v3 = tensor.eigen()
Example #6
0
from abapy.postproc import FieldOutput, TensorFieldOutput, Identity_like
data1 = [
    1,
    2,
    3,
    5,
    6,
]
data2 = [1. for i in data1]
labels = range(1, len(data1) + 1)
fo1, fo2 = FieldOutput(labels=labels, data=data1,
                       position='node'), FieldOutput(labels=labels,
                                                     data=data2,
                                                     position='node')
tensor = TensorFieldOutput(data11=fo1, data22=fo2)
identity = Identity_like(tensor)