Solaris sunpro compilers gave a warning about virtual functions in the

same class which
have the same name, but which have different arguments.
   Solaris complains when virtual functions are hidden, when they are
overloaded.
This commit is contained in:
Harry Moffat 2006-03-07 20:52:16 +00:00
parent abccc976cd
commit 4015fd7cf1
8 changed files with 154 additions and 149 deletions

View file

@ -1,2 +1,3 @@
.depends
Makefile
SunWS_cache

View file

@ -380,7 +380,7 @@ namespace Cantera {
virtual void getTransientMask(integer* mask){}
virtual void showSolution(ostream& s, const doublereal* x) {}
virtual void showSolution_s(ostream& s, const doublereal* x) {}
virtual void showSolution(const doublereal* x);
virtual void restore(const XML_Node& dom, doublereal* soln) {}

View file

@ -128,7 +128,7 @@ namespace Cantera {
return m_V0;
}
// virtual void showSolution(ostream& s, const doublereal* x) {
// virtual void showSolution_s(ostream& s, const doublereal* x) {
// s << "------------------- Inlet " << domainIndex() << " ------------------- " << endl;
// s << " mdot: " << m_mdot << " kg/m^2/s" << " " << x[0] << endl;
// s << " temperature: " << m_temp << " K" << " " << x[1] << endl;
@ -178,7 +178,7 @@ namespace Cantera {
virtual void eval(int jg, doublereal* xg, doublereal* rg,
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(XML_Node& dom, doublereal* soln);
virtual void restore(const XML_Node& dom, doublereal* soln);
protected:
@ -212,7 +212,7 @@ namespace Cantera {
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(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;
@ -243,7 +243,7 @@ namespace Cantera {
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(XML_Node& dom, doublereal* soln);
virtual void restore(const XML_Node& dom, doublereal* soln);
virtual void _finalize(const doublereal* x) {
; //m_temp = x[0];
}
@ -275,7 +275,7 @@ namespace Cantera {
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(XML_Node& dom, doublereal* soln);
virtual void restore(const XML_Node& dom, doublereal* soln);
virtual void _finalize(const doublereal* x) {
; //m_temp = x[0];
}
@ -322,7 +322,7 @@ namespace Cantera {
virtual void eval(int jg, doublereal* xg, doublereal* rg,
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(XML_Node& dom, doublereal* soln);
virtual void restore(const XML_Node& dom, doublereal* soln);
protected:
@ -356,7 +356,7 @@ namespace Cantera {
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(XML_Node& dom, doublereal* soln);
virtual void restore(const XML_Node& dom, doublereal* soln);
virtual void _getInitialSoln(doublereal* x) {
x[0] = m_temp;
@ -366,7 +366,7 @@ namespace Cantera {
; //m_temp = x[0];
}
virtual void showSolution(ostream& s, const doublereal* x) {
virtual void showSolution_s(ostream& s, const doublereal* x) {
s << "------------------- Surface " << domainIndex() << " ------------------- " << endl;
s << " temperature: " << m_temp << " K" << " " << x[0] << endl;
}
@ -416,7 +416,7 @@ namespace Cantera {
integer* diagg, doublereal rdt);
virtual void save(XML_Node& o, doublereal* soln);
virtual void restore(XML_Node& dom, doublereal* soln);
virtual void restore(const XML_Node& dom, doublereal* soln);
virtual void _getInitialSoln(doublereal* x) {
x[0] = m_temp;

View file

@ -30,7 +30,7 @@ ONED_LIB = @buildlib@/liboneD.a
DEPENDS = $(OBJS:.o=.d)
%.d:
g++ -MM @CXXFLAGS@ $(CXX_INCLUDES) $*.cpp > $*.d
g++ -MM $(CXX_INCLUDES) $*.cpp > $*.d
.cpp.o:
@CXX@ -c $< @DEFS@ $(CXX_FLAGS) $(CXX_INCLUDES)
@ -56,6 +56,9 @@ clean:
fi \
done)
$(RM) *.o *~ $(ONED_LIB) .depends
(if test -d SunWS_cache ; then \
$(RM) -rf SunWS_cache ; \
fi )
depends: $(DEPENDS)
cat *.d > .depends

View file

@ -321,7 +321,7 @@ namespace Cantera {
virtual void getTransientMask(integer* mask){}
virtual void showSolution(ostream& s, const doublereal* x) {}
virtual void showSolution_s(ostream& s, const doublereal* x) {}
doublereal z(int jlocal) const {
return m_z[jlocal];

View file

@ -187,7 +187,7 @@ namespace Cantera {
void Sim1D::showSolution(ostream& s) {
for (int n = 0; n < m_nd; n++) {
if (domain(n).domainType() != cEmptyType)
domain(n).showSolution(s, m_x.begin() + start(n));
domain(n).showSolution_s(s, m_x.begin() + start(n));
}
}

View file

@ -1,135 +1,135 @@
/**
* @file Sim1D.h
*/
#ifndef CT_SIM1D_H
#define CT_SIM1D_H
#include "OneDim.h"
#include "../funcs.h"
namespace Cantera {
/**
* One-dimensional simulations. Class Sim1D extends class OneDim
* by storing the solution vector, and by adding a hybrid
* Newton/time-stepping solver.
*/
class Sim1D : public OneDim {
public:
/**
* Default constructor. This constructor is provided to make
* the class default-constructible, but is not meant to be
* used in most applications. Use the next constructor
* instead.
*/
Sim1D();
/**
* Standard constructor.
* @param domains A vector of pointers to the domains to be linked together.
* The domain pointers must be entered in left-to-right order --- i.e.,
* the pointer to the leftmost domain is domain[0], the pointer to the
* domain to its right is domain[1], etc.
*/
Sim1D(vector<Domain1D*>& domains);
/// Destructor. Does nothing.
virtual ~Sim1D() {}
/**
* @name Setting initial values
*
* These methods are used to set the initial values of
* solution components.
*/
//@{
/// Set initial guess based on equilibrium
//added by Karl Meredith
void setInitialGuess(string component, vector_fp& locs, vector_fp& vals);
/// Set one entry in the solution vector.
void setValue(int dom, int comp, int localPoint, doublereal value);
/// Get one entry in the solution vector.
doublereal value(int dom, int comp, int localPoint) const;
doublereal workValue(int dom, int comp, int localPoint) const;
/// Specify a profile for one component of one domain.
void setProfile(int dom, int comp, const vector_fp& pos,
const vector_fp& values);
/// Set component 'comp' of domain 'dom' to value 'v' at all points.
void setFlatProfile(int dom, int comp, doublereal v);
//@}
void save(string fname, string id, string desc);
/// Print to stream s the current solution for all domains.
void showSolution(ostream& s);
void showSolution();
const doublereal* solution() { return m_x.begin(); }
void setTimeStep(doublereal stepsize, int n, integer* tsteps);
//void setMaxTimeStep(doublereal tmax) { m_maxtimestep = tmax; }
void solve(int loglevel = 0, bool refine_grid = true);
void eval(doublereal rdt=-1.0, int count = 1) {
OneDim::eval(-1, m_x.begin(), m_xnew.begin(), rdt, count);
}
/// Refine the grid in all domains.
int refine(int loglevel=0);
//added by Karl Meredith
int setFixedTemperature(doublereal t);
//added by Karl Meredith
void setAdiabaticFlame(void);
/// Set the criteria for grid refinement.
void setRefineCriteria(int dom = -1, doublereal ratio = 10.0,
doublereal slope = 0.8, doublereal curve = 0.8, doublereal prune = -0.1);
void setMaxGridPoints(int dom = -1, int npoints = 300);
void restore(string fname, string id);
void getInitialSoln();
void setSolution(const doublereal* soln) {
copy(soln, soln + m_x.size(), m_x.begin());
}
const doublereal* solution() const { return m_x.begin(); }
protected:
vector_fp m_x; // the solution vector
vector_fp m_xnew; // a work array used to hold the residual
// or the new solution
doublereal m_tstep; // timestep
vector_int m_steps; // array of number of steps to take before
// re-attempting the steady-state solution
private:
/// Calls method _finalize in each domain.
void finalize();
void newtonSolve(int loglevel);
};
}
#endif
/**
* @file Sim1D.h
*/
#ifndef CT_SIM1D_H
#define CT_SIM1D_H
#include "OneDim.h"
#include "../funcs.h"
namespace Cantera {
/**
* One-dimensional simulations. Class Sim1D extends class OneDim
* by storing the solution vector, and by adding a hybrid
* Newton/time-stepping solver.
*/
class Sim1D : public OneDim {
public:
/**
* Default constructor. This constructor is provided to make
* the class default-constructible, but is not meant to be
* used in most applications. Use the next constructor
* instead.
*/
Sim1D();
/**
* Standard constructor.
* @param domains A vector of pointers to the domains to be linked together.
* The domain pointers must be entered in left-to-right order --- i.e.,
* the pointer to the leftmost domain is domain[0], the pointer to the
* domain to its right is domain[1], etc.
*/
Sim1D(vector<Domain1D*>& domains);
/// Destructor. Does nothing.
virtual ~Sim1D() {}
/**
* @name Setting initial values
*
* These methods are used to set the initial values of
* solution components.
*/
//@{
/// Set initial guess based on equilibrium
//added by Karl Meredith
void setInitialGuess(string component, vector_fp& locs, vector_fp& vals);
/// Set one entry in the solution vector.
void setValue(int dom, int comp, int localPoint, doublereal value);
/// Get one entry in the solution vector.
doublereal value(int dom, int comp, int localPoint) const;
doublereal workValue(int dom, int comp, int localPoint) const;
/// Specify a profile for one component of one domain.
void setProfile(int dom, int comp, const vector_fp& pos,
const vector_fp& values);
/// Set component 'comp' of domain 'dom' to value 'v' at all points.
void setFlatProfile(int dom, int comp, doublereal v);
//@}
void save(string fname, string id, string desc);
/// Print to stream s the current solution for all domains.
void showSolution(ostream& s);
void showSolution();
const doublereal* solution() { return m_x.begin(); }
void setTimeStep(doublereal stepsize, int n, integer* tsteps);
//void setMaxTimeStep(doublereal tmax) { m_maxtimestep = tmax; }
void solve(int loglevel = 0, bool refine_grid = true);
void eval(doublereal rdt=-1.0, int count = 1) {
OneDim::eval(-1, m_x.begin(), m_xnew.begin(), rdt, count);
}
/// Refine the grid in all domains.
int refine(int loglevel=0);
//added by Karl Meredith
int setFixedTemperature(doublereal t);
//added by Karl Meredith
void setAdiabaticFlame(void);
/// Set the criteria for grid refinement.
void setRefineCriteria(int dom = -1, doublereal ratio = 10.0,
doublereal slope = 0.8, doublereal curve = 0.8, doublereal prune = -0.1);
void setMaxGridPoints(int dom = -1, int npoints = 300);
void restore(string fname, string id);
void getInitialSoln();
void setSolution(const doublereal* soln) {
copy(soln, soln + m_x.size(), m_x.begin());
}
const doublereal* solution() const { return m_x.begin(); }
protected:
vector_fp m_x; // the solution vector
vector_fp m_xnew; // a work array used to hold the residual
// or the new solution
doublereal m_tstep; // timestep
vector_int m_steps; // array of number of steps to take before
// re-attempting the steady-state solution
private:
/// Calls method _finalize in each domain.
void finalize();
void newtonSolve(int loglevel);
};
}
#endif

View file

@ -108,7 +108,8 @@ namespace Cantera {
/// @todo remove? may be unused
virtual void setState(int point, const doublereal* state) {
virtual void setState(int point, const doublereal* state,
doublereal *x) {
setTemperature(point, state[2]);
int k;
for (k = 0; k < m_nsp; k++) {