|
[Sponsors] |
November 21, 2018, 10:25 |
difference volVectorField and vectorField
|
#1 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 10 |
Hello everyone,
I am quite new to OpenFOAM, and I have some issues understanding the difference between vectorField and volVectorField, can anyone help me understand ? Thank you very much Annan |
|
December 13, 2018, 07:59 |
|
#2 |
New Member
Karl Yang
Join Date: Jul 2016
Posts: 11
Rep Power: 10 |
||
January 4, 2019, 03:32 |
|
#3 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
The Field class is just a List with reference counting. So vectorField is really just a list of vectors.
The volVectorField contains the vectors for each cell (the internal field) and a list of ones for each boundary patch. It probably makes sense if you look at the source code documentation. |
|
January 4, 2019, 04:03 |
|
#4 | |
New Member
Karl Yang
Join Date: Jul 2016
Posts: 11
Rep Power: 10 |
Quote:
Thank you Olesen for your replying. I also found some documents sharing the same idea that vectorField is only a list of vectors without geometric information, while volVectorField does. Thank you for confirming that. I think vectorField is a base class which derived to volVectorField, while itself probably is not very useful for users? Regards Juntao |
||
January 8, 2019, 04:28 |
|
#5 |
Senior Member
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 119
Rep Power: 14 |
A vectorField can certainly be useful, for instance for working with boundary data but not only. Compared to a List, besides for reference counting mentioned by Mark, a Field also has all sorts of mathematical operations implemented.
|
|
May 7, 2021, 19:06 |
|
#6 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
In the Programmer's Guide, they talk about list<type> and Field<type>.
For example, list<vector> and Field<vector>. Does anyone know what the difference is between these two classes? |
|
May 11, 2021, 06:00 |
|
#7 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
I am going to answer my own question for future reference:
List<Type> is simply a 1-D array of type "Type", while Field<Type> is a generic template for creating a list of classes of type "Type". |
|
May 11, 2021, 15:19 |
|
#8 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Edit: I just realised that I even answered almost the same thing about 2 years ago (in the same thread!!) but apparently nobody reads it. Really makes me wonder why I bother |
||
May 12, 2021, 14:49 |
|
#9 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
Thanks;
Don't get discouraged, Mark. You are doing a great job. But, if you think you already have answered one particular question, you can just reference that answer for the possible future similar questions. |
|
July 5, 2022, 03:26 |
|
#10 | |
Member
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 35
Rep Power: 6 |
Quote:
A list of cell vertex point coordinate vectors, i.e. a vectorField, that is renamed pointField using a typedef declaration; So is it correct to understand this as "a Field being a collection of lists"?
__________________
Best Regards Uttam ----------------------------------------------------------------- “When everything seem to be going against you, remember that the airplane takes off against the wind, not with it.” – Henry Ford. |
||
July 5, 2022, 06:53 |
|
#11 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Not quite. A vector (or point) is more like a struct of three values (not a list). |
||
Tags |
openfoam 1712, openfoam 1806, programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dot product of vectorField and volVectorField | sahm | OpenFOAM | 2 | August 28, 2017 04:56 |
Multiplication of two volVectorField | ChGr | OpenFOAM Programming & Development | 1 | May 30, 2016 12:08 |
How to extract ONLY ONE Boundary data to make a VectorField File from volVectorField | hy1112006 | OpenFOAM Programming & Development | 2 | April 14, 2016 13:11 |
power of vectorField | matthias | OpenFOAM Programming & Development | 0 | August 19, 2014 09:52 |
Create a Vectorfield | joskate | OpenFOAM Pre-Processing | 0 | May 8, 2013 11:22 |