diff --git a/src/sampling/sampledSet/arcUniform/arcUniform.H b/src/sampling/sampledSet/arcUniform/arcUniform.H index fac3237ffb..aaf86d9c18 100644 --- a/src/sampling/sampledSet/arcUniform/arcUniform.H +++ b/src/sampling/sampledSet/arcUniform/arcUniform.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,6 +118,7 @@ class arcUniform //- Uses calcSamples to obtain samples and copies them into *this void genSamples(); + public: //- Runtime type information @@ -136,7 +137,7 @@ public: ); - // Destructor + //- Destructor virtual ~arcUniform(); }; diff --git a/src/sampling/sampledSet/cellSetSampledSet/cellSetSampledSet.H b/src/sampling/sampledSet/cellSetSampledSet/cellSetSampledSet.H index 44a427957f..9193a99f02 100644 --- a/src/sampling/sampledSet/cellSetSampledSet/cellSetSampledSet.H +++ b/src/sampling/sampledSet/cellSetSampledSet/cellSetSampledSet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,9 +97,8 @@ public: ); - // Destructor - - virtual ~cellSetSampledSet(); + //- Destructor + virtual ~cellSetSampledSet(); }; diff --git a/src/sampling/sampledSet/circleRandom/circleRandom.H b/src/sampling/sampledSet/circleRandom/circleRandom.H index 56afcc85da..0fbd7a719d 100644 --- a/src/sampling/sampledSet/circleRandom/circleRandom.H +++ b/src/sampling/sampledSet/circleRandom/circleRandom.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,9 +123,8 @@ public: ); - // Destructor - - virtual ~circleRandom(); + //- Destructor + virtual ~circleRandom(); }; diff --git a/src/sampling/sampledSet/faceSetSampledSet/faceSetSampledSet.H b/src/sampling/sampledSet/faceSetSampledSet/faceSetSampledSet.H index 9fb3fca9b0..8a463e957f 100644 --- a/src/sampling/sampledSet/faceSetSampledSet/faceSetSampledSet.H +++ b/src/sampling/sampledSet/faceSetSampledSet/faceSetSampledSet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,9 +97,8 @@ public: ); - // Destructor - - virtual ~faceSetSampledSet(); + //- Destructor + virtual ~faceSetSampledSet(); }; diff --git a/src/sampling/sampledSet/sphereRandom/sphereRandom.H b/src/sampling/sampledSet/sphereRandom/sphereRandom.H index 7fa7a0dbd5..4c98f412da 100644 --- a/src/sampling/sampledSet/sphereRandom/sphereRandom.H +++ b/src/sampling/sampledSet/sphereRandom/sphereRandom.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,9 +118,8 @@ public: ); - // Destructor - - virtual ~sphereRandom(); + //- Destructor + virtual ~sphereRandom(); }; diff --git a/src/sampling/sampledSet/writers/csv/csvSetWriter.C b/src/sampling/sampledSet/writers/csv/csvSetWriter.C index 469e5b054b..fbfbaf103c 100644 --- a/src/sampling/sampledSet/writers/csv/csvSetWriter.C +++ b/src/sampling/sampledSet/writers/csv/csvSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,6 +72,13 @@ Foam::csvSetWriter::csvSetWriter(const dictionary& dict) {} +Foam::csvSetWriter::csvSetWriter(const csvSetWriter& writer) +: + setWriter(writer), + separator_(writer.separator_) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::csvSetWriter::~csvSetWriter() diff --git a/src/sampling/sampledSet/writers/csv/csvSetWriter.H b/src/sampling/sampledSet/writers/csv/csvSetWriter.H index 335bb34c00..739a85e8c4 100644 --- a/src/sampling/sampledSet/writers/csv/csvSetWriter.H +++ b/src/sampling/sampledSet/writers/csv/csvSetWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,15 @@ public: //- Construct from dictionary csvSetWriter(const dictionary& dict); + //- Construct copy + csvSetWriter(const csvSetWriter& writer); + + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr(new csvSetWriter(*this)); + } + //- Destructor virtual ~csvSetWriter(); diff --git a/src/sampling/sampledSet/writers/ensight/ensightSetWriter.H b/src/sampling/sampledSet/writers/ensight/ensightSetWriter.H index f90ac2dc0d..e8d8001c83 100644 --- a/src/sampling/sampledSet/writers/ensight/ensightSetWriter.H +++ b/src/sampling/sampledSet/writers/ensight/ensightSetWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,6 +60,12 @@ public: //- Inherit constructors using setWriter::setWriter; + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr(new ensightSetWriter(*this)); + } + //- Destructor virtual ~ensightSetWriter(); diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H index b8e031085d..9f7b0b7594 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H +++ b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,6 +61,12 @@ public: //- Inherit constructors using setWriter::setWriter; + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr(new gnuplotSetWriter(*this)); + } + //- Destructor virtual ~gnuplotSetWriter(); diff --git a/src/sampling/sampledSet/writers/none/noSetWriter.H b/src/sampling/sampledSet/writers/none/noSetWriter.H index d59b1bbdf9..eaf8ef59e5 100644 --- a/src/sampling/sampledSet/writers/none/noSetWriter.H +++ b/src/sampling/sampledSet/writers/none/noSetWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,6 +61,12 @@ public: //- Inherit constructors using setWriter::setWriter; + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr(new noSetWriter(*this)); + } + //- Destructor virtual ~noSetWriter(); diff --git a/src/sampling/sampledSet/writers/raw/rawSetWriter.C b/src/sampling/sampledSet/writers/raw/rawSetWriter.C index 104f4e5dc3..7a2d91c242 100644 --- a/src/sampling/sampledSet/writers/raw/rawSetWriter.C +++ b/src/sampling/sampledSet/writers/raw/rawSetWriter.C @@ -71,6 +71,13 @@ Foam::rawSetWriter::rawSetWriter(const dictionary& dict) {} +Foam::rawSetWriter::rawSetWriter(const rawSetWriter& writer) +: + setWriter(writer), + separateSegments_(true) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::rawSetWriter::~rawSetWriter() diff --git a/src/sampling/sampledSet/writers/raw/rawSetWriter.H b/src/sampling/sampledSet/writers/raw/rawSetWriter.H index fd33892750..5338a75c95 100644 --- a/src/sampling/sampledSet/writers/raw/rawSetWriter.H +++ b/src/sampling/sampledSet/writers/raw/rawSetWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,15 @@ public: //- Construct from dictionary rawSetWriter(const dictionary& dict); + //- Construct copy + rawSetWriter(const rawSetWriter& writer); + + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr(new rawSetWriter(*this)); + } + //- Destructor virtual ~rawSetWriter(); diff --git a/src/sampling/sampledSet/writers/setWriter.C b/src/sampling/sampledSet/writers/setWriter.C index c43821036f..10c0c230d6 100644 --- a/src/sampling/sampledSet/writers/setWriter.C +++ b/src/sampling/sampledSet/writers/setWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -273,6 +273,13 @@ Foam::setWriter::setWriter(const dictionary& dict) {} +Foam::setWriter::setWriter(const setWriter& writer) +: + writeFormat_(writer.writeFormat_), + writeCompression_(writer.writeCompression_) +{} + + // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::setWriter::New diff --git a/src/sampling/sampledSet/writers/setWriter.H b/src/sampling/sampledSet/writers/setWriter.H index b5b4daf5c9..3e756a7edf 100644 --- a/src/sampling/sampledSet/writers/setWriter.H +++ b/src/sampling/sampledSet/writers/setWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ Description ( "myDirectory", "mySet", - coordSet(points, true), + coordSet(true, "position", points), "p", p, "U", U ); @@ -340,6 +340,12 @@ public: //- Construct from dictionary setWriter(const dictionary& dict); + //- Construct copy + setWriter(const setWriter& writer); + + //- Construct and return a clone + virtual autoPtr clone() const = 0; + //- Destructor virtual ~setWriter() = 0; @@ -397,7 +403,7 @@ public: // "myDirectory", "mySet", // // // Geometry - // coordSet(points, true), + // coordSet(true, "position", points), // // // Fields // "p", Field(points.size(), ...), diff --git a/src/sampling/sampledSet/writers/vtk/vtkSetWriter.H b/src/sampling/sampledSet/writers/vtk/vtkSetWriter.H index 2e6ccaf926..e007878dd3 100644 --- a/src/sampling/sampledSet/writers/vtk/vtkSetWriter.H +++ b/src/sampling/sampledSet/writers/vtk/vtkSetWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,6 +61,12 @@ public: //- Inherit constructors using setWriter::setWriter; + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr(new vtkSetWriter(*this)); + } + //- Destructor virtual ~vtkSetWriter();