Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDoyle2 committed Jan 15, 2025
2 parents c0c0801 + 24c04b4 commit 7ae527d
Show file tree
Hide file tree
Showing 17 changed files with 429 additions and 54 deletions.
10 changes: 10 additions & 0 deletions dev/pyNastranGUI.spec
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,18 @@ vtk_imports_all = [ # 9.3
'vtkmodules.vtkRenderingVolume', 'vtkmodules.vtkRenderingVolumeAMR', 'vtkmodules.vtkRenderingVolumeOpenGL2',
'vtkmodules.vtkRenderingVtkJS', 'vtkmodules.vtkTestingRendering', 'vtkmodules.vtkViewsContext2D',
'vtkmodules.vtkViewsCore', 'vtkmodules.vtkViewsInfovis', 'vtkmodules.vtkWebCore', 'vtkmodules.vtkWebGLExporter',
# tested - 9.4.1
# Unable to find a valid OpenGL 3.2 or later implementation
'vtkmodules.util.data_model', 'vtkmodules.util.execution_model',
]

import vtk
vtk_version_str = vtk.VTK_VERSION
print(f'vtk_version_str = {vtk.VTK_VERSION!r}') # '9.3.1'

if vtk_version_str >= '9.4.0':
raise RuntimeError('use vtk<9.4')

