FEMAP 2020.1 のAPIでは、以下のプログラムでFEMAPがフリーズします。
# coding: utf-8
import pythoncom
import Pyfemap
existObj = pythoncom.connect(Pyfemap.model.CLSID)
app = Pyfemap.model(existObj)
elLIST = [1, 2, 3, 4, 5, 6, 7]
pLIST0 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST1 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST2 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST3 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST4 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST5 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST6 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST7 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST8 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
setID = 10
outSet = app.feOutputSet
outSet.title = "test"
outSet.value = 0
outSet.analysis = 0
outSet.Put (setID)
RBO = app.feResults
pLIST_ALL = [pLIST0, pLIST1, pLIST2, pLIST3, pLIST4, pLIST5, pLIST6, pLIST7, pLIST8]
ttl = "Corner Pressure Face 1 Set " + str(setID)
_, nCol = RBO.AddElemWithCornerColumnsV2(setID, 24000000, 24000001, 24000002, 24000003, 24000004, 24000005, 24000006, 24000007, 24000008, ttl, 4, True)
_ = RBO.SetColumns(len(nCol), nCol, len(elLIST), elLIST, pLIST_ALL)
RBO.Save()
_ = outSet.Put(-1)
しかし、以下のプログラムなら正常に動作します。
# coding: utf-8
import pythoncom
import Pyfemap
existObj = pythoncom.connect(Pyfemap.model.CLSID)
app = Pyfemap.model(existObj)
elLIST = [1, 2, 3, 4, 5, 6, 7, 8]
pLIST0 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST1 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST2 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST3 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST4 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST5 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST6 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST7 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
pLIST8 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0]
setID = 10
outSet = app.feOutputSet
outSet.title = "test"
outSet.value = 0
outSet.analysis = 0
outSet.Put (setID)
RBO = app.feResults
pLIST_ALL = [pLIST0, pLIST1, pLIST2, pLIST3, pLIST4, pLIST5, pLIST6, pLIST7, pLIST8]
ttl = "Corner Pressure Face 1 Set " + str(setID)
_, nCol = RBO.AddElemWithCornerColumnsV2(setID, 24000000, 24000001, 24000002, 24000003, 24000004, 24000005, 24000006, 24000007, 24000008, ttl, 4, True)
_ = RBO.SetColumns(len(nCol), nCol, len(elLIST), elLIST, pLIST_ALL)
RBO.Save()
_ = outSet.Put(-1)
つまり、SetColumns メソッドは、値を設定する要素数が7以下の場合はFEMAPがフリーズし、8以上の場合は正常に動作する不適切な挙動があります。
これを回避するためには、以下のプログラムのように、SetColumn メソッドを使って、各列ごとに値を設定する必要があります。
# coding: utf-8
import pythoncom
import Pyfemap
existObj = pythoncom.connect(Pyfemap.model.CLSID)
app = Pyfemap.model(existObj)
elLIST = [1, 2, 3, 4, 5, 6, 7]
pLIST0 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST1 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST2 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST3 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST4 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST5 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST6 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST7 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
pLIST8 = [1.0,2.0,3.0,4.0,5.0,6.0,7.0]
setID = 10
outSet = app.feOutputSet
outSet.title = "test"
outSet.value = 0
outSet.analysis = 0
outSet.Put (setID)
RBO = app.feResults
pLIST_ALL = [pLIST0, pLIST1, pLIST2, pLIST3, pLIST4, pLIST5, pLIST6, pLIST7, pLIST8]
ttl = "Corner Pressure Face 1 Set " + str(setID)
_, nCol = RBO.AddElemWithCornerColumnsV2(setID, 24000000, 24000001, 24000002, 24000003, 24000004, 24000005, 24000006, 24000007, 24000008, ttl, 4, True)
_ = RBO.SetColumn(nCol[0], len(elLIST), elLIST, pLIST0)
_ = RBO.SetColumn(nCol[1], len(elLIST), elLIST, pLIST1)
_ = RBO.SetColumn(nCol[2], len(elLIST), elLIST, pLIST2)
_ = RBO.SetColumn(nCol[3], len(elLIST), elLIST, pLIST3)
_ = RBO.SetColumn(nCol[4], len(elLIST), elLIST, pLIST4)
_ = RBO.SetColumn(nCol[5], len(elLIST), elLIST, pLIST5)
_ = RBO.SetColumn(nCol[6], len(elLIST), elLIST, pLIST6)
_ = RBO.SetColumn(nCol[7], len(elLIST), elLIST, pLIST7)
_ = RBO.SetColumn(nCol[8], len(elLIST), elLIST, pLIST8)
RBO.Save()
_ = outSet.Put(-1)