Setting force #3050
-
Hello everyone! VectorArrayCoefficient f(dim); There is these peace of code in ex2.cpp. Am I right if I say that vector "pull_force" defines the force which we apply to the surface and I need to set pull_force like here "pull_force(1) = -1.0e-2;" for each axis which are defined by VectorArrayCoeficient? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hello, The f is for the direction, e.g. x,y,z |
Beta Was this translation helpful? Give feedback.
-
Hi @Torubara-Oleg, The vector coefficient Lines 105 to 108 in 26a1809 If you want to apply nonzero forces in other components, restricted to some boundary attributes, you can use |
Beta Was this translation helpful? Give feedback.
-
Hi @v-dobrev I think I have a better understanding of what is going on. Lines 143 to 153 in ff7ed2e Here |
Beta Was this translation helpful? Give feedback.
Hi @Torubara-Oleg,
The vector coefficient
f
defines the force applied to all boundary elements. Using theVectorArrayCoefficient
sub-class ofVectorCoefficient
allows us to define its components as separate scalar coefficients. The first loop sets the first dim-1 components to 0 (for all boundary attributes). TheVector
pull_force
defines the last component (y in 2D, z in 3D) for the different boundary attributes: the first steppull_force = 0.0
initializes all entries of the array with 0, and the linepull_force(1) = -1.0e-2
overwrites the value for boundary attribute 2 -- the convention used byPWConstCoefficient
is that indexk
in the inputVector
corresponds to boundary attributek+1
,…