solaris port:
std:: applied to copy()
This commit is contained in:
parent
7c3d9c8320
commit
46d984cf63
2 changed files with 51 additions and 53 deletions
|
|
@ -45,16 +45,16 @@ namespace Cantera {
|
|||
* @param nv Number of variables at each grid point.
|
||||
* @param points Number of grid points.
|
||||
*/
|
||||
Domain1D(int nv=1, int points=1,
|
||||
Domain1D(int nv=1, int points=1,
|
||||
doublereal time = 0.0) :
|
||||
m_rdt(0.0),
|
||||
m_rdt(0.0),
|
||||
m_time(time),
|
||||
m_container(0),
|
||||
m_container(0),
|
||||
m_index(-1),
|
||||
m_type(0),
|
||||
m_iloc(0),
|
||||
m_jstart(0),
|
||||
m_left(0),
|
||||
m_left(0),
|
||||
m_right(0),
|
||||
m_id("-"), m_desc("-"),
|
||||
m_refiner(0) {
|
||||
|
|
@ -91,7 +91,7 @@ namespace Cantera {
|
|||
m_index = index;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Initialize. This method is called by OneDim::init() for
|
||||
* each domain once at the beginning of a simulation. Base
|
||||
* class method does nothing, but may be overloaded.
|
||||
|
|
@ -139,9 +139,9 @@ namespace Cantera {
|
|||
int nPoints() const { return m_points; }
|
||||
|
||||
/// Name of the nth component. May be overloaded.
|
||||
virtual std::string componentName(int n) const {
|
||||
virtual std::string componentName(int n) const {
|
||||
if (m_name[n] != "") return m_name[n];
|
||||
else return "component " + int2str(n);
|
||||
else return "component " + int2str(n);
|
||||
}
|
||||
|
||||
void setComponentName(int n, std::string name) {
|
||||
|
|
@ -165,14 +165,14 @@ namespace Cantera {
|
|||
/**
|
||||
* Set the lower and upper bounds for each solution component.
|
||||
*/
|
||||
void setBounds(int nl, const doublereal* lower,
|
||||
void setBounds(int nl, const doublereal* lower,
|
||||
int nu, const doublereal* upper) {
|
||||
if (nl < m_nv || nu < m_nv)
|
||||
throw CanteraError("Domain1D::setBounds",
|
||||
"wrong array size for solution bounds. "
|
||||
"Size should be at least "+int2str(m_nv));
|
||||
copy(upper, upper + m_nv, m_max.begin());
|
||||
copy(lower, lower + m_nv, m_min.begin());
|
||||
std::copy(upper, upper + m_nv, m_max.begin());
|
||||
std::copy(lower, lower + m_nv, m_min.begin());
|
||||
}
|
||||
|
||||
void setBounds(int n, doublereal lower, doublereal upper) {
|
||||
|
|
@ -180,8 +180,8 @@ namespace Cantera {
|
|||
m_max[n] = upper;
|
||||
}
|
||||
|
||||
/// set the error tolerances for all solution components.
|
||||
void setTolerances(int nr, const doublereal* rtol,
|
||||
/// set the error tolerances for all solution components.
|
||||
void setTolerances(int nr, const doublereal* rtol,
|
||||
int na, const doublereal* atol, int ts = 0);
|
||||
|
||||
/// set the error tolerances for solution component \a n.
|
||||
|
|
@ -197,7 +197,7 @@ namespace Cantera {
|
|||
|
||||
//added by Karl Meredith
|
||||
void setTolerancesSS(doublereal rtol, doublereal atol);
|
||||
|
||||
|
||||
/// Relative tolerance of the nth component.
|
||||
doublereal rtol(int n) { return (m_rdt == 0.0 ? m_rtol_ss[n] : m_rtol_ts[n]); }
|
||||
|
||||
|
|
@ -217,10 +217,10 @@ namespace Cantera {
|
|||
* x0.
|
||||
*/
|
||||
void initTimeInteg(doublereal dt, const doublereal* x0) {
|
||||
copy(x0 + loc(), x0 + loc() + size(), m_slast.begin());
|
||||
std::copy(x0 + loc(), x0 + loc() + size(), m_slast.begin());
|
||||
m_rdt = 1.0/dt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare to solve the steady-state problem.
|
||||
* Set the internally-stored reciprocal of the time step to 0,0
|
||||
|
|
@ -242,7 +242,7 @@ namespace Cantera {
|
|||
void needJacUpdate();
|
||||
|
||||
/**
|
||||
* Evaluate the steady-state residual at all points, even if in
|
||||
* Evaluate the steady-state residual at all points, even if in
|
||||
* transient mode. Used only to print diagnostic output.
|
||||
*/
|
||||
void evalss(doublereal* x, doublereal* r, integer* mask) {
|
||||
|
|
@ -252,8 +252,8 @@ namespace Cantera {
|
|||
/**
|
||||
* Evaluate the residual function at point j. If j < 0,
|
||||
* evaluate the residual function at all points.
|
||||
*/
|
||||
virtual void eval(int j, doublereal* x, doublereal* r,
|
||||
*/
|
||||
virtual void eval(int j, doublereal* x, doublereal* r,
|
||||
integer* mask, doublereal rdt=0.0);
|
||||
|
||||
virtual doublereal residual(doublereal* x, int n, int j) {
|
||||
|
|
@ -301,7 +301,7 @@ namespace Cantera {
|
|||
m_jstart = 0;
|
||||
m_iloc = 0;
|
||||
}
|
||||
// if there is a domain to the right of this one, then
|
||||
// if there is a domain to the right of this one, then
|
||||
// repeat this for it
|
||||
if (m_right) m_right->locate();
|
||||
}
|
||||
|
|
@ -329,13 +329,13 @@ namespace Cantera {
|
|||
* called to update the global positions of this domain and
|
||||
* all those to its right.
|
||||
*/
|
||||
void linkLeft(Domain1D* left) {
|
||||
void linkLeft(Domain1D* left) {
|
||||
m_left = left;
|
||||
locate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the right neighbor to domain 'right.'
|
||||
* Set the right neighbor to domain 'right.'
|
||||
*/
|
||||
void linkRight(Domain1D* right) { m_right = right; }
|
||||
|
||||
|
|
@ -363,13 +363,13 @@ namespace Cantera {
|
|||
double prevSoln(int n, int j) const {
|
||||
return m_slast[m_nv*j + n];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Specify an identifying tag for this domain.
|
||||
*/
|
||||
void setID(const std::string& s) {m_id = s;}
|
||||
|
||||
std::string id() {
|
||||
std::string id() {
|
||||
if (m_id != "") return m_id;
|
||||
else return std::string("domain ") + int2str(m_index);
|
||||
}
|
||||
|
|
@ -440,13 +440,13 @@ namespace Cantera {
|
|||
* this domain that will be used as the initial guess. If no
|
||||
* such parameters need to be set, then method _finalize does
|
||||
* not need to be overloaded.
|
||||
*/
|
||||
*/
|
||||
virtual void _finalize(const doublereal* x) {}
|
||||
|
||||
//added by Karl Meredith
|
||||
doublereal m_zfixed;
|
||||
doublereal m_tfixed;
|
||||
|
||||
|
||||
bool m_adiabatic;
|
||||
|
||||
protected:
|
||||
|
|
@ -478,5 +478,3 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace Cantera {
|
|||
* as surface species coverages.
|
||||
*
|
||||
* The boundary types are an inlet, an outlet, a symmetry plane,
|
||||
* and a surface.
|
||||
* and a surface.
|
||||
*
|
||||
* The public methods are all virtual, and the base class
|
||||
* implementations throw exceptions.
|
||||
|
|
@ -44,7 +44,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
Bdry1D();
|
||||
|
||||
|
||||
virtual ~Bdry1D() {}
|
||||
|
||||
/// Initialize.
|
||||
|
|
@ -93,7 +93,7 @@ namespace Cantera {
|
|||
|
||||
private:
|
||||
void err(std::string method) {
|
||||
throw CanteraError("Bdry1D::"+method,
|
||||
throw CanteraError("Bdry1D::"+method,
|
||||
"attempt to call base class method "+method);
|
||||
}
|
||||
};
|
||||
|
|
@ -160,10 +160,10 @@ namespace Cantera {
|
|||
virtual doublereal massFraction(int k) {return m_yin[k];}
|
||||
virtual std::string componentName(int n) const;
|
||||
virtual void init();
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
Empty1D() : Domain1D() {
|
||||
m_type = cEmptyType;
|
||||
m_type = cEmptyType;
|
||||
}
|
||||
virtual ~Empty1D(){}
|
||||
|
||||
|
|
@ -193,11 +193,11 @@ namespace Cantera {
|
|||
|
||||
virtual void init();
|
||||
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void _finalize(const doublereal* x) {}
|
||||
virtual void _getInitialSoln(doublereal* x) {
|
||||
x[0] = 0.0;
|
||||
|
|
@ -216,7 +216,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
Symm1D() : Bdry1D() {
|
||||
m_type = cSymmType;
|
||||
m_type = cSymmType;
|
||||
}
|
||||
virtual ~Symm1D(){}
|
||||
|
||||
|
|
@ -224,11 +224,11 @@ namespace Cantera {
|
|||
|
||||
virtual void init();
|
||||
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void _finalize(const doublereal* x) {
|
||||
; //m_temp = x[0];
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
Outlet1D() : Bdry1D() {
|
||||
m_type = cOutletType;
|
||||
m_type = cOutletType;
|
||||
}
|
||||
virtual ~Outlet1D(){}
|
||||
|
||||
|
|
@ -256,11 +256,11 @@ namespace Cantera {
|
|||
|
||||
virtual void init();
|
||||
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void _finalize(const doublereal* x) {
|
||||
; //m_temp = x[0];
|
||||
}
|
||||
|
|
@ -281,7 +281,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* Constructor.
|
||||
*/
|
||||
OutletRes1D() : Bdry1D(), m_nsp(0), m_flow(0) {
|
||||
m_type = cOutletResType;
|
||||
|
|
@ -304,10 +304,10 @@ namespace Cantera {
|
|||
virtual doublereal massFraction(int k) {return m_yres[k];}
|
||||
virtual std::string componentName(int n) const;
|
||||
virtual void init();
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
Surf1D() : Bdry1D() {
|
||||
m_type = cSurfType;
|
||||
m_type = cSurfType;
|
||||
}
|
||||
virtual ~Surf1D(){}
|
||||
|
||||
|
|
@ -337,11 +337,11 @@ namespace Cantera {
|
|||
|
||||
virtual void init();
|
||||
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
|
||||
virtual void _getInitialSoln(doublereal* x) {
|
||||
x[0] = m_temp;
|
||||
|
|
@ -376,7 +376,7 @@ namespace Cantera {
|
|||
|
||||
public:
|
||||
|
||||
ReactingSurf1D() : Bdry1D(),
|
||||
ReactingSurf1D() : Bdry1D(),
|
||||
m_kin(0), m_surfindex(0), m_nsp(0) {
|
||||
m_type = cSurfType;
|
||||
}
|
||||
|
|
@ -390,18 +390,18 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
void enableCoverageEquations(bool docov) { m_enabled = docov; }
|
||||
|
||||
|
||||
virtual ~ReactingSurf1D(){}
|
||||
|
||||
virtual std::string componentName(int n) const;
|
||||
|
||||
virtual void init();
|
||||
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
virtual void eval(int jg, doublereal* xg, doublereal* rg,
|
||||
integer* diagg, doublereal rdt);
|
||||
|
||||
virtual void save(XML_Node& o, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
|
||||
virtual void _getInitialSoln(doublereal* x) {
|
||||
x[0] = m_temp;
|
||||
|
|
@ -410,7 +410,7 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
virtual void _finalize(const doublereal* x) {
|
||||
copy(x+1,x+1+m_nsp,m_fixed_cov.begin());
|
||||
std::copy(x+1,x+1+m_nsp,m_fixed_cov.begin());
|
||||
}
|
||||
|
||||
virtual void showSolution(const doublereal* x) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue