diff --git a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C index 9d2d858174..b82b4d3010 100644 --- a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C +++ b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C @@ -204,7 +204,8 @@ Foam::Function1Types::CSV::CSV ( const word& entryName, const dictionary& dict, - const word& ext + const word& ext, + const fileName& fName ) : TableBase(entryName, dict.subDict(entryName + ext)), @@ -214,7 +215,7 @@ Foam::Function1Types::CSV::CSV componentColumns_(coeffs_.lookup("componentColumns")), separator_(coeffs_.lookupOrDefault("separator", string(","))[0]), mergeSeparators_(readBool(coeffs_.lookup("mergeSeparators"))), - fName_(coeffs_.lookup("fileName")) + fName_(fName != fileName::null ? fName : coeffs_.lookup("fileName")) { if (componentColumns_.size() != pTraits::nComponents) { diff --git a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.H b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.H index 97e0047a2b..ddba48afa5 100644 --- a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.H +++ b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.H @@ -122,7 +122,8 @@ public: ( const word& entryName, const dictionary& dict, - const word& ext = "Coeffs" + const word& ext = "Coeffs", + const fileName& fName = fileName::null ); //- Copy constructor diff --git a/src/conversion/ensight/part/ensightPartFaces.C b/src/conversion/ensight/part/ensightPartFaces.C index 4875b19cfb..5760324826 100644 --- a/src/conversion/ensight/part/ensightPartFaces.C +++ b/src/conversion/ensight/part/ensightPartFaces.C @@ -48,10 +48,10 @@ Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const labelList& usedPoints = ptList.list; label nPoints = 0; - // add all points from faces + // Add all points from faces const labelUList& idList = this->faceIds(); - // add all points from faces + // Add all points from faces forAll(idList, i) { const label id = idList[i] + start_; @@ -67,7 +67,7 @@ Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const } - // this is not absolutely necessary, but renumber anyhow + // This is not absolutely necessary, but renumber anyhow nPoints = 0; forAll(usedPoints, ptI) { @@ -101,7 +101,7 @@ Foam::ensightPartFaces::ensightPartFaces points_(points), contiguousPoints_(contiguousPoints) { - // classify the face shapes + // Classify the face shapes classify(faces); } @@ -121,7 +121,7 @@ Foam::ensightPartFaces::ensightPartFaces points_(mesh.points()), contiguousPoints_(false) { - // classify the face shapes + // Classify the face shapes classify(patch); } @@ -149,10 +149,10 @@ void Foam::ensightPartFaces::writeConnectivity os.write(idList.size()); os.newline(); - // write (polygon) face sizes + // Write (polygon) face sizes if (key == "nsided") { - // write the number of points per face + // Write the number of points per face forAll(idList, i) { const label id = idList[i] + start_; @@ -163,13 +163,13 @@ void Foam::ensightPartFaces::writeConnectivity } } - // write the points describing the face + // Write the points describing the face forAll(idList, i) { const label id = idList[i] + start_; const face& f = faces[id]; - // convert global -> local index + // Convert global -> local index // (note: Ensight indices start with 1) forAll(f, fp) { @@ -205,7 +205,7 @@ void Foam::ensightPartFaces::write const pointField& points ) const { - if (ensightPart::size()) + if (size()) { const localPoints ptList = calcLocalPoints(); const labelUList& pointMap = ptList.list; diff --git a/src/conversion/ensight/part/ensightPartFaces.H b/src/conversion/ensight/part/ensightPartFaces.H index 974ca68a05..bdb6c062c8 100644 --- a/src/conversion/ensight/part/ensightPartFaces.H +++ b/src/conversion/ensight/part/ensightPartFaces.H @@ -138,44 +138,43 @@ public: // Member Functions - // Access + // Access - //- Part index (0-based) - virtual label index() const - { - return ensightFaces::index(); - } + //- Part index (0-based) + virtual label index() const + { + return ensightFaces::index(); + } - //- Number of elements in this part - virtual label size() const - { - return ensightFaces::size(); - } + //- Number of elements in this part + virtual label size() const + { + return ensightFaces::size(); + } - //- Return the patch index, -1 when not in use. - inline label patchIndex() const - { - return patchIndex_; - } + //- Return the patch index, -1 when not in use. + inline label patchIndex() const + { + return patchIndex_; + } - // Output + // Output - //- Write summary information about the object - virtual void writeSummary(Ostream&) const; + //- Write summary information about the object + virtual void writeSummary(Ostream&) const; - //- Write geometry - virtual void write(ensightGeoFile&) const; + //- Write geometry + virtual void write(ensightGeoFile&) const; - //- Helper: write geometry given the pointField - virtual void write(ensightGeoFile&, const pointField&) const; + //- Helper: write geometry given the pointField + virtual void write(ensightGeoFile&, const pointField&) const; - //- Print various types of debugging information - virtual void dumpInfo(Ostream&) const; - + //- Print various types of debugging information + virtual void dumpInfo(Ostream&) const; }; diff --git a/src/fileFormats/ensight/part/ensightFaces.H b/src/fileFormats/ensight/part/ensightFaces.H index dfb16859c0..ddce1410d8 100644 --- a/src/fileFormats/ensight/part/ensightFaces.H +++ b/src/fileFormats/ensight/part/ensightFaces.H @@ -132,83 +132,82 @@ public: // Member Functions - // Access + // Access - //- The index in a list. - inline label index() const; + //- The index in a list. + inline label index() const; - //- The index in a list, non-const access. - inline label& index(); + //- The index in a list, non-const access. + inline label& index(); - //- The processor local size of all elements. - inline label size() const; + //- The processor local size of all elements. + inline label size() const; - //- The global number of the specified element type. - // This value is only meaningful after a reduce operation. - inline label total(const enum elemType) const; + //- The global number of the specified element type. + // This value is only meaningful after a reduce operation. + inline label total(const enum elemType) const; - //- The global number of all element types. - // This value is only meaningful after a reduce operation. - label total() const; + //- The global number of all element types. + // This value is only meaningful after a reduce operation. + label total() const; - //- The processor local sizes per element type. - FixedList sizes() const; + //- The processor local sizes per element type. + FixedList sizes() const; - //- The global numbers per element type. - // This value is only meaningful after a reduce operation. - const FixedList& totals() const; + //- The global numbers per element type. + // This value is only meaningful after a reduce operation. + const FixedList& totals() const; - //- Return the (local) face ids of the specified element type - inline const labelUList& faceIds(const enum elemType) const; + //- Return the (local) face ids of the specified element type + inline const labelUList& faceIds(const enum elemType) const; - //- Return the face ids of all elements - inline const labelUList& faceIds() const; + //- Return the face ids of all elements + inline const labelUList& faceIds() const; - //- Return the flip-map of all elements - inline const boolList& flipMap() const; + //- Return the flip-map of all elements + inline const boolList& flipMap() const; - //- Starting offset of element type. - label offset(const enum elemType what) const; + //- Starting offset of element type. + label offset(const enum elemType what) const; - // Edit + // Edit - //- Classify the face types, set element list. - void classify(const faceList& faces); + //- Classify the face types, set element list. + void classify(const faceList& faces); - //- Classify the face types, set element list. - // The indirect addressing can be used when classifying groups of - // face (eg, from a faceZone etc) with an optional flipMap. - // The optional exclude marker can be used to skip faces on particular - // boundary types or regions. - void classify - ( - const faceList& faces, - const labelUList& addressing, - const boolList& flipMap = boolList(), - const PackedBoolList& exclude = PackedBoolList() - ); + //- Classify the face types, set element list. + // The indirect addressing can be used when classifying groups of + // face (eg, from a faceZone etc) with an optional flipMap. + // The optional exclude marker can be used to skip faces on particular + // boundary types or regions. + void classify + ( + const faceList& faces, + const labelUList& addressing, + const boolList& flipMap = boolList(), + const PackedBoolList& exclude = PackedBoolList() + ); - //- Set addressable sizes to zero, free up addressing memory. - void clear(); + //- Set addressable sizes to zero, free up addressing memory. + void clear(); - //- Sum element counts across all processes. - void reduce(); + //- Sum element counts across all processes. + void reduce(); - //- Sort element lists numerically. - void sort(); + //- Sort element lists numerically. + void sort(); // Member operators //- Return element from linear-list. inline label operator[](const label i) const; - }; diff --git a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C index 21d52bb3dd..ae80887fe8 100644 --- a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C +++ b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C @@ -94,17 +94,41 @@ Foam::label Foam::noiseModel::findStartTimeIndex // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::noiseModel::noiseModel(const dictionary& dict) +Foam::noiseModel::noiseModel(const dictionary& dict, const bool readFields) : dict_(dict), - rhoRef_(dict.lookupOrDefault("rhoRef", 1)), - nSamples_(dict.lookupOrDefault