mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: provide faMesh static accessors for registry and single-region
- the fields for finite-area are currently stored directly on the polyMesh registry, but for future relocation to a sub-registry provide a uniform accessor. ENH: use thisDb() for faMatrix access and extrapolatedCalculated
This commit is contained in:
@ -148,18 +148,24 @@ bool Foam::areaWrite::read(const dictionary& dict)
|
||||
|
||||
verbose_ = dict.getOrDefault("verbose", false);
|
||||
|
||||
// Registry containing all finite-area meshes on the polyMesh
|
||||
const auto* faRegistry = faMesh::registry(mesh_);
|
||||
|
||||
dict.readIfPresent("areas", selectAreas_);
|
||||
|
||||
if (selectAreas_.empty())
|
||||
{
|
||||
word areaName;
|
||||
|
||||
if (!dict.readIfPresent("area", areaName))
|
||||
{
|
||||
wordList available = obr().sortedNames<faMesh>();
|
||||
|
||||
if (available.size())
|
||||
if (faRegistry)
|
||||
{
|
||||
areaName = available.front();
|
||||
wordList available = faRegistry->sortedNames<faMesh>();
|
||||
if (!available.empty())
|
||||
{
|
||||
areaName = available.front();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +177,12 @@ bool Foam::areaWrite::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
// Restrict to specified meshes
|
||||
meshes_ = obr().csorted<faMesh>(selectAreas_);
|
||||
meshes_.clear();
|
||||
|
||||
if (faRegistry)
|
||||
{
|
||||
meshes_ = faRegistry->csorted<faMesh>(selectAreas_);
|
||||
}
|
||||
|
||||
dict.readEntry("fields", fieldSelection_);
|
||||
fieldSelection_.uniq();
|
||||
@ -252,7 +263,7 @@ bool Foam::areaWrite::write()
|
||||
|
||||
selected.clear();
|
||||
|
||||
IOobjectList objects(0);
|
||||
IOobjectList objects;
|
||||
|
||||
if (loadFromFiles_)
|
||||
{
|
||||
@ -279,7 +290,7 @@ bool Foam::areaWrite::write()
|
||||
{
|
||||
if (!ListOps::found(allFields, fieldSelection_[i]))
|
||||
{
|
||||
missed.append(i);
|
||||
missed.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,8 +315,8 @@ bool Foam::areaWrite::write()
|
||||
|
||||
if
|
||||
(
|
||||
fieldTypes::area.found(clsName)
|
||||
|| fieldTypes::area_internal.found(clsName)
|
||||
fieldTypes::area.contains(clsName)
|
||||
|| fieldTypes::area_internal.contains(clsName)
|
||||
)
|
||||
{
|
||||
nAreaFields += n;
|
||||
|
||||
@ -75,8 +75,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef areaWrite_H
|
||||
#define areaWrite_H
|
||||
#ifndef Foam_areaWrite_H
|
||||
#define Foam_areaWrite_H
|
||||
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "polyMesh.H"
|
||||
@ -191,8 +191,8 @@ public:
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Construct for given objectRegistry and dictionary
|
||||
// allow the possibility to load fields from files
|
||||
//- Construct for given objectRegistry and dictionary.
|
||||
//- Allow the possibility to load fields from files
|
||||
areaWrite
|
||||
(
|
||||
const word& name,
|
||||
|
||||
Reference in New Issue
Block a user