|
[Sponsors] |
July 28, 2023, 01:32 |
Confusion about polyMesh constructor
|
#1 |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
Dear all,
This may be another stupid question, but I am so confued. So sorry to bother you. When we construct mesh object for manipulation such as Code:
Info<< mesh.cellVolumes() << endl; Code:
Foam::polyMesh mesh { IOobject ( defaultRegion, runTime.timeName(), runTime, IOobject::MUST_READ ) }; I am confused that the mesh is supposed to relate to [constant/polyMesh/] directly rather than [time] directory, right? If not, how does the [mesh] object get information (such as points, faces) from [constant/polyMesh] directory? Thank you very much if any kind foamer could help me. Best regards, Ary |
|
July 28, 2023, 05:54 |
|
#2 |
Senior Member
|
Does https://github.com/UnnamedMoose/Basi.../OFtutorial3.C help you?
|
|
July 28, 2023, 09:00 |
|
#3 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,689
Rep Power: 40 |
Quote:
The simple counter question: how would you manage restarts from dynamic meshes is you always construct from time = constant? |
||
July 29, 2023, 09:32 |
|
#4 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14 |
Quote:
|
||
July 30, 2023, 21:08 |
|
#5 | |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
Quote:
I am so sorry. I didn't get it. I read the member functions before. But how the member functions work even [mesh] object didn't construct from [polyMesh] directory which really contains the poins, faces and cells? I am sorry my question was not clear before. |
||
July 30, 2023, 21:15 |
|
#6 | |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
Quote:
Thank you for your question. I don't know anything about dynamic mesh yet. Maybe construct from two both, time and constant/polyMesh ? I just wonder why the constructor doesn't include [polyMesh] parameter. I am sorry I am a new foamer and if I make my question stupid. |
||
July 31, 2023, 10:51 |
|
#7 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,689
Rep Power: 40 |
If you read that constructing from timeName() also includes searching back in time until it reaches some valid mesh date, you'll recognize that timeName() also includes constant().
In addition to a static mesh (where everything is defined as "constant" and doesn't change) it is possible to have meshes with changing topologies and meshes in which only the points move, but the connectivity stays the same. These last ones are covered by the difference in points and face instances (if you are examining the code). |
|
July 31, 2023, 20:13 |
|
#8 | |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
Quote:
|
||
August 1, 2023, 03:40 |
|
#9 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,689
Rep Power: 40 |
||
August 6, 2023, 21:45 |
|
#10 |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding a Constructor to ThermoCloud | schradc | OpenFOAM Programming & Development | 0 | February 4, 2023 21:15 |
eigenValues of volTensorField | xuegy | OpenFOAM Programming & Development | 8 | February 26, 2021 16:46 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 00:21 |
[snappyHexMesh] How to define to right point for locationInMesh | Mirage12 | OpenFOAM Meshing & Mesh Conversion | 7 | March 13, 2016 14:07 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 10:56 |