convert
Module¶
- defines:
- convert(model, units_to, units=None)
-
pyNastran.bdf.mesh_utils.convert.
_convert_aero
(model, xyz_scale, time_scale, weight_scale)[source]¶ - Converts the aero cards
- CAEROx, PAEROx, SPLINEx, AECOMP, AELIST, AEPARAM, AESURF
- Supports: AERO, AEROS, CAERO1, CAERO2, TRIM*, MONPNT1, FLUTTER FLFACT-rho/vel
- GUST, AESURF, PAERO2
Skips: PAERO1, AESTAT, AESURFS, AECOMP, AELIST Doesn’t support:CAERO3-5, PAERO3-5, SPLINEx, AEPARAM, AELINK, AEPRESS, AEFORCE, *probably not done
-
pyNastran.bdf.mesh_utils.convert.
_convert_constraints
(model, xyz_scale)[source]¶ Converts the spc/mpcs
Supports: SPC1, SPC, SPCAX Implicitly supports: MPC, MPCADD, SPCADD
-
pyNastran.bdf.mesh_utils.convert.
_convert_coordinates
(model, xyz_scale)[source]¶ Converts the coordinate systems
Supports: CORD1x, CORD2x
-
pyNastran.bdf.mesh_utils.convert.
_convert_dconstr
(model, dconstr, pressure_scale)[source]¶ helper for
_convert_optimization
-
pyNastran.bdf.mesh_utils.convert.
_convert_desvars
(desvars, scale)[source]¶ scales the DVPREL/DVCREL/DVMREL DESVAR values
-
pyNastran.bdf.mesh_utils.convert.
_convert_dvcrel1
(dvcrel, xyz_scale)[source]¶ helper for
_convert_optimization
-
pyNastran.bdf.mesh_utils.convert.
_convert_dvprel1
(dvprel, xyz_scale, mass_scale, weight_scale)[source]¶ helper for
_convert_optimization
-
pyNastran.bdf.mesh_utils.convert.
_convert_elements
(model, xyz_scale, time_scale, mass_scale, weight_scale)[source]¶ Converts the elements
- Supports: CTRIA3, CTRIA6, CTRIAR, CQUAD4, CQUAD8, CQUADR,
- CELAS2, CELAS4, CDAMP2, CDAMP4, CBUSH, CONROD, CBAR, CBEAM, GENEL, CONM2, CMASS4
- Skips : CELAS1, CELAS3, CDAMP3, CDAMP5, CCONEAX,
- CROD, CTUBE, CVISC, CBUSH1D, CQUAD, CSHEAR, CTRIAX, CTRIAX6, CTETRA, CPENTA, CHEXA, CPYRAM, CMASS1, CMASS3,
NX Skips: CTRAX3, CTRAX6, CPLSTN3, CPLSTN6, CPLSTN4’, CPLSTN8, CQUADX4, CQUADX8 *intentionally
-
pyNastran.bdf.mesh_utils.convert.
_convert_loads
(model, xyz_scale, time_scale, weight_scale, temperature_scale)[source]¶ Converts the loads
- Supports:
- dloads: RLOAD1*, TLOAD1*
- loads: FORCE, FORCE1, FORCE2, MOMENT, MOMENT1, MOMENT2
- GRAV, ACCEL1, PLOAD, PLOAD1, PLOAD2, PLOAD4, RANDPS
- combinations: DLOAD, LOAD
- probably not done
-
pyNastran.bdf.mesh_utils.convert.
_convert_materials
(model, xyz_scale, mass_scale, weight_scale, temperature_scale)[source]¶ Converts the materials
Supports: MAT1, MAT2, MAT3, MAT8, MAT9, MAT10, MAT11
-
pyNastran.bdf.mesh_utils.convert.
_convert_nodes
(model, xyz_scale)[source]¶ Converts the nodes
Supports: GRID
-
pyNastran.bdf.mesh_utils.convert.
_convert_optimization
(model, xyz_scale, mass_scale, weight_scale)[source]¶ Converts the optimization objects
Limited Support: DESVAR, DCONSTR, DVCREL1, DVPREL1
-
pyNastran.bdf.mesh_utils.convert.
_convert_pbar
(prop, xyz_scale, area_scale, area_moi_scale, nsm_bar_scale)[source]¶ converts a PBAR
-
pyNastran.bdf.mesh_utils.convert.
_convert_pbeam
(prop, xyz_scale, area_scale, area_moi_scale, nsm_bar_scale)[source]¶ converts a PBEAM
-
pyNastran.bdf.mesh_utils.convert.
_convert_pbeam3
(prop, xyz_scale, area_scale, area_moi_scale, nsm_bar_scale)[source]¶ converts a PBEAM3
-
pyNastran.bdf.mesh_utils.convert.
_convert_pbush
(prop, velocity_scale, mass_scale, stiffness_scale)[source]¶
-
pyNastran.bdf.mesh_utils.convert.
_convert_pbush1d
(model, prop, xyz_scale, area_scale, mass_scale, damping_scale, stiffness_scale)[source]¶
-
pyNastran.bdf.mesh_utils.convert.
_convert_properties
(model, xyz_scale, time_scale, mass_scale, weight_scale, temperature_scale)[source]¶ Converts the properties
- Supports: PELAS, PDAMP, PDAMP5, PVISC, PROD, PBAR, PBARL, PBEAM, PBEAML,
- PSHELL, PSHEAR, PCOMP, PCOMPG, PELAS, PTUBE, PBUSH, PCONEAX, PGAP, PBUSH1D
Skips : PSOLID, PLSOLID, PLPLANE, PIHEX
Skips are unscaled (intentionally)
-
pyNastran.bdf.mesh_utils.convert.
_get_dload_scale
(dload, xyz_scale, velocity_scale, accel_scale, force_scale)[source]¶ LOAD asssumes force
-
pyNastran.bdf.mesh_utils.convert.
_set_wtmass
(model, gravity_scale)[source]¶ set the PARAM,WTMASS
ft-lbm-s-lbf-psf : 1. / 32.2 in-lbm-s-lbf-psi : 1. / (32.2*12) m-kg-s-N-Pa : 1. mm-Mg-s-N-Mpa : 1. in-slinch-s-lbf-psi : 1. ft-slug-s-lbf-psf : 1. in-slug-s-lbf-psi : 1 / 12.
1 slug * 1 ft/s^2 = 1 lbf 1 slinch * 1 in/s^2 = 1 lbf 1 slinch = 12 slug
F = m*a 386 lbf = 1 slinch * 386 * in/s^2 32 lbf = 1 slug * 32 * ft/s^2 1 N = 1 kg * 9.8 m/s^2
1 lbf = g_scale * 1 slinch * 1 in/s^2 1 lbf = g_scale * 12 slug * 1 in/s^2 –> g_scale = 1/12.
-
pyNastran.bdf.mesh_utils.convert.
_setup_scale_by_terms
(scales, terms, quiet=False)[source]¶ determines the mass, length, time scaling factors
-
pyNastran.bdf.mesh_utils.convert.
convert
(model, units_to, units=None)[source]¶ Converts a model from a set of defined units
Parameters: - model : BDF
cross references the model (default=True)
- units_to : List[str]
[length, mass, time] length = {in, ft, m, cm, mm} mass = {g, kg, Mg, lbm, slug, slinch} time = {s}
- units : list
overwrites model.units
-
pyNastran.bdf.mesh_utils.convert.
convert_length
(length_from, length_to)[source]¶ Determines the length scale factor
We crate a gravity_scale_length for any non-standard unit (ft, m)
-
pyNastran.bdf.mesh_utils.convert.
convert_mass
(mass_from, mass_to, log)[source]¶ determines the mass, weight, gravity scale factor
We apply a gravity_scale_mass for any unit not {kg, slug}. Then we convert to N.
So for SI, if we have kg, we have a base unit, and the length is assumed to be m, so we have a consistent system and gravity_scale_mass is 1.0.
- For lbm:
- F = m*a 1 lbf = 1 lbm * 1 ft/s^2 32 lbf = 1 slug * 32 ft/s^2 gscale = 1/g F = gscale * m * a 1 lbf = gscale * 1 lbm * 32 ft/s^2 –> gscale = 1/32
- For slug:
- F = gscale * m * a 32 lbf = gscale * 1 slug * 32 ft/s^2 –> gscale = 1
- For slinch:
- F = gscale * m * a 386 lbf = gscale * 1 slinch * 12*32 in/s^2 1 slinch = 12 slug 12 in = 1 ft 386 lbf = gscale * 12 slug * 32 ft/s^2 –> gscale = 1
TODO: slinch/slug not validated
-
pyNastran.bdf.mesh_utils.convert.
get_scale_factors
(units_from, units_to, log)[source]¶ [length, mass, time] [in, lb, s]
-
pyNastran.bdf.mesh_utils.convert.
scale_by_terms
(bdf_filename, terms, scales, bdf_filename_out=None, encoding=None, log=None, debug=True)[source]¶ Scales a BDF based on factors for 3 of the 6 independent terms
Parameters: - bdf_filename : str / BDF()
a BDF filename
- terms : List[str]; length=3
the names {M, L, T, F, P, V} mass, length, time, force, pressure, velocity
- scales : List[float]; length=3
the scaling factors
- bdf_filename_out : str; default=None
a BDF filename to write
Returns: - model : BDF()
the scaled BDF
-
pyNastran.bdf.mesh_utils.convert.
scale_model
(model, xyz_scale, mass_scale, time_scale, weight_scale, gravity_scale, convert_nodes=True, convert_elements=True, convert_properties=True, convert_materials=True, convert_aero=True, convert_constraints=True, convert_loads=True, convert_optimization=True)[source]¶ Performs the model scaling