# can we get rid of scipy.optimize?
hiddenimports = [
#'vtk', 'vtk.vtkCommonPythonSIP', 'vtk.vtkFilteringPythonSIP',
Expand Down
6 changes: 3 additions & 3 deletions pyNastran/bdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'CBUSH', 'CBUSH1D', 'CBUSH2D',
# dampers
'CDAMP1', 'CDAMP2', 'CDAMP3', 'CDAMP4', 'CDAMP5',
'CFAST',
'CFAST', 'CWELD',

'CBAR', 'CBARAO', 'BAROR',
'CROD', 'CTUBE', 'CBEAM', 'CBEAM3', 'CONROD', 'CBEND', 'BEAMOR',
Expand All @@ -78,7 +78,7 @@

## properties
'PMASS',
'PELAS', 'PGAP', 'PFAST', 'PLPLANE', 'PPLANE',
'PELAS', 'PGAP', 'PFAST', 'PWELD', 'PLPLANE', 'PPLANE',
'PBUSH', 'PBUSH1D',
'PDAMP', 'PDAMP5',
'PROD', 'PBAR', 'PBARL', 'PBEAM', 'PTUBE', 'PBCOMP', 'PBRSECT', 'PBEND',
Expand Down Expand Up @@ -312,7 +312,7 @@

## ???
'ACMODL', 'PANEL', 'SWLDPRM',
'CWELD', 'PWELD', 'PWSEAM', 'CWSEAM', 'CSEAM', 'PSEAM', 'DVSHAP', 'BNDGRID',
'PWSEAM', 'CWSEAM', 'CSEAM', 'PSEAM', 'DVSHAP', 'BNDGRID',
'MODTRAK', 'DSCONS', 'DVAR', 'DVSET', 'DYNRED',
'BNDFIX', 'BNDFIX1',
'AEFORCE', 'UXVEC', 'GUST2',
Expand Down
23 changes: 11 additions & 12 deletions pyNastran/bdf/bdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@

from pyNastran.bdf.bdf_interface.model_group import ModelGroup
from .cards.elements.elements import (
CFAST, CGAP, CRAC2D, CRAC3D, GENEL,
CFAST, CWELD, CGAP, CRAC2D, CRAC3D, GENEL,
PLOTEL, PLOTEL3, PLOTEL4, PLOTELs)
from .cards.properties.properties import PFAST, PGAP, PRAC2D, PRAC3D
from .cards.properties.properties import PFAST, PWELD, PGAP, PRAC2D, PRAC3D
from .cards.properties.solid import PLSOLID, PSOLID, PIHEX, PCOMPS, PCOMPLS
from .cards.cyclic import CYAX, CYJOIN
from .cards.msgmesh import CGEN
Expand Down Expand Up @@ -218,7 +218,7 @@

Element = (
SpringElement | DamperElement |
CVISC | CBUSH | CBUSH1D | CBUSH2D | CFAST | #CWELD
CVISC | CBUSH | CBUSH1D | CBUSH2D | CFAST | CWELD |
CGAP | GENEL | CCONEAX |
CROD | CTUBE | CONROD |
CBAR | CBEAM | CBEAM3 | CBEND | CSHEAR |
Expand Down Expand Up @@ -246,7 +246,7 @@
PSHEAR | PPLANE |
PSHELL | PCOMP | PCOMPG |
PSOLID | PLSOLID | PIHEX | PCOMPS | PCOMPLS |
PTRSHL #| PWELD
PTRSHL | PWELD
)
Material = (
MAT1 | MAT2 | MAT3 | MAT8 | MAT9 | MAT10 | MAT11 |
Expand Down Expand Up @@ -403,7 +403,6 @@
'CSPOT', 'CFILLET',
'CBUTT',
'PCOHE',
'CWELD', 'PWELD',

## rigid_elements
'RSPINT', 'RSPINR', 'RBE2GS',
Expand Down Expand Up @@ -622,7 +621,7 @@ def __init__(self, debug: str | bool | None=True,
# False: use strict parser (default)
self.is_strict_card_parser = True

# set of result types that overwrites work on
# set of card types that overwrites work on
self.allow_overwrites_set: set[str] = set([])

# lines that were rejected b/c they were for a card that isn't supported
Expand Down Expand Up @@ -668,7 +667,8 @@ def __init__(self, debug: str | bool | None=True,
'CBUSH', 'CBUSH1D', 'CBUSH2D',
# dampers
'CDAMP1', 'CDAMP2', 'CDAMP3', 'CDAMP4', 'CDAMP5',
'CFAST',
# fasteners
'CFAST', 'CWELD',

'CBAR', 'CBARAO', 'BAROR',
'CROD', 'CTUBE', 'CBEAM', 'CBEAM3', 'CONROD', 'CBEND', 'BEAMOR',
Expand Down Expand Up @@ -699,7 +699,7 @@ def __init__(self, debug: str | bool | None=True,

## properties
'PMASS',
'PELAS', 'PGAP', 'PFAST', 'PLPLANE', 'PPLANE',
'PELAS', 'PGAP', 'PFAST', 'PWELD', 'PLPLANE', 'PPLANE',
'PBUSH', 'PBUSH1D', 'PBUSH2D',
'PDAMP', 'PDAMP5',
'PROD', 'PBAR', 'PBARL', 'PBEAM', 'PTUBE', 'PBCOMP', 'PBRSECT', 'PBEND',
Expand Down Expand Up @@ -951,7 +951,6 @@ def __init__(self, debug: str | bool | None=True,
'CONVM',
## ???
#'PANEL', 'SWLDPRM',
#'CWELD', 'PWELD',
# 'PWSEAM', 'CWSEAM', 'CSEAM', 'PSEAM', 'DVSHAP',
#'CYSYM', 'CYJOIN', 'MODTRAK', 'DSCONS', 'DVAR', 'DVSET', 'DYNRED',
#'AEFORCE', 'UXVEC', 'GUST2',
Expand Down Expand Up @@ -2217,9 +2216,6 @@ def add_card(cls, card: BDFCard, comment: str=''):
'ROTORB' : (Crash, None),

#'SWLDPRM' : (Crash, None),

#'CWELD' : (Crash, None),
#'PWELD' : (Crash, None),
#'PWSEAM' : (Crash, None),
#'CWSEAM' : (Crash, None),
#'CSEAM' : (Crash, None),
Expand Down Expand Up @@ -2366,6 +2362,9 @@ def add_card(cls, card: BDFCard, comment: str=''):
'CFAST' : (CFAST, add_methods._add_damper_object),
'PFAST' : (PFAST, add_methods._add_property_object),

'CWELD' : (CWELD, add_methods._add_damper_object),
'PWELD' : (PWELD, add_methods._add_property_object),

'CGAP' : (CGAP, add_methods._add_element_object),
'PGAP' : (PGAP, add_methods._add_property_object),

Expand Down
28 changes: 26 additions & 2 deletions pyNastran/bdf/bdf_interface/add_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from pyNastran.bdf.cards.bolt import BOLT, BOLTSEQ, BOLTFOR, BOLTLD, BOLTFRC
from pyNastran.bdf.cards.elements.elements import (
CFAST, CGAP, CRAC2D, CRAC3D, PLOTEL, PLOTEL3, PLOTEL4, GENEL)
from pyNastran.bdf.cards.properties.properties import PFAST, PGAP, PRAC2D, PRAC3D
CFAST, CWELD, CGAP, CRAC2D, CRAC3D, PLOTEL, PLOTEL3, PLOTEL4, GENEL)
from pyNastran.bdf.cards.properties.properties import PFAST, PWELD, PGAP, PRAC2D, PRAC3D
from pyNastran.bdf.cards.properties.solid import PLSOLID, PSOLID, PIHEX, PCOMPS, PCOMPLS
from pyNastran.bdf.cards.cyclic import CYAX, CYJOIN
#from pyNastran.bdf.cards.msgmesh import CGEN, GMCORD, GMLOAD
Expand Down Expand Up @@ -375,6 +375,9 @@
'CFAST' : CFAST,
'PFAST' : PFAST,

'CWELD' : CWELD,
'PWELD' : PWELD,

'CGAP' : CGAP,
'PGAP' : PGAP,

Expand Down Expand Up @@ -1566,6 +1569,23 @@ def add_pfast(self, pid: int, d: int,
self._add_methods._add_property_object(prop)
return prop

def add_cweld(self, eid: int, pid: int, gs: int, elemid:str, ga:int, gb:int, mcid:int, shida: int, shidb: int, x: list[float]=None, comment: str='') -> CWELD:
"""
Creates a CWELD card
"""
elem = CWELD(eid, pid, gs, elemid, ga, gb, mcid, shida, shidb, x, comment=comment)
self._add_methods._add_element_object(elem)
return elem

def add_pweld(self, pid: int, mid: int, d: float, mset: str=None, connect_type:str=None, ldmin: float=None, ldmax: float=None, comment: str='') -> PWELD:
"""
Creates a PWELD card
"""
prop = PWELD(pid, mid, mid, d, mset, connect_type, ldmin, ldmax, comment=comment)
self._add_methods._add_property_object(prop)
return prop

class Add1dElements:
def add_conrod(self, eid: int, mid: int, nids: list[int],
Expand Down Expand Up @@ -9098,12 +9118,16 @@ def add_dense_dmi(self, name: str, myarray: np.ndarray,
elif str_form == 'rectangular':
assert nrows >= 1
assert ncols >= 1
elif str_form == 'diagonal':
assert nrows >= 1, (nrows, ncols)
assert ncols == 1, (nrows, ncols)
else: # pragma: no cover
raise NotImplementedError(str_form)

# ncols = 2
GCi = np.repeat(list(range(1, nrows+1)), ncols, axis=0).reshape(nrows, ncols).flatten()
GCj = np.repeat(list(range(1, ncols+1)), nrows, axis=0).reshape(nrows, ncols).flatten()
#self.log.warning(f'str_form = {str_form}')
#self.log.warning(f'GCi = {GCi}')
#self.log.warning(f'GCj = {GCj}')

Expand Down
2 changes: 1 addition & 1 deletion pyNastran/bdf/bdf_interface/add_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
CAEROs, PAEROs, SPLINEs, FREQs,
)
from pyNastran.bdf.cards.bolt import BOLT, BOLTFOR, BOLTSEQ, BOLTLD
from pyNastran.bdf.cards.elements.elements import CFAST, CGAP, CRAC2D, CRAC3D, PLOTELs, GENEL
from pyNastran.bdf.cards.elements.elements import CFAST, CWELD, CGAP, CRAC2D, CRAC3D, PLOTELs, GENEL
#from pyNastran.bdf.cards.properties.properties import PFAST, PGAP, PRAC2D, PRAC3D
#from pyNastran.bdf.cards.properties.solid import PLSOLID, PSOLID, PIHEX, PCOMPS, PCOMPLS
#from pyNastran.bdf.cards.msgmesh import CGEN, GMCORD
Expand Down
4 changes: 2 additions & 2 deletions pyNastran/bdf/bdf_interface/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def __init_attributes(self) -> None:
'CBUSH', 'CBUSH1D', 'CBUSH2D',

'CDAMP1', 'CDAMP2', 'CDAMP3', 'CDAMP4', 'CDAMP5',
'CFAST', 'GENEL',
'CFAST', 'CWELD','GENEL',

'CBAR', 'CROD', 'CTUBE', 'CBEAM', 'CBEAM3', 'CONROD', 'CBEND',
'CTRIA3', 'CTRIA6', 'CTRIAR',
Expand Down Expand Up @@ -884,7 +884,7 @@ def __init_attributes(self) -> None:
'PACABS', 'PAABSF', 'PACBAR', 'PMIC',

# 0d
'PELAS', 'PGAP', 'PFAST',
'PELAS', 'PGAP', 'PFAST', 'PWELD',
'PBUSH', 'PBUSH1D', 'PBUSH2D',
'PDAMP', 'PDAMP5',

Expand Down
5 changes: 3 additions & 2 deletions pyNastran/bdf/bdf_interface/card_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
'CBUSH', 'CBUSH1D', 'CBUSH2D',
# dampers
'CDAMP1', 'CDAMP2', 'CDAMP3', 'CDAMP4', 'CDAMP5',
'CFAST',
# fasteners
'CFAST', 'CWELD',

'CBAR', 'CBARAO', 'BAROR',
'CROD', 'CTUBE', 'CBEAM', 'CBEAM3', 'CONROD', 'CBEND', 'BEAMOR',
Expand All @@ -94,7 +95,7 @@

## properties
'PMASS',
'PELAS', 'PGAP', 'PFAST', 'PLPLANE', 'PPLANE',
'PELAS', 'PGAP', 'PFAST', 'PWELD', 'PLPLANE', 'PPLANE',
'PBUSH', 'PBUSH1D',
'PDAMP', 'PDAMP5',
'PROD', 'PBAR', 'PBARL', 'PBEAM', 'PTUBE', 'PBCOMP', 'PBRSECT', 'PBEND',
Expand Down
2 changes: 1 addition & 1 deletion pyNastran/bdf/bdf_interface/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def get_bdf_stats(model: BDF, return_type: str='string',
# ----
#new
'bolt', 'boltld', 'boltfor', 'boltseq', 'boltfrc',
'use_new_deck_parser',
'use_new_deck_parser', 'allow_overwrites_set',

] + list_attrs + card_dict_groups + scalar_attrs
missed_attrs = []
Expand Down
Loading

0 comments on commit 7ae527d

Please sign in to comment.