CONFIG: incorrect BC code templates (fixes #1885)

- autoPtr to Function requires clone() method, not optional copy/move
  argument.

- fix bad character range for 'sed'
This commit is contained in:
Mark Olesen
2020-10-20 14:14:40 +02:00
parent f425424eef
commit e11c072bc4
14 changed files with 43 additions and 46 deletions

View File

@ -207,7 +207,7 @@ do
sed -i \ sed -i \
-e '/^template<class Type>$/d' \ -e '/^template<class Type>$/d' \
-e 's/this->//g' \ -e 's/this->//g' \
-e 's/\.template[\t ]*\([a-Z]\)/\.\1/g' \ -e 's/\.template[\t ]*\([A-Za-z]\)/\.\1/g' \
-e '/#ifdef NoRepository/,/\/\/ */d' \ -e '/#ifdef NoRepository/,/\/\/ */d' \
${NAME}/${NEWFILE} ${NAME}/${NEWFILE}
;; ;;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -51,7 +51,7 @@ CONSTRUCT
) )
: :
PARENT(p, iF), PARENT(p, iF),
scalarData_(0.0), scalarData_(0),
data_(Zero), data_(Zero),
fieldData_(p.size(), Zero), fieldData_(p.size(), Zero),
timeVsData_(), timeVsData_(),
@ -61,7 +61,7 @@ CONSTRUCT
{ {
this->refValue() = Zero; this->refValue() = Zero;
this->refGrad() = Zero; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = Zero;
} }
@ -84,7 +84,7 @@ CONSTRUCT
boolData_(false) boolData_(false)
{ {
this->refGrad() = Zero; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = Zero;
this->refValue() = FIELD("fieldData", dict, p.size()); this->refValue() = FIELD("fieldData", dict, p.size());
FVPATCHF::operator=(this->refValue()); FVPATCHF::operator=(this->refValue());
@ -116,7 +116,7 @@ CONSTRUCT
scalarData_(ptf.scalarData_), scalarData_(ptf.scalarData_),
data_(ptf.data_), data_(ptf.data_),
fieldData_(ptf.fieldData_, mapper), fieldData_(ptf.fieldData_, mapper),
timeVsData_(ptf.timeVsData_, false), timeVsData_(ptf.timeVsData_.clone()),
wordData_(ptf.wordData_), wordData_(ptf.wordData_),
labelData_(-1), labelData_(-1),
boolData_(ptf.boolData_) boolData_(ptf.boolData_)
@ -134,7 +134,7 @@ CONSTRUCT
scalarData_(ptf.scalarData_), scalarData_(ptf.scalarData_),
data_(ptf.data_), data_(ptf.data_),
fieldData_(ptf.fieldData_), fieldData_(ptf.fieldData_),
timeVsData_(ptf.timeVsData_, false), timeVsData_(ptf.timeVsData_.clone()),
wordData_(ptf.wordData_), wordData_(ptf.wordData_),
labelData_(-1), labelData_(-1),
boolData_(ptf.boolData_) boolData_(ptf.boolData_)
@ -153,7 +153,7 @@ CONSTRUCT
scalarData_(ptf.scalarData_), scalarData_(ptf.scalarData_),
data_(ptf.data_), data_(ptf.data_),
fieldData_(ptf.fieldData_), fieldData_(ptf.fieldData_),
timeVsData_(ptf.timeVsData_, false), timeVsData_(ptf.timeVsData_.clone()),
wordData_(ptf.wordData_), wordData_(ptf.wordData_),
labelData_(-1), labelData_(-1),
boolData_(ptf.boolData_) boolData_(ptf.boolData_)

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -47,12 +47,12 @@ Description
Usage Usage
\table \table
Property | Description | Req'd? | Default Property | Description | Req'd | Default
scalarData | single scalar value | yes | scalarData | single scalar value | yes |
data | single TYPE value | yes | data | single TYPE value | yes |
fieldData | TYPE field across patch | yes | fieldData | TYPE field across patch | yes |
timeVsData | TYPE function of time | yes | timeVsData | TYPE function of time | yes |
wordData | word, eg name of data object | no | wordDefault wordData | word, eg name of data object | no | wordDefault
\endtable \endtable
Example of the boundary condition specification: Example of the boundary condition specification:
@ -97,7 +97,7 @@ class CONSTRUCT
: :
public PARENT public PARENT
{ {
// Private data // Private Data
//- Single valued scalar quantity, e.g. a coefficient //- Single valued scalar quantity, e.g. a coefficient
scalar scalarData_; scalar scalarData_;
@ -152,8 +152,7 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping given BASETypeFvPatchField //- Construct by mapping onto a new patch
// onto a new patch
CONSTRUCT CONSTRUCT
( (
const CLASS&, const CLASS&,
@ -162,7 +161,7 @@ public:
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Construct as copy //- Copy construct
CONSTRUCT CONSTRUCT
( (
const CLASS& const CLASS&
@ -201,7 +200,7 @@ public:
} }
// Member functions // Member Functions
// Mapping functions // Mapping functions
@ -226,7 +225,7 @@ public:
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream& os) const;
}; };

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -46,7 +46,7 @@ ${codeInclude}
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class fvMesh; class fvMesh;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION Copyright (C) YEAR AUTHOR,AFFILIATION
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -45,11 +45,11 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class Istream; class Istream;
class Ostream; class Ostream;
class CLASSNAME; class CLASSNAME;
Istream& operator>>(Istream&, CLASSNAME&); Istream& operator>>(Istream&, CLASSNAME&);
Ostream& operator<<(Ostream&, const CLASSNAME&); Ostream& operator<<(Ostream&, const CLASSNAME&);
@ -87,7 +87,7 @@ public:
// Generated Methods // Generated Methods
// //- Construct null // //- Default construct
// CLASSNAME() = default; // CLASSNAME() = default;
// //
// //- Copy construct // //- Copy construct
@ -99,22 +99,22 @@ public:
// Constructors // Constructors
//- Construct null //- Default construct
CLASSNAME(); CLASSNAME();
//- Construct from components //- Construct from components
CLASSNAME(const dataType& data); CLASSNAME(const dataType& data);
//- Construct from Istream //- Copy construct
CLASSNAME(Istream& is);
//- Construct as copy
CLASSNAME(const CLASSNAME&); CLASSNAME(const CLASSNAME&);
//- Construct from Istream
explicit CLASSNAME(Istream& is);
// Selectors // Selectors
//- Select null constructed //- Select default constructed
static autoPtr<CLASSNAME> New(); static autoPtr<CLASSNAME> New();

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -45,7 +45,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class someClass; class someClass;
template<TemplateClassArgument> template<TemplateClassArgument>
@ -90,7 +90,7 @@ public:
// Generated Methods // Generated Methods
// //- Construct null // //- Default construct
// CLASSNAME() = default; // CLASSNAME() = default;
// //
// //- Copy construct // //- Copy construct
@ -102,22 +102,22 @@ public:
// Constructors // Constructors
//- Construct null //- Default construct
CLASSNAME(); CLASSNAME();
//- Construct from components //- Construct from components
CLASSNAME(const dataType& data); CLASSNAME(const dataType& data);
//- Construct from Istream
CLASSNAME(Istream& is);
//- Construct as copy //- Construct as copy
CLASSNAME(const CLASSNAME<TemplateArgument>&); CLASSNAME(const CLASSNAME<TemplateArgument>&);
//- Construct from Istream
explicit CLASSNAME(Istream& is);
// Selectors // Selectors
//- Select null constructed //- Select default constructed
static autoPtr<CLASSNAME<TemplateArgument>> New(); static autoPtr<CLASSNAME<TemplateArgument>> New();

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //