PCL and Customization > Modifying the Database Using PCL > Adding New Loads and Boundary Conditions
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Adding New Loads and Boundary Conditions
To create loads and boundary condition definitions, define the load type, assign application regions, element data attributes and node data attributes to the new load and then associate the load type to the analysis code of interest. The full definitions for all the load types listed under the description of the load_id argument for “db_create_lbc_type_defn” exist in all Patran databases. You may either associate these already existing load types to your new analysis code or you may define unique load types. To define a new load, the functions lbc_defn_create.lbc_defn, 562 and lbc_defn_create.lbc_var_defn, 565 should be used.
Common ID Numbers used in LBC Functions
The following tables present ID numbers used in various loads and boundary conditions throughout this section.
.   
Table 7‑1
ID/TypeID
ID/Type
0 = arrow without a head.
103 = X.
1 = one headed arrow.
104 = cross.
2 = two headed arrow.
105 = filled circle.
3 = three headed arrow.
106 = square.
4 = one head, no arrow.
107 = filled square.
5 = two heads, no arrow.
108 = triangle.
6 = three heads, no arrow.
109 = filled triangle.
101 = dot.
110 = diamond.
102 = circle.
111 = filled diamond.
Table 7‑2
ID/Color
ID/Color
 
0 = black.
8 = dark red.
The user may change the ID to color association. See Color Palette (p. 376) in the Patran Reference Manual. If changed, all or part of this table will be invalid.
1 = red.
9 = bright red.
2 = green.
10 = dark green.
3 = yellow.
11 = bright green.
4 = blue.
12 = dark blue.
5 = red.
13 = bright blue.
6 = cyan.
14 = dark red.
7 = white.
15 = bright red.
Table 7‑3
Color
Box ID
Analysis Type
Structural
CFD
Thermal
601
displacement
 
 
602
force, voltage
 
voltage
603
pressure
 
 
604
temperature
 
 
605
inertial load
 
 
606
initial displacement
 
 
607
initial velocity
 
 
608
velocity
 
 
609
acceleration
 
 
610
 
 
temperature
611
 
 
convection
612
 
 
heat flux
613
 
 
heat source
614
 
 
initial temperature
615
 
inflow (incompressible)
 
616
 
outflow (incompressible)
temperature
617
 
volumetric heat
 
618
 
solid wall (incompressible)
 
619
distributed
total heat load
 
620
 
symmetry
 
621
 
inflow (compressible)
 
622
 
outflow (compressible)
 
623
 
open (compressible)
 
624
 
solid wall (compressible)
 
625
 
 
temperature
626
 
 
convection
627
 
 
heat flux
628
 
 
heat source
629
 
 
volume. heat source
630
 
 
pressure
631
 
 
mass flow rate
632
 
 
view factors, radiation
Table 7‑4
ID/Load Types
ID/Load Types
1 = inflow (incompressible)
19 = initial temperature
2 = outflow (incompressible)
21 = inflow (compressible)
4 = solid wall (incompressible)
22 = outflow (compressible)
5 = symmetry
23 = open flow (compressible)
6 = displacement
24 = solid wall (compressible)
7 = force
34 = distributed load
8 = pressure
35 = voltage
9 = temperature
36 = voltage (thermal)
10 = inertial load
40 = friction
11 = initial displacement
41 = contact (absolute)
12 = initial velocity
42 = contact (relative)
13 = velocity
43 = temperature (Samcef)
14 = acceleration
44 = displacement retained (Samcef)
15 = thermal temperature
45 = load (Samcef)
16 = convection
46 = flux (Samcef)
17 = heat flux
47 = hybrid deformation (Samcef)
18 = heat source
48 = append
51 = Temperature (PThermal)[Fixed]
78 = inertial load (Patran TEAM)
52 = Temperature (PThermal)[Time Table]
91 = volumetric heat
54 = Temperature (PThermal)[Coupled]
92 = total heat load
55 = Temperature (PThermal)[Initial]
101 = Convection (PThermal)[Fixed Coefficient]
56 = Temperature (PThermal)[Template]
102 = Convection (PThermal)[Time Table]
60 = Heating (PThermal)[]Flux, Fixed
103 = Convection (PThermal)[Temperature Table]
61 = Heating (PThermal)[Flux, Time Table]
105 = Convection (PThermal)[Template, Convection]
62 = Heating (PThermal)[Flux, Temperature Table]
110 = Radiation (PThermal)[Gap Radiation]
67 = Heating (PThermal)[Template, Fluxes]
112 = Radiation (PThermal)[Template, View Factors]
68 = Heating (PThermal)[Template, Volumetric Heat]
116 = Pressure (PThermal)[Fixed]
69 = Heating (PThermal)[Template, Nodal Source]
117 = Pressure (PThermal)[Time Table]
71 = displacement (Patran TEAM)
119 = Pressure (PThermal)[Initial]
72 = displacement/point (Patran TEAM)
120 = Pressure (PThermal)[Template]
73 = displacement/local (Patran TEAM)
124 = Mass Flow Rate (PThermal)[Fixed]
74 = traction (Patran TEAM)
125 = Mass Flow Rate (PThermal)[Time Table]
75 = traction/local (Patran TEAM)
127 = Mass Flow Rate (PThermal)[Initial]
76 = pressure (Patran TEAM)
128 = Mass Flow Rate (PThermal)[Template]
77 = force (Patran TEAM)
 
LBC Functions for Customization 
  
db_create_lbc_type_defn
(<load_name>, <analy_type_id>, <applic_type>, <glob_flag>, <coord_flag>, <graph_sym>, <scal_vect>, <null_vect>, <num_analy_codes>, <analy_code_ids>, <def_color>, <color_box>, <anchor>, <load_id> )
 
Note:  
This function is still usable but obsolete, and should be replaced by lbc_defn_create.lbc_defn, 562 and lbc_defn_create.lbc_var_defn, 565.
 
Input:
 
 
CHARACTER STRING
<load_name>
The name of the new load type, e.g., “Temperature.”
INTEGER
<analy_type_id>
Flag specifying the analysis type:
1 = Structural.
2 = Thermal.
3 = Fluid Dynamics.
INTEGER
<applic_type>
Flag specifying the effect of this load type:
0 = Body Load.
1 = Boundary Load.
INTEGER
<glob_flag>
Flag specifying whether the load has global application or not:
0 = Only application region affected.
1 = Global load: affects everything.
INTEGER
<coord_flag>
Flag specifying whether the load can be oriented in a given local frame or not:
0 = No alternate coordinate frame orientation allowed.
1 = Alternate coordinate frame orientation accepted.
-1 = Local
INTEGER
<graph_sym>
Flag specifying what graphic symbol should be used for this load type. See Table 7‑1.
INTEGER
<scal_vect>
Flag specifying the data form of the load:
0 = scalar.
1= vector.
INTEGER
<null_vect>
Flag specifying whether blank components of a vector load are to be interpreted as zeroes (as with forces) or nulls (as with displacements):
0 = interpret blank components as zeroes.
1 = interpret blank components as nulls.
INTEGER
<num_analy_codes>
No longer used. Input zero.
INTEGER ARRAY
<analy_code_ids>
No longer used. Input an array of none zero [0].
INTEGER
<def_color>
Flag specifying the default color to be used for this load type. See Table 7‑2.
INTEGER
<color_box>
The number of the color box to be used to modify the load type color. Must range from 601 to 640 and be unique for a given analysis code. See Table 7‑3 for IDs used by Patran
INTEGER
<anchor>
Flag which specifies the anchor style for vector load types:
1= anchor at base.
2 = anchor at tip.
3 = anchor at middle.
INTEGER
<load_id>
Load type IDs must be unique with respect to all other load type IDs previously defined. Load IDs 1-100 are currently being used by Patran. It is likely that IDs up to 1000 will be used for future Patran requirements. It is advisable that customers defining custom loads and boundary condition definitions use load IDs >1000. The load IDs currently being used by Patran are listed in Table 7‑4.
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
To assign application regions to the load type, the following function is used. This call is only needed for new load types since the load types which already exist in the database have application regions already assigned to them.
  
db_create_app_region_defn
( <load_id>, <region_label> )
 
Note:  
This function is still usable but obsolete, and should be replaced by lbc_defn_create.lbc_defn, 562
 
Input:
 
 
INTEGER
<load_id>
The ID of the load type of interest.
CHARACTER STRING
<region_label>
The name of the application region, typically simply “Application Region”.
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
Element load data input attributes are assigned to the new load type with the following function. This call is only needed for new load types since the load types which already exist in the database have data input attributes assigned to them
.
db_create_elem_lbc_var_defn
( <load_id>, <variability>, <elem_dim>, <data_label> )
 
Note:  
This function is still usable but obsolete, and should be replaced by lbc_defn_create.lbc_defn, 562 and lbc_defn_create.lbc_var_defn, 565.
 
Input:
 
 
INTEGER
<load_id>
The ID of the load type of interest.
INTEGER
<variability>
The variability of the input load:
2 = uniform across the element body, element face or element edge.
3 = varying across the element body, element face or element edge.
INTEGER
<elem_dim>
Dimensionality of the valid element types:
1 = line elements.
2 = surface elements.
3 = solid elements.
CHARACTER STRING
<data_label>
The label used to describe the data input such as “Top Pressure” or “Bottom Pressure”.
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
 
Note:  
Each call to this function creates a new data input ID, sequentially starting from 1, for each unique combination of load_id, variability, and elem_dim.
Node load data input attributes are assigned to the new load type with the following function. This call is only needed for new load types since the load types which already exist in the database have data input attributes assigned to them.
  
db_create_nodal_lbc_var_defn
( <load_id>, <data_label> )
 
Note:  
This function is still usable but obsolete, and should be replaced by lbc_defn_create.lbc_defn, 562 and lbc_defn_create.lbc_var_defn, 565.
 
Input:
 
 
INTEGER
<load_id>
The ID of the load type of interest.
CHARACTER STRING
<data_label>
The label used to describe the data input such as “Force ( F1 F2 F3 )” or “Temperature”.
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
 
Note:  
Each call to this function creates a new data input ID, sequentially starting from 1, for each unique load_id.
To associate newly defined or previously existing load types to your new analysis code, use the following function. 
 
