|
[Sponsors] |
August 28, 2016, 19:50 |
Reduce() and Size() functions
|
#1 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Dear Fellows
I have few questions regarding the following snippet: Code:
scalar ULeft = 0.0; label leftI = mesh().boundaryMesh().findPatchID("left"); const fvPatchVectorField& fvp = U.boundaryField()[leftI]; if (fvp.size()) { ULeft = fvp[0].x(); } reduce(ULeft, maxOp<scalar>()); I assume the size of fvp is non-zero, so the "if" loop executes. My first question is on Code:
ULeft = fvp[0].x(); here, fvp is an array of vectors, since it keeps the velocity vectors of a patch, but the above command just stores the first component ".x()" of first vector "[0]" in the array of vectors. Am I correct? For example assume fvp = { (1 2 3) (4 5 6) (7 8 9)} then fvp[0].x means 1 then why using the Code:
reduce(ULeft, maxOp<scalar>()); I assume that reduce() function with maxOp<scalar> finds the biggest scalar in an array of scalars, but here ULeft just has one member!!! (in my example 1) Am I missing sth? Regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reduce size of Ansys.rst file in FSI simulations? | Jorn | CFX | 6 | September 21, 2017 03:00 |
[ANSYS Meshing] Reduce mesh size only in one direction | peppe7 | ANSYS Meshing & Geometry | 0 | January 29, 2016 13:22 |
How to reduce size of autosaved .sim-files? | adbuerger | STAR-CCM+ | 8 | October 12, 2015 09:36 |
How can reduce the size of figures in Ms Word | immortality | Lounge | 1 | February 6, 2014 03:24 |
Reduce output file size!! | Jonac | CFX | 1 | September 15, 2000 03:24 |