Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
d9c7c671
Commit
d9c7c671
authored
Feb 10, 2016
by
Henry Weller
Browse files
Function1: Simplified files
parent
0431d4e6
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C
View file @
d9c7c671
...
...
@@ -259,9 +259,43 @@ const Foam::fileName& Foam::Function1Types::CSV<Type>::fName() const
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include
"CSVIO.C"
template
<
class
Type
>
void
Foam
::
Function1Types
::
CSV
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
indent
<<
word
(
this
->
name
()
+
"Coeffs"
)
<<
nl
;
os
<<
indent
<<
token
::
BEGIN_BLOCK
<<
incrIndent
<<
nl
;
// Note: for TableBase write the dictionary entries it needs but not
// the values themselves
TableBase
<
Type
>::
writeEntries
(
os
);
os
.
writeKeyword
(
"nHeaderLine"
)
<<
nHeaderLine_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"refColumn"
)
<<
refColumn_
<<
token
::
END_STATEMENT
<<
nl
;
// Force writing labelList in ascii
os
.
writeKeyword
(
"componentColumns"
);
if
(
os
.
format
()
==
IOstream
::
BINARY
)
{
os
.
format
(
IOstream
::
ASCII
);
os
<<
componentColumns_
;
os
.
format
(
IOstream
::
BINARY
);
}
else
{
os
<<
componentColumns_
;
}
os
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"separator"
)
<<
string
(
separator_
)
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"mergeSeparators"
)
<<
mergeSeparators_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"fileName"
)
<<
fName_
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
decrIndent
<<
indent
<<
token
::
END_BLOCK
<<
endl
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/CSV/CSVIO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"Function1.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
CSV
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
indent
<<
word
(
this
->
name
()
+
"Coeffs"
)
<<
nl
;
os
<<
indent
<<
token
::
BEGIN_BLOCK
<<
incrIndent
<<
nl
;
// Note: for TableBase write the dictionary entries it needs but not
// the values themselves
TableBase
<
Type
>::
writeEntries
(
os
);
os
.
writeKeyword
(
"nHeaderLine"
)
<<
nHeaderLine_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"refColumn"
)
<<
refColumn_
<<
token
::
END_STATEMENT
<<
nl
;
// Force writing labelList in ascii
os
.
writeKeyword
(
"componentColumns"
);
if
(
os
.
format
()
==
IOstream
::
BINARY
)
{
os
.
format
(
IOstream
::
ASCII
);
os
<<
componentColumns_
;
os
.
format
(
IOstream
::
BINARY
);
}
else
{
os
<<
componentColumns_
;
}
os
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"separator"
)
<<
string
(
separator_
)
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"mergeSeparators"
)
<<
mergeSeparators_
<<
token
::
END_STATEMENT
<<
nl
;
os
.
writeKeyword
(
"fileName"
)
<<
fName_
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
decrIndent
<<
indent
<<
token
::
END_BLOCK
<<
endl
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C
View file @
d9c7c671
...
...
@@ -90,8 +90,13 @@ Type Foam::Function1Types::Constant<Type>::integrate
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
Constant
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
SPACE
<<
value_
<<
token
::
END_STATEMENT
<<
nl
;
}
#include
"ConstantIO.C"
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Constant/ConstantIO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"Constant.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
Constant
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
SPACE
<<
value_
<<
token
::
END_STATEMENT
<<
nl
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Function1/Function1.C
View file @
d9c7c671
...
...
@@ -120,8 +120,33 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1<Type>::integrate
}
template
<
class
Type
>
void
Foam
::
Function1
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
os
.
writeKeyword
(
name_
)
<<
type
();
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include
"Function1IO.C"
template
<
class
Type
>
Foam
::
Ostream
&
Foam
::
operator
<<
(
Ostream
&
os
,
const
Function1
<
Type
>&
f1
)
{
// Check state of Ostream
os
.
check
(
"Ostream& operator<<(Ostream&, const Function1<Type>&)"
);
os
<<
f1
.
name_
;
f1
.
writeData
(
os
);
return
os
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Function1/Function1IO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"Function1.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
Foam
::
Ostream
&
Foam
::
operator
<<
(
Ostream
&
os
,
const
Function1
<
Type
>&
f1
)
{
// Check state of Ostream
os
.
check
(
"Ostream& operator<<(Ostream&, const Function1<Type>&)"
);
os
<<
f1
.
name_
;
f1
.
writeData
(
os
);
return
os
;
}
template
<
class
Type
>
void
Foam
::
Function1
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
os
.
writeKeyword
(
name_
)
<<
type
();
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/PolynomialEntry/PolynomialEntry.C
View file @
d9c7c671
...
...
@@ -198,8 +198,13 @@ Type Foam::Function1Types::Polynomial<Type>::integrate
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
Polynomial
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
nl
<<
indent
<<
coeffs_
<<
token
::
END_STATEMENT
<<
nl
;
}
#include
"PolynomialEntryIO.C"
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/PolynomialEntry/PolynomialEntryIO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"PolynomialEntry.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
Polynomial
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
nl
<<
indent
<<
coeffs_
<<
token
::
END_STATEMENT
<<
nl
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Sine/Sine.C
View file @
d9c7c671
...
...
@@ -97,8 +97,20 @@ Type Foam::Function1Types::Sine<Type>::integrate
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
Sine
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
indent
<<
word
(
this
->
name
()
+
"Coeffs"
)
<<
nl
;
os
<<
indent
<<
token
::
BEGIN_BLOCK
<<
incrIndent
<<
nl
;
os
.
writeKeyword
(
"t0"
)
<<
t0_
<<
token
::
END_STATEMENT
<<
nl
;
amplitude_
->
writeData
(
os
);
frequency_
->
writeData
(
os
);
scale_
->
writeData
(
os
);
level_
->
writeData
(
os
);
os
<<
decrIndent
<<
indent
<<
token
::
END_BLOCK
<<
endl
;
}
#include
"SineIO.C"
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Sine/SineIO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"Sine.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
Sine
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
indent
<<
word
(
this
->
name
()
+
"Coeffs"
)
<<
nl
;
os
<<
indent
<<
token
::
BEGIN_BLOCK
<<
incrIndent
<<
nl
;
os
.
writeKeyword
(
"t0"
)
<<
t0_
<<
token
::
END_STATEMENT
<<
nl
;
amplitude_
->
writeData
(
os
);
frequency_
->
writeData
(
os
);
scale_
->
writeData
(
os
);
level_
->
writeData
(
os
);
os
<<
decrIndent
<<
indent
<<
token
::
END_BLOCK
<<
endl
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
View file @
d9c7c671
...
...
@@ -406,8 +406,29 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::TableBase<Type>::y() const
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
TableBase
<
Type
>::
writeEntries
(
Ostream
&
os
)
const
{
if
(
boundsHandling_
!=
CLAMP
)
{
os
.
writeKeyword
(
"outOfBounds"
)
<<
boundsHandlingToWord
(
boundsHandling_
)
<<
token
::
END_STATEMENT
<<
nl
;
}
if
(
interpolationScheme_
!=
"linear"
)
{
os
.
writeKeyword
(
"interpolationScheme"
)
<<
interpolationScheme_
<<
token
::
END_STATEMENT
<<
nl
;
}
}
template
<
class
Type
>
void
Foam
::
Function1Types
::
TableBase
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
nl
<<
indent
<<
table_
<<
token
::
END_STATEMENT
<<
nl
;
writeEntries
(
os
);
}
#include
"TableBaseIO.C"
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/Table/TableBaseIO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"Function1.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
TableBase
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
nl
<<
indent
<<
table_
<<
token
::
END_STATEMENT
<<
nl
;
writeEntries
(
os
);
}
template
<
class
Type
>
void
Foam
::
Function1Types
::
TableBase
<
Type
>::
writeEntries
(
Ostream
&
os
)
const
{
if
(
boundsHandling_
!=
CLAMP
)
{
os
.
writeKeyword
(
"outOfBounds"
)
<<
boundsHandlingToWord
(
boundsHandling_
)
<<
token
::
END_STATEMENT
<<
nl
;
}
if
(
interpolationScheme_
!=
"linear"
)
{
os
.
writeKeyword
(
"interpolationScheme"
)
<<
interpolationScheme_
<<
token
::
END_STATEMENT
<<
nl
;
}
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C
View file @
d9c7c671
...
...
@@ -72,8 +72,24 @@ Foam::Function1Types::TableFile<Type>::~TableFile()
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
TableFile
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
END_STATEMENT
<<
nl
<<
indent
<<
word
(
this
->
name
()
+
"Coeffs"
)
<<
nl
<<
indent
<<
token
::
BEGIN_BLOCK
<<
nl
<<
incrIndent
;
// Note: for TableBase write the dictionary entries it needs but not
// the values themselves
TableBase
<
Type
>::
writeEntries
(
os
);
os
.
writeKeyword
(
"fileName"
)
<<
fName_
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
decrIndent
<<
indent
<<
token
::
END_BLOCK
<<
endl
;
}
#include
"TableFileIO.C"
// ************************************************************************* //
src/OpenFOAM/primitives/functions/Function1/TableFile/TableFileIO.C
deleted
100644 → 0
View file @
0431d4e6
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"Function1.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
Function1Types
::
TableFile
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
Function1
<
Type
>::
writeData
(
os
);
os
<<
token
::
END_STATEMENT
<<
nl
<<
indent
<<
word
(
this
->
name
()
+
"Coeffs"
)
<<
nl
<<
indent
<<
token
::
BEGIN_BLOCK
<<
nl
<<
incrIndent
;
// Note: for TableBase write the dictionary entries it needs but not
// the values themselves
TableBase
<
Type
>::
writeEntries
(
os
);
os
.
writeKeyword
(
"fileName"
)
<<
fName_
<<
token
::
END_STATEMENT
<<
nl
;
os
<<
decrIndent
<<
indent
<<
token
::
END_BLOCK
<<
endl
;
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1
/TimeFunction1
.C
→
src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C
View file @
d9c7c671
File moved
src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1
/TimeFunction1
.H
→
src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.H
View file @
d9c7c671
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment