|
[Sponsors] |
Operate on volScalarField as whole v access elements |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 14, 2012, 09:19 |
Operate on volScalarField as whole v access elements
|
#1 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Hi all,
If I have a volScalarField that is formed by doing something (adding, dividing, taking square roots etc) of some other volScalarFields, should I do those operations element by element, or on the whole thing at one go? I have the element by element version implemented, and was wondering if I could get a speedup by using the other option. |
|
November 29, 2012, 09:25 |
|
#2 |
Senior Member
|
Hi adhiraj,
Yes you can do it as a whole. For some example you can see the yPlus utility and check how yPlus is being calculated. Can you kindly share how did you do all the operations element wise. regards, Awais |
|
November 29, 2012, 13:35 |
|
#3 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Yes, I found that I can operate on the whole thing at once, too.
I did that and I don't know if it is more efficient or anything--the code is certainly cleaner and easier to read. I did something like Code:
A.internalField()[celli]=std::sqrt(B.internalField()[celli]); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Hybrid mesh for 2D boundary layer | Bigio | ANSYS Meshing & Geometry | 33 | November 18, 2019 10:15 |
Access a volScalarField from BC code | Hisham | OpenFOAM Programming & Development | 6 | November 25, 2011 16:33 |
Penetrating elements in extruded mesh | Michael P | CFX | 2 | May 20, 2005 09:06 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |