mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- can help when designing/debugging blockMesh layouts - propagate low-level cellModel methods face() and edge() to cellShape STYLE: relocate blockMesh OBJ output to application only - remove blockTopology files in cleanCase function - improve code consistency in top-level blockMesh, PDRblockMesh generation.
55 lines
1.6 KiB
C
55 lines
1.6 KiB
C
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | www.openfoam.com
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
Copyright (C) 2020 OpenCFD Ltd.
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
|
|
|
Description
|
|
OBJ output of blockMesh topology blocks
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
{
|
|
const polyMesh& topoMesh = blocks.topology();
|
|
|
|
// Write mesh as edges
|
|
{
|
|
OFstream os(runTime.path()/"blockTopology.obj");
|
|
|
|
Info<< "Writing block structure in obj format: "
|
|
<< os.name().name() << endl;
|
|
|
|
for (const point& p : topoMesh.points())
|
|
{
|
|
os << "v " << p.x() << ' ' << p.y() << ' ' << p.z() << nl;
|
|
}
|
|
|
|
for (const edge& e : topoMesh.edges())
|
|
{
|
|
os << "l " << e.start() + 1 << ' ' << e.end() + 1 << nl;
|
|
}
|
|
}
|
|
|
|
// Write centres of blocks
|
|
{
|
|
OFstream os(runTime.path()/"blockCentres.obj");
|
|
|
|
Info<< "Writing block centres in obj format: "
|
|
<< os.name().name() << endl;
|
|
|
|
for (const point& p : topoMesh.cellCentres())
|
|
{
|
|
os << "v " << p.x() << ' ' << p.y() << ' ' << p.z() << nl;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// ************************************************************************* //
|