Skip to content

Commit

Permalink
[Func1] Capitalize some function types
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Jun 29, 2023
1 parent 010d550 commit d19bf33
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions include/cantera/numerics/Func1.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ class Gaussian1 : public Func1
}

virtual string type() const {
return "gaussian";
return "Gaussian";
}

virtual doublereal eval(doublereal t) const {
Expand Down Expand Up @@ -1126,7 +1126,7 @@ class Fourier1 : public Func1
}

virtual string type() const {
return "fourier";
return "Fourier";
}

virtual Func1& duplicate() const;
Expand Down Expand Up @@ -1191,7 +1191,7 @@ class Arrhenius1 : public Func1
}

virtual string type() const {
return "arrhenius";
return "Arrhenius";
}

virtual Func1& duplicate() const;
Expand Down
16 changes: 8 additions & 8 deletions interfaces/matlab_experimental/Func/Func.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
% String indicating type of functor to create. Possible values are:
%
% * ``'polynomial'``
% * ``'fourier'``
% * ``'gaussian'``
% * ``'arrhenius'``
% * ``'Fourier'``
% * ``'Gaussian'``
% * ``'Arrhenius'``
% * ``'sum'``
% * ``'diff'``
% * ``'ratio'``
Expand Down Expand Up @@ -92,11 +92,11 @@

if strcmp(typ, 'polynomial')
itype = 2;
elseif strcmp(typ, 'fourier')
elseif strcmp(typ, 'Fourier')
itype = 1;
elseif strcmp(typ, 'arrhenius')
elseif strcmp(typ, 'Arrhenius')
itype = 3;
elseif strcmp(typ, 'gaussian')
elseif strcmp(typ, 'Gaussian')
itype = 4;
end

Expand Down Expand Up @@ -246,10 +246,10 @@ function display(f)

d = d - 1;
end
elseif strcmp(f.typ, 'gaussian')
elseif strcmp(f.typ, 'Gaussian')
s = ['Gaussian(' num2str(f.coeffs(1)) ',' ...
num2str(f.coeffs(2)) ',' num2str(f.coeffs(3)) ')'];
elseif strcmp(f.typ, 'fourier')
elseif strcmp(f.typ, 'Fourier')
c = reshape(f.coeffs, [], 2);
Ao = c(1, 1);
w = c(1, 2);
Expand Down
2 changes: 1 addition & 1 deletion interfaces/matlab_experimental/Func/gaussian.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
function f = gaussian(peak, center, width)
% Constructor

f@Func('gaussian', 0, [peak, center, width]);
f@Func('Gaussian', 0, [peak, center, width]);
end

end
Expand Down
6 changes: 3 additions & 3 deletions src/clib/ctfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ extern "C" {
} else if (type == FourierFuncType) {
vector<double> par(lenp);
std::copy(params, params + lenp, par.data());
r = newFunc1("fourier", par, n);
r = newFunc1("Fourier", par, n);
} else if (type == GaussianFuncType) {
vector<double> par(lenp);
std::copy(params, params + lenp, par.data());
r = newFunc1("gaussian", par, n);
r = newFunc1("Gaussian", par, n);
} else if (type == PolyFuncType) {
vector<double> par(lenp);
std::copy(params, params + lenp, par.data());
r = newFunc1("polynomial", par, n);
} else if (type == ArrheniusFuncType) {
vector<double> par(lenp);
std::copy(params, params + lenp, par.data());
r = newFunc1("arrhenius", par, n);
r = newFunc1("Arrhenius", par, n);
} else if (type == PeriodicFuncType) {
r = newMath1("periodic", FuncCabinet::at(n), params[0]);
} else if (type == SumFuncType) {
Expand Down
6 changes: 3 additions & 3 deletions src/numerics/Func1Factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Func1Factory::Func1Factory()
reg("polynomial", [](const vector<double>& params, size_t n) {
return new Poly1(params, n);
});
reg("fourier", [](const vector<double>& params, size_t n) {
reg("Fourier", [](const vector<double>& params, size_t n) {
return new Fourier1(params, n);
});
reg("gaussian", [](const vector<double>& params, size_t n) {
reg("Gaussian", [](const vector<double>& params, size_t n) {
return new Gaussian1(params, n);
});
reg("arrhenius", [](const vector<double>& params, size_t n) {
reg("Arrhenius", [](const vector<double>& params, size_t n) {
return new Arrhenius1(params, n);
});
reg("tabulated-linear", [](const vector<double>& params, size_t n) {
Expand Down

0 comments on commit d19bf33

Please sign in to comment.