CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Output the coordinates of all grids in a cellset

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2023, 03:46
Default Output the coordinates of all grids in a cellset
  #1
New Member
 
LTS
Join Date: Mar 2023
Posts: 1
Rep Power: 0
Lits is on a distinguished road
Has anyone ever output the coordinates of all the grids in a celset in openfoam, or any other information about the grids?

#include "fvCFD.H"
//#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "subCycle.H"
//#include "immiscibleIncompressibleTwoPhaseMixture.H"
//#include "turbulentTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "fvcSmooth.H"
#include <iomanip>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// -------------INPUT PARAMETERS ---------------------


int main(int argc, char *argv[])
{
timeSelector::addOptions();

#include "setRootCase.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createMesh.H"
//#include "cellZoneSet.H"
#include "mapPolyMesh.H"
#include "polyMesh.H"

//=========finding grids ========

labelList cellZoneID = mesh.cellZones().findIndices("anodeGDL");
Info << "cellZoneID = " << cellZoneID << endl;
label cellZoneID2 = mesh.cellZones().findZoneID("flow");
Info << "cellZoneID2 = " << cellZoneID2 << endl;
const cellZone& cz = mesh.cellZones()[cellZoneID];
const labelList& cells = mesh.cellZones()[cellZoneID[0]];;
forAll(cells, i)
{

label celli = cells[i];
Info << "1" << endl;
}



return 0;
//}
}

I tried the above code and it compiles successfully, but it runs with an error:


#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 ? in "/home/lts/OpenFOAM/lts-6/platforms/linux64GccDPInt32Opt/bin/setBINDER2_invert"
#3 ? in "/home/lts/OpenFOAM/lts-6/platforms/linux64GccDPInt32Opt/bin/setBINDER2_invert"
#4 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#5 ? in "/home/lts/OpenFOAM/lts-6/platforms/linux64GccDPInt32Opt/bin/setBINDER2_invert"
Aborted (core dumped)

I will be appreciate for any advice.
Lits is offline   Reply With Quote

Reply

Tags
cellsets, grids information


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] outputTime in Swak function immortality OpenFOAM Community Contributions 20 October 6, 2022 12:08
irregular model simulation with chtMultiregionFoam lg88 OpenFOAM 59 July 28, 2016 11:44
How to control output time of pressureTools functions? Fluido OpenFOAM Post-Processing 1 May 19, 2014 08:49
RNG diverged during the analysis the flow over a multi element airfoil, why? s.m OpenFOAM Running, Solving & CFD 0 August 5, 2013 08:39
.setSet problems Grimoli OpenFOAM 9 July 31, 2013 13:24


All times are GMT -4. The time now is 23:59.