ENH: support frequency or period for Sine/Square Function1 (#1917)

- For slow oscillations it can be more intuitive to specify the
  period.

ENH: separate mark/space for Square

- makes it easier to tailor the desired intervals.

BUG: incorrect square wave fraction with negative phase shifts

ENH: additional cosine Function1

STYLE: avoid code duplication by inheriting Cosine/Square from Sine.
This commit is contained in:
Mark Olesen
2020-11-16 11:39:57 +01:00
parent 2f2dcdcf6f
commit 8d2d894ae0
16 changed files with 654 additions and 249 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -31,6 +32,7 @@ License
#include "OneConstant.H"
#include "PolynomialEntry.H"
#include "Sine.H"
#include "Cosine.H"
#include "Square.H"
#include "CSV.H"
#include "Table.H"
@ -48,6 +50,7 @@ License
makeFunction1Type(ZeroConstant, Type); \
makeFunction1Type(OneConstant, Type); \
makeFunction1Type(Polynomial, Type); \
makeFunction1Type(Cosine, Type); \
makeFunction1Type(Sine, Type); \
makeFunction1Type(Square, Type); \
makeFunction1Type(CSV, Type); \