Showing results for
Do you mean
Solved!

[ Edited ]

When using the feLoadMesh.addarray pressure method in my VBA code, I’m able to apply pressures normal to the element face.

However I would like to give them a direction as is possible for the Nastran solver (see Help) and for single element pressure application with feLoadMesh.add this is also possible. Manually this is also possible. But I can't get it working when loading the elements with arrays using the .addarray method.

How do I need to set / use this function in order to get a directional pressure component, not normal tot the element?

For example as a vector of (1, 1, 1 | X, Y, Z).

( count, doDOF, doValues, doFunctions, NodeElemID, DOF, Values, FunctionID )

Femap version 11.1

3 REPLIES
Solution
Solution
Accepted by topic author CRensen
‎03-04-2016 03:15 AM

Dear CRensen,

You can set direction directly in LoadMesh object, see example:

```    Dim pressureMesh As femap.LoadMesh
pressureMesh.fluxdir(0) = 1; 'x
pressureMesh.fluxdir(1) = 1; 'y
pressureMesh.fluxdir(2) = 1; 'z```

Yarko

Solution
Solution
Accepted by topic author CRensen
‎03-04-2016 03:15 AM

Added to that, you should also set

`pressureMesh.flag(1) = True`

Below a simple example thanks to Andy Haines:

```Sub Main
Dim App As femap.model
Set App = feFemap()

Dim eset As femap.Set
Set eset = App.feSet

Dim elIDs As Variant
Dim DOFs As Variant
Dim Vals As Variant
Dim Funcs As Variant

elcount = eset.Count
elarray = elcount-1
DOFarray = (elcount*3)-1
ValArray = (elcount*5)-1
FuncArray = (elcount*5)-1

ReDim elIDs (elarray) As Long
ReDim DOFs (DOFarray) As Boolean
ReDim Vals (ValArray) As Double
ReDim Funcs (FuncArray) As Long

'Specify the directional vector using fluxdir
'Specify dX value
'Specify dY value
'Specify dZ value

'Specify Face ID

'Set Falg(1) to True to designate "Specify Direction" option for pressures

i = 0
While eset.Next
elIDs(i) = eset.CurrentID
Vals(i*5) = (i*0.1)+0.1
Vals(i*5+1) = 0.0
Vals(i*5+2) = 0.0
Vals(i*5+3) = 0.0
Vals(i*5+4) = 0.0
i=i+1
Wend

End Sub```