|
[Sponsors] |
February 14, 2018, 06:26 |
Set values of a volVectorField to zero
|
#1 |
New Member
Join Date: Jan 2018
Posts: 5
Rep Power: 8 |
Hey there,
maybe you can help me with the following problem I'm currently dealing with: In my solver, I defined a volScalarField border which only contains the values 0 and 1. Now I would like to set the values of a volVectorField U to zero, but only in the cells where the value of border is 1. So far, I'm doing this with a forAll-loop, as follows: Code:
forAll(U,i) { if(border[i] == 1) { U[i].component(0) = 0; U[i].component(1) = 0; U[i].component(2) = 0; } } Code:
if(border == 1) { U = 0; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
correction of Grub after installing Windows XP and 8 | immortality | Lounge | 20 | January 5, 2014 17:41 |
Instalation on ubuntu 710 | basilwatson | OpenFOAM Installation | 17 | March 16, 2012 20:16 |
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found | piprus | OpenFOAM Installation | 22 | February 25, 2010 13:43 |
Set nonuniform boundary values | nikwin | OpenFOAM Running, Solving & CFD | 1 | November 30, 2008 07:12 |
Help with GNUPlot | Renato. | Main CFD Forum | 6 | June 6, 2007 19:51 |