db_add_lbc_type_for_ac
( <load_id>, <data_label> )
 
Note:  
This function is still usable but obsolete, and should be replaced by db_add_lbc_defn_for_ac, 561
  
Input:
 
 
INTEGER
<analy_code_id>
The ID of the new analysis code as described under db_create_analysis_code, 455.
INTEGER
<load_type_id>
The ID of the load type to be associated with the new analysis code. See db_create_lbc_type_defn, 555 (argument <load_id>, 557 for more details.
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
To associate custom PCL input and application regions to an analysis code, use the following function.  
 
 
db_add_lbc_c_and_t_for_ac
( <analy_code_id>, <load_type_id>, <target_elem_flag>, <input_data_pcl>, <app_reg_data_pcl> )
 
Note:  
This target_elem_flag, input_data_pcl and app_reg_data_pcl arguments to this function override those of lbc_defn_create.lbc_defn, 562.
 
Input:
 
 
INTEGER
<analy_code_id>
The ID of the analysis code as described under db_create_analysis_code, 455.
INTEGER
<load_type_id>
The ID of the load type to be associated with the new analysis code. See db_create_lbc_type_defn, 555 (argument <load_id>, 557 for more details.
INTEGER
<target_elem_flag>
Flag specifying whether the Target Element menu should be displayed.
0 = don’t display.
1 = display.
STRING[31]
<input_data_pcl>
Name of non-standard (custom) input data form PCL class. (See Custom Data and Application Region Sub-Forms, 459.)
STRING[31]
<app_reg_data_pcl>
Name of non-standard (custom) application region form PCL class. (See Custom Data and Application Region Sub-Forms, 459.)
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
To associate newly defined or previously existing load types to analysis codes, use the following function.
   
db_add_lbc_defn_for_ac
( <analy_code_id>, <load_id>, <count>, <categories> )
Input:
 
 
INTEGER
<analy_code_id>
The ID of the analysis code as described under db_create_analysis_code, 455.
INTEGER
<load_id>
The ID of the load type to be associated with the analysis code.
INTEGER
<count>
The number of valid categories. This should always be set to 3.
INTEGER(3)
<categories>
An array of up to 3 valid categories. The elements may be set to the following values:
1 = Nodal.
2 = Element Uniform.
3 = Element Variable.
If 3 categories are not used, the remaining elements should be set to zero.
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
To define a new load type, the following function is used.
   
lbc_defn_create.lbc_defn
( <load_name>, <option_name>, <analy_type_id>, <applic_type>, <glob_flag>, <coord_flag>, <scal_or_vect>, <null_flag>, <def_color>, <color_box>, <n_app_region>, <appl_reg_labels>, <no_data_flag>, <input_data_pcl>, <app_reg_data_pcl>, <target_elem_flag>, <dyn_data_form>, <acid_mod>, <equiv_flag>, <load_id> )
Input:
 
 
STRING[31]
<load_name>
The name of the new load type, e.g., “Temperature.”
STRING[31]
<option_name>
The option name associated to the new load type.
This name is optional. A blank string specifies no
options. If a name is specified, an “Option:” menu
will be added to the appropriate LBC forms. If two or more load types are defined with the same
load_name, the load_name will only appear once in the LBC form “Object:” menu. The “Option:” menu is used to choose between them. If the option_name is blank, the load_name will have its own entry in the “Object:” menu.
INTEGER
<analy_type_id>
Flag specifying the analysis type:
1 = Structural.
2 = Thermal.
3 = Fluid Dynamics.
INTEGER
<applic_type>
Flag specifying the effect of this load type:
0 = Body Load.
1 = Boundary Load.
INTEGER
<glob_flag>
Flag specifying whether the load has global application or not:
0 = Only application region affected.
1 = Global load: affects everything.
INTEGER
<coord_flag>
Flag specifying whether the load can be oriented in a given local frame or not:
0 = No alternate coordinate frame orientation allowed.
1 = Alternate coordinate frame orientation accepted.
-1 = Use local entity coordinate frame.
INTEGER
<scal_or_vect>
Flag specifying the data form of the load:
0 = scalar.
1= vector.
2= combined scalar and vector.
INTEGER
<null_flag>
No longer used. Input zero.
INTEGER
<def_color>
Flag specifying the default color to be used for this load type. Refer to Table 7‑2 for color definitions.
INTEGER
<color_box>
The number of the color box to be used to modify the load type color. Must range from 601 to 640 and be unique within an analysis type. Refer to Table 7‑3 for color box IDs currently used by Patran.
INTEGER
<n_app_region>
The number of application regions for this load type.
STRING[31]()
<appl_reg_labels>
Array of napp application region labels.
INTEGER
<no_data_flag>
Flag specifying whether data input is required. If data input is not required, a blank variable label must be specified in a call to lbc_defn_create.lbc_var_defn
0= input data is required.
1= input data is not required.
STRING[31]
<input_data_pcl>
Name of non-standard (custom) input data form PCL class. See Custom Data and Application Region Sub-Forms, 459.
Note: This argument is overridden by <input_data_pcl> in the function db_add_lbc_c_and_t_for_ac, 561.
STRING[31]
<app_reg_data_pcl>
Name of non-standard (custom) application region form PCL class. See Custom Data and Application Region Sub-Forms (p. 360).
Note: This argument is overridden by <app_reg_data_pcl> in the function db_add_lbc_c_and_t_for_ac, 561.
INTEGER
<target_elem_flag>
Flag specifying whether the Target Element menu should be displayed. This flag only applies if non-standard (custom) forms are used. Both input_data_pcl and app_reg_data_pcl must be non-blank.
0 = don’t display.
1 = display.
Note: This argument is overridden by the <target_elem_flag> in the function db_add_lbc_c_and_t_for_ac, 561.
INTEGER
<dyn_data_form>
Flag specifying whether to use a double sized input data form for dynamic load cases.
0 = use single width.
1 = use double width.
INTEGER
<acid_mod>
Flag specifying whether this load type has the potential to modify the analysis coordinate frame of a node.
0 = cannot modify.
1 = can modify.
INTEGER
<equiv_flag>
Flag specifying whether to prevent equivalencing nodes between application regions. Only applies if there is more than one application region
0 = don’t equivalence.
1 = equivalence.
INTEGER
<load_id>
The ID of this load type. This ID must be unique with respect to all other load type IDs previously defined. It is recommended that you use ids >1000. The following load type ids are reserved:
Generic: 1-50
Thermal: 51-70
Patran TEAM: 71-90
Fluid Dynamics: 91-100
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
To assign input data definitions to the load type, the following function is used. This call is only needed for new load types since the load types which already exist in the database have input data definitions already assigned to them.
   
lbc_defn_create.lbc_var_defn
(load_id, category, targ_elem_dim, variable_label, variable_id, display_order, data_type, scalar_or_vector, null_type, normal_direction, graph_symbol, connect_label, anchor, conflict_resolution, display_style, evaluation_location )
Description:
 
 
This function will assign input data variable definitions to a load type.
Input:
 
 
INTEGER
load_id
This value specifies the load type identifier. This identifier must reference an existing load type.
INTEGER
category
This value specifies the type of entities at which the loads and boundary conditions will be evaluated. This value can be set to 1 for nodal entities, 2 for uniform element entities, or 3 for variable element entities.
INTEGER
targ_elem_dim
This value specifies the dimensionality of the element to which the load and boundary condition will be applied. This value can be set to 1 for one dimension, 2 for two dimensions, or 3 for three dimensions.
When the input value category is set to 1 for nodal entities, this value is not used because the dimensionality for nodes is undefined and this input value should be set to 0.
STRING
variable_label [31]
This value specifies the text that will be associated with the input value variable_id. This text will be used to label the display of the information associated with the input value variable_id. If input data is not specified for this load type then this value must be an empty string.
INTEGER
variable_id
This value specifies the identifier for the variables associated with this load type. This identifier must be unique within each load type.
INTEGER
display_order
This value specifies the order in which variables associated with this load type would be displayed in a data box. This value can range from 1 to the number of variables associated with the identifier specified by the input variable variable_id.
INTEGER
data_type
This value specifies the data type for the variables associated with the input value variable_id. This value can be set to 1 for integers, 3 for real or field values evaluated by the loads and boundary conditions, 5 for a node identifier, or 7 for a field that is not evaluated by the loads and boundary conditions.
INTEGER
scalar_or_vector
This value specifies when set to 0 that the data type is a scalar value or when set to 1 that the data type is a vector value.
This value is used only if the input argument data_type is set to 3 for real or field values evaluated by the loads and boundary conditions.
INTEGER
null_type
This value specifies, when set to 0, that blank components of a vector load are to be interpreted as zeros, as with forces. When this value is set to 1, blank components of a vector load will be interpreted as nulls, as with displacements.
INTEGER
normal_direction
This value specifies, when set to 0 that a local normal is not used. When this value is set to 1, the positive direction for a local normal vector will be into the body. When this value is set to 2, the positive direction for a local normal will be out of the body.
INTEGER
graph_symbol(3)
This value specifies the graphic symbols to be used for the variable assigned to the load type. The first array element specifies the symbol for the first application region, the second element the symbol for the second application region, and the third element is reserved for future use. The second element is not used unless two application regions are specified. Refer to Table 7‑1 for the definitions of the graphic symbols that can be used with this value.
INTEGER
connect_label(4)
This value specifies the label used to connect the application regions. This value applies to load types with multiple application regions only.
The first array element can be set to 0 to specify that no connection is displayed between the application regions or 1 to specify that a solid line is displayed connecting the application regions with the label specified in the second array element of this input value.
The second array element can be set to 2 to specify that a label is not displayed, 3 to specify that the load and boundary condition set name is used as a label, or 7 to indicate that the variable field name is to be used as a label.
The third array element should always be set to 0 and is reserved for future use.
The fourth array element is reserved for future use.
INTEGER)
anchor(3)
This value specifies the anchor style for vectors.
The first array element specifies the anchor style for the first application region.
The second array element specifies the anchor style for the second application region.
The third array element is reserved for future use.
The following anchor style values are available: 1 to anchor at the vector base, 2 to anchor at the vector tip, and 3 to anchor at the middle of the vector.
INTEGER
conflict_resolution
This value specifies, when set to 0, that variable conflicts will not be resolved. Setting this value to 1 will allow variable conflicts to be resolved.
INTEGER
display_style(3)
This value specifies the display style that will be used to display the values specified with the input argument graph_symbol. The display style controls the use of symbols and labels plotted with the variable definitions.
This value can be used to specify the use of the loads and boundary condition set name or field name that can be displayed as a label.
The first array element specifies the display style for the first application region.
The second array element specifies the display style for the second application region and is used only if two application regions are specified.
The third array element is reserved for future use.
The following display style values can be used: 0 for no display, 1 for a display with markers with standard or variable quantity labels, 2 for a display with no marker labels, 3 for a display with markers with loads and boundary condition set name labels, 4 for a display with labels with no markers, 5 for a display with a graphics symbol at the node with the node id, 6 for a display with markers with constrained degree of freedom and coordinate frame id labels, or 7 for a display with markers with field name labels.
A display style value of 5 can be used with an input value data_type that specifies node identifiers only. A display style value of 6 can be used with a null_type input value of 1 only.
INTEGER
evaluation_location
This value specifies the application regions at which entity fields will be evaluated. This value is used only with load types that specify multiple application regions. The following values can be used: 0 to evaluate the entity fields in all application regions, 1 to evaluate the entity fields in the first application region, or 2 to evaluate the entity fields in the second application region.
Output:
 
 
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
 
None.
 
 
Remarks:
 
This function should be called only for new load types. Existing load types will already have an input data definition assigned.
To assign valid target FEM types to the load type application regions, the following function is used. This call is only needed for new load types since the load types which already exist in the database have valid target FEM types already assigned to them.
    
lbc_defn_create.valid_targets
( <load_id>, <category>, <type_count>, <node_flags>, <zero_d_flags>, <one_d_flags>, <two_d_flags>, <three_d_flags>, <n_app_region>, <app_region_ids>, <geo_datatypes>, <fem_datatypes> )
Input:
 
 
INTEGER
<load_id>
The ID of this load type. This ID must have been previously defined.
INTEGER
<category>
Specifies what type of entities the LBC will eventually be evaluated at.
1 = Nodal.
2 = Element Uniform.
3 = Element Variable.
INTEGER
<type_count>
Number of sets of valid target types. Specify a value of 1 for load types with 1 application region. For two application regions specify 6.
LOGICAL(6)
<node_flags>
Flags for nodal targets. See Comments:, 571.
LOGICAL(6)
<zero_d_flags>
Flags for 0D element targets. See Comments:, 571.
LOGICAL(6)
<one_d_flags>
Flags for 1D element targets. See Comments:, 571.
LOGICAL(6)
<two_d_flags>
Flags for 2D element targets. See Comments:, 571.
LOGICAL(6)
<three_d_flags>
Flags for 3D element targets. See Comments:, 571.
INTEGER
<n_app_region>
The number of application regions for this load type.
INTEGER()
<app_region_ids>
Application region ids. Usually 1 for app region 1 and 2 for app region 2.
STRING[31]()
<geo_datatypes>
Geometric select datatypes. Valid strings are:
“SURFACE_EDGE”
“GEO_NODAL”
“GEO_BEAM”
“GEO_SHELL”
“GEO_SOLID”
“GEO_SHELL_BNDRY”
“GEO_SOLID_BNDRY”
“GEO_BEAM_BNDRY”
“CURVE_SIDE”
“CURVE_VERTEX”
“SURFACE_EDGE”
“SURFACE_SIDE”
“GEO_SHELL_SIDE_BNDRY”
STRING[31]()
<fem_datatypes>
FEM select datatypes. Valid strings are:
“ELEM_EDGE_2D”
“FEM_NODAL”
“BEAMELEM”
“ELEM2D”
“ELEM3D”
“FEM_SHELL_BNDRY”
“FEM_SOLID_BNDRY”
“FEM_BEAM_BNDRY”
“BEAM_SIDE”
“BEAM_VERTEX”
“ELEM_EDGE_2D”
“ELEM_2D_SIDE”
“FEM_SHELL_SIDE_BNDRY”
Output:
 
 
INTEGER
<Return Value>
Status return value. The value will be 0 if the routine is successful.
Error Conditions:
 
None.
 
 
Comments:
More on node_flags, zero_d_flags, one_d_flags, two_d_flags and three_d_flags:
These flags specify what FEM targets are valid in application region 1 and, the corresponding valid targets in application region 2. They control the display of the Target Element Dimension option menu for each application region. The valid targets in application region 2 are dependent on which target is selected for region 1. Thus there is a set of region 2 flags for each region 1 flag.
If there is only 1 application region, set the first element in each flag array (i.e. node_flags(1), zero_d_flags(1)...) TRUE for each valid target. Set all remaining flags FALSE, and set type_count to 1.
If there are 2 application regions, set the first element in each flag array TRUE for each valid target in application region 1. Flag array elements 2 through 6 correspond to nodal, 0D, 1D, 2D and 3D targets for application region 2. Set the second element in each flag array (i.e. node_flags(2), zero_d_flags(2)...) TRUE for each target type in the application region 2 that may be associated to nodes in application region 1. If node_flags(1) is FALSE, set the second element in each flag array FALSE. Set the third element in each flag array TRUE for each target type in the application region 2 that may be associated to 0D elements in application region 1. If zero_d_flags(1) is FALSE, set the third element in each flag array FALSE. Follow the same pattern for the remaining flag array elements.
Example 1:
This code fragment sets nodes and 2D elements valid in application region 1, and associates nodes in region 1 to 2D elements in region 2, and 2D elements in region 1 to 3D elements in region 2.
$                        Region ---------- Region 2 -------------
$                          1    Node   0D     1D     2D     3D
$----------------------------------------------------------------
LOGICAL node_flag(6)	= TRUE,  FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL zerod_flag(6)		= FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL oned_flag(6)		= FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL twod_flag(6)		= TRUE,  TRUE,  FALSE, FALSE, FALSE, FALSE
LOGICAL threed_flag(6)		= FALSE, FALSE, FALSE, FALSE, TRUE,  FALSE
 
Example 2:
This is the complete code to create a new load type with:
1. 1 application region and valid FEM targets of nodes or 2D elements.
2. 2 variables, one scalar and one vector.
3. the scalar labeled with a circle and its magnitude.
4. the vector labeled with a single headed arrow and its magnitude.
 
FUNCTION define_my_load_type( load_id )
 
STRING load_name[31], option_name[31]
STRING inp_data_pcl[31], app_region_data_pcl[31]
STRING variable_label[31]
STRING appl_reg_labels[31](2)
INTEGER load_id, app_ids(2)
STRING geo_datatypes[31](5,2), fem_datatypes[31](5,2)
INTEGER analy_type_id, applic_type, glob_flag, coord_flag, @
graph_sym(3), scal_or_vect, null_flag, def_color, color_box, @
n_app_region, no_data_flag, target_elem_flag, dyn_data_form, @
acid_mod, equiv_flag
INTEGER targ_elem_dim, variable_id, display_order, data_type,@
norm_flag,connect_label(4), anchor(3), conflict_flag,@
display_type(3),eval_flag, category, type_count, categories(3),@
analy_code_id
LOGICAL node_flags(6) = FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL zero_d_flags(6) = FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL one_d_flags(6) = FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL two_d_flags(6) = FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
LOGICAL three_d_flags(6) = FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
 
 
/*
 Define new load type.
*/
load_name = “New Type”
option_name = ““
analy_type_id = 1
applic_type = 1
glob_flag = 0
coord_flag = 0
scal_or_vect = 0
null_flag = 0
def_color = 2
color_box = 626
n_app_region = 1
appl_reg_labels(1) = “Application Region”
appl_reg_labels(2) = ““
no_data_flag = 0
inp_data_pcl = ““
app_region_data_pcl = ““
target_elem_flag = 1
dyn_data_form = 1
acid_mod = 0
equiv_flag = 0
 
lbc_defn_create.lbc_defn( load_name, option_name, analy_type_id, @
applic_type, glob_flag, coord_flag, scal_or_vect, null_flag,@
def_color, color_box, n_app_region, appl_reg_labels, @
no_data_flag,inp_data_pcl, app_region_data_pcl,@
target_elem_flag,dyn_data_form,acid_mod,equiv_flag,load_id )
 
/*
 Define valid targets for new load type.
*/
category = 2
type_count = 1
 
node_flags(1) = TRUE
zero_d_flags(1) = FALSE
one_d_flags(1) = FALSE
two_d_flags(1) = TRUE
three_d_flags(1) = FALSE
 
app_ids(1) = 1
app_ids(2) = 0
 
geo_datatypes(1,1) = “GEO_NODAL”
geo_datatypes(2,1) = ““
geo_datatypes(3,1) = ““
geo_datatypes(4,1) = “GEO_SHELL_BNDRY”
geo_datatypes(5,1) = ““
fem_datatypes(1,1) = “FEM_NODAL”
fem_datatypes(2,1) = ““
fem_datatypes(3,1) = ““
fem_datatypes(4,1) = “FEM_SHELL_BNDRY”
fem_datatypes(5,1) = ““
 
lbc_defn_create.valid_targets( load_id, category, type_count, @
node_flags, zero_d_flags, one_d_flags,two_d_flags,three_d_flags,@
n_app_region, app_ids, geo_datatypes, fem_datatypes )
 
 
/*
 Define variables for new load type for target type 0 ( nodal ).
*/
targ_elem_dim = 0
variable_label = “Scalar Variable Id 1”
variable_id = 1
display_order = 1
data_type = 3
scal_or_vect = 0
norm_flag = 0
graph_sym(1) = 102
graph_sym(2) = 0
graph_sym(3) = 0
connect_label(1) = 0
connect_label(2) = 0
connect_label(3) = 0
connect_label(4) = 0
anchor(1) = 0
anchor(2) = 0
anchor(3) = 0
conflict_flag = 1
display_type(1) = 1
display_type(2) = 0
display_type(3) = 0
eval_flag = 0
 
lbc_defn_create.lbc_var_defn( load_id, category, targ_elem_dim, @
variable_label, variable_id, display_order, data_type,@
scal_or_vect, null_flag, norm_flag, graph_sym, connect_label,@
anchor, conflict_flag, display_type, eval_flag )
 
variable_label = “Vector Variable Id 2”
variable_id = 2
display_order = 2
data_type = 3
scal_or_vect = 1
norm_flag = 0
graph_sym(1) = 1
graph_sym(2) = 0
graph_sym(3) = 0
connect_label(1) = 0
connect_label(2) = 0
connect_label(3) = 0
connect_label(4) = 0
anchor(1) = 1
anchor(2) = 0
anchor(3) = 0
conflict_flag = 1
display_type(1) = 1
display_type(2) = 0
display_type(3) = 0
eval_flag = 0
 
lbc_defn_create.lbc_var_defn( load_id, category, targ_elem_dim, @
variable_label, variable_id, display_order, data_type,@
scal_or_vect, null_flag, norm_flag, graph_sym, connect_label,@
anchor, conflict_flag, display_type, eval_flag )
 
/*
 Define variables for new load type for target type 2 ( 2D elements ).
*/
targ_elem_dim = 2
variable_label = “Scalar Variable Id 1”
variable_id = 1
display_order = 1
data_type = 3
scal_or_vect = 0
norm_flag = 0
graph_sym(1) = 102
graph_sym(2) = 0
graph_sym(3) = 0
connect_label(1) = 0
connect_label(2) = 0
connect_label(3) = 0
connect_label(4) = 0
anchor(1) = 0
anchor(2) = 0
anchor(3) = 0
conflict_flag = 1
display_type(1) = 1
display_type(2) = 0
display_type(3) = 0
eval_flag = 0
 
lbc_defn_create.lbc_var_defn( load_id, category, targ_elem_dim, @
variable_label, variable_id, display_order, data_type,@
scal_or_vect, null_flag, norm_flag, graph_sym, connect_label,@
anchor, conflict_flag, display_type, eval_flag )
 
variable_label = “Vector Variable Id 2”
variable_id = 2
display_order = 2
data_type = 3
scal_or_vect = 1
norm_flag = 0
graph_sym(1) = 1
graph_sym(2) = 0
graph_sym(3) = 0
connect_label(1) = 0
connect_label(2) = 0
connect_label(3) = 0
connect_label(4) = 0
anchor(1) = 1
anchor(2) = 0
anchor(3) = 0
conflict_flag = 1
display_type(1) = 1
display_type(2) = 0
display_type(3) = 0
eval_flag = 0
 
lbc_defn_create.lbc_var_defn( load_id, category, targ_elem_dim, @
variable_label, variable_id, display_order, data_type,@
scal_or_vect, null_flag, norm_flag, graph_sym, connect_label,@
anchor, conflict_flag, display_type, eval_flag )
/*
 Associate new load type and categories to analysis code NASTRAN.
*/
analy_code_id = 1
categories(1) = 2
categories(2) = 0
categories(3) = 0
db_add_lbc_defn_for_ac( analy_code_id, load_id, 3, categories )
 
END FUNCTION
 
Example 3:
This is the complete code to create a new load type with:
1. 2 application regions and valid FEM targets of nodes or 2D elements.
2. nodes and 2D elements valid in application region 1, and nodes in region 1 associated to nodes or 2D elements in region 2, and 2D elements in region 1 associated to nodes or 2D elements in region 2.
3. 1 vector variable labeled with a single headed arrow and its magnitude.
4. the application regions connected and labeled with the LBC set name.
 
FUNCTION define_my_2app_load_type ( load_id )
 
STRING load_name[31], option_name[31]
STRING inp_data_pcl[31], app_region_data_pcl[31]
STRING variable_label[31]
STRING appl_reg_labels[31](2)
INTEGER load_id, app_ids(2)
STRING geo_datatypes[31](5,2), fem_datatypes[31](5,2)
INTEGER analy_type_id, applic_type, glob_flag, coord_flag, @
graph_sym(3), scal_or_vect, null_flag, def_color, color_box, @
n_app_region, no_data_flag, target_elem_flag, dyn_data_form, @
acid_mod, equiv_flag
INTEGER targ_elem_dim, variable_id, display_order, data_type, @
norm_flag, connect_label(4), anchor(3), conflict_flag, @
display_type(3), eval_flag, category, type_count, @
categories(3), analy_code_id
LOGICAL node_flags(6) 
LOGICAL zero_d_flags(6)
LOGICAL one_d_flags(6)
LOGICAL two_d_flags(6)
LOGICAL three_d_flags(6)
 
 
/*
 Define new load type.
*/
load_name = “New 2 App Type”
option_name = ““
analy_type_id = 1
applic_type = 1
glob_flag = 0
coord_flag = 0
scal_or_vect = 2
null_flag = 0
def_color = 2
color_box = 626
n_app_region = 2
appl_reg_labels(1) = “App Region 1”
appl_reg_labels(2) = “App Region 2”
no_data_flag = 0
inp_data_pcl = ““
app_region_data_pcl = ““
target_elem_flag = 1
dyn_data_form = 1
acid_mod = 0
equiv_flag = 0
 
lbc_defn_create.lbc_defn( load_name, option_name, analy_type_id, @
applic_type, glob_flag, coord_flag, scal_or_vect, null_flag, @
def_color,color_box, n_app_region, appl_reg_labels, @
no_data_flag, @
inp_data_pcl, app_region_data_pcl, target_elem_flag, @
dyn_data_form, acid_mod, equiv_flag, load_id )
 
/*
 Define valid targets for new load type.
*/
category = 2
type_count = 6
 
node_flags(1) = TRUE
zero_d_flags(1) = FALSE
one_d_flags(1) = FALSE
two_d_flags(1) = TRUE
three_d_flags(1) = FALSE
 
node_flags(2) = TRUE
zero_d_flags(2) = FALSE
one_d_flags(2) = FALSE
two_d_flags(2) = TRUE
three_d_flags(2) = FALSE
 
node_flags(3) = FALSE
zero_d_flags(3) = FALSE
one_d_flags(3) = FALSE
two_d_flags(3) = FALSE
three_d_flags(3) = FALSE
 
node_flags(4) = FALSE
zero_d_flags(4) = FALSE
one_d_flags(4) = FALSE
two_d_flags(4) = FALSE
three_d_flags(4) = FALSE
 
node_flags(5) = TRUE
zero_d_flags(5) = FALSE
one_d_flags(5) = FALSE
two_d_flags(5) = TRUE
three_d_flags(5) = FALSE
 
node_flags(6) = FALSE
zero_d_flags(6) = FALSE
one_d_flags(6) = FALSE
two_d_flags(6) = FALSE
three_d_flags(6) = FALSE
 
app_ids(1) = 1
app_ids(2) = 2
 
 
geo_datatypes(1,1) = “GEO_NODAL”
geo_datatypes(2,1) = ““
geo_datatypes(3,1) = “GEO_BEAM”
geo_datatypes(4,1) = “GEO_SHELL_BNDRY”
geo_datatypes(5,1) = “GEO_SOLID_BNDRY”
fem_datatypes(1,1) = “FEM_NODAL”
fem_datatypes(2,1) = ““
fem_datatypes(3,1) = “BEAMELEM”
fem_datatypes(4,1) = “FEM_SHELL_BNDRY”
fem_datatypes(5,1) = “FEM_SOLID_BNDRY”
 
geo_datatypes(1,2) = “GEO_NODAL”
geo_datatypes(2,2) = ““
geo_datatypes(3,2) = “GEO_BEAM”
geo_datatypes(4,2) = “GEO_SHELL_SIDE_BNDRY”
geo_datatypes(5,2) = “GEO_SOLID_BNDRY”
fem_datatypes(1,2) = “FEM_NODAL”
fem_datatypes(2,2) = ““
fem_datatypes(3,2) = “BEAMELEM”
fem_datatypes(4,2) = “FEM_SHELL_SIDE_BNDRY”
fem_datatypes(5,2) = “FEM_SOLID_BNDRY”
 
lbc_defn_create.valid_targets( load_id, category, type_count, @
node_flags, zero_d_flags, one_d_flags, two_d_flags, @
three_d_flags, @
n_app_region, app_ids, geo_datatypes, fem_datatypes )
 
 
/*
 Define variables for new load type for target type 0 ( nodal ).
*/
targ_elem_dim = 0
variable_label = “Vector Variable”
variable_id = 1
display_order = 1
data_type = 3
scal_or_vect = 1
norm_flag = 0
graph_sym(1) = 1
graph_sym(2) = 1
graph_sym(3) = 0
connect_label(1) = 1
connect_label(2) = 3
connect_label(3) = 0
connect_label(4) = 0
anchor(1) = 1
anchor(2) = 1
anchor(3) = 0
conflict_flag = 1
display_type(1) = 1
display_type(2) = 1
display_type(3) = 0
eval_flag = 0
 
lbc_defn_create.lbc_var_defn( load_id, category, targ_elem_dim, @
variable_label, variable_id, display_order, data_type,@
scal_or_vect, @
null_flag, norm_flag, graph_sym, connect_label, anchor, @
conflict_flag, display_type, eval_flag )
 
 
/*
 Define variables for new load type for target type 2 ( 2D elements ).
*/
targ_elem_dim = 2
variable_label = “Vector Variable Id 2”
variable_id = 1
display_order = 1
data_type = 3
scal_or_vect = 1
norm_flag = 0
graph_sym(1) = 1
graph_sym(2) = 1
graph_sym(3) = 0
connect_label(1) = 1
connect_label(2) = 3
connect_label(3) = 0
connect_label(4) = 0
anchor(1) = 1
anchor(2) = 1
anchor(3) = 0
conflict_flag = 1
display_type(1) = 1
display_type(2) = 1
display_type(3) = 0
eval_flag = 0
 
lbc_defn_create.lbc_var_defn( load_id, category, targ_elem_dim, @
variable_label, variable_id, display_order, data_type,@
scal_or_vect, @
null_flag, norm_flag, graph_sym, connect_label, anchor, @
conflict_flag, display_type, eval_flag )
/*
 Associate new load type and categories to analysis code NASTRAN.
*/
analy_code_id = 1
categories(1) = 2
categories(2) = 0
categories(3) = 0
db_add_lbc_defn_for_ac( analy_code_id, load_id, 3, categories )
 
END FUNCTION