当前位置: 首页>>代码示例>>C++>>正文


C++ setTemperature函数代码示例

本文整理汇总了C++中setTemperature函数的典型用法代码示例。如果您正苦于以下问题:C++ setTemperature函数的具体用法?C++ setTemperature怎么用?C++ setTemperature使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setTemperature函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AvailabilityManager

AvailabilityManagerHighTemperatureTurnOn::AvailabilityManagerHighTemperatureTurnOn(const Model& model)
  : AvailabilityManager(AvailabilityManagerHighTemperatureTurnOn::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::AvailabilityManagerHighTemperatureTurnOn_Impl>());

  setTemperature(30);
}
开发者ID:NREL,项目名称:OpenStudio,代码行数:7,代码来源:AvailabilityManagerHighTemperatureTurnOn.cpp

示例2: throw

ChromoConditions::ChromoConditions(double iColumnLength,
                                   double iColumnDiameter,
                                   double iColumnPoreSize,
                                   Gradient iGradient,
                                   double iSecondSolventConcentrationA,
                                   double iSecondSolventConcentrationB,
                                   double iDelayTime,
                                   double iFlowRate,
                                   double iDV,
                                   double iColumnRelativeStrength,
                                   double iColumnVpToVtot,
                                   double iColumnPorosity,
                                   double iTemperature)
                                   throw(ChromoConditionsException)
{
    // Set an empty gradient to prevent recalculation of SSConcentrations.
    mGradient = Gradient();
    setMixingCorrection(false);
    setColumnLength(iColumnLength);
    setColumnDiameter(iColumnDiameter);
    setColumnPoreSize(iColumnPoreSize);
    setColumnVpToVtot(iColumnVpToVtot);
    setColumnPorosity(iColumnPorosity);
    setTemperature(iTemperature);
    setColumnRelativeStrength(iColumnRelativeStrength);
    setFlowRate(iFlowRate);
    setDV(iDV);
    setDelayTime(iDelayTime);
    setSecondSolventConcentrationA(iSecondSolventConcentrationA);
    setSecondSolventConcentrationB(iSecondSolventConcentrationB);
    setGradient(iGradient);
}
开发者ID:DennisGoldfarb,项目名称:MSAcquisitionSimulator,代码行数:32,代码来源:chromoconditions.cpp

示例3: cmd_Start

int cmd_Start(int iStep){
	// Meshing
	if (steps >= iStep){
		unsigned long timePause = 60u * 1000u * params[iStep-1][1];
		char buffer[256];
		displayData(itoa(iStep, buffer, 10));
		displayData(",");
		displayData(itoa(params[iStep-1][1], buffer, 10));
		displayData(",");
		displayData(itoa(durationMillis / 60u / 1000u, buffer, 10));
		displayData(",");

		int maxTemp = params[iStep-1][0];
		if(params[iStep-1][3] == 1 && isWait){
			maxTemp = 0;
			if(readYes())
				iStep++;
		}

		Serial.println(iStep);

		if (setTemperature(maxTemp)){
			Serial.println(maxTemp);
			unsigned long curMillis = millis();
			durationMillis = durationMillis + (curMillis - prevMillis);
			prevMillis = curMillis;
			if (durationMillis > timePause){
				if(params[iStep-1][2] == 0){
					goNext = true;
				}else if((params[iStep-1][2] == 1) && (readYes())){
					goNext = true;
				}else
					isWait = true;
				if(goNext){
					durationMillis = 0;
					prevMillis = millis();
					iStep++;
					displayData("Step: ");
					displayData(itoa(iStep, buffer, 10));
					displayData("\r\n");
					goNext = false;
					isWait = false;
				}
			}
		}else{
			prevMillis = millis();
		}
	}else
		displayData("Finished\r\n");

	// Check gravity

	// Boiling with melt

	// Boiling + hop

	delay(1000);

	return iStep;
}
开发者ID:geosk,项目名称:brewery,代码行数:60,代码来源:main.cpp

示例4: setTemperature

void ThermoPhase::setState_conditional_TP(doublereal t, doublereal p, bool set_p)
{
    setTemperature(t);
    if (set_p) {
        setPressure(p);
    }
}
开发者ID:Niemeyer-Research-Group,项目名称:cantera,代码行数:7,代码来源:ThermoPhase.cpp

示例5: loop

// The loop function is called in an endless loop
void loop() {
	delay(SENSOR_CHANGE_TRIGGER_TIME);
	unsigned long unchangedTime = millis() - lastMotionDetected;
	if (unchangedTime < MAX_ON_TIME) {
		lcd.display();
		lcd.backlight();
		switch (sensor) {
		case TEMPERATURE_SENSOR_NUM:
			setTemperature();
			break;
		case HUMIDITY_SENSOR_NUM:
			setHumidity();
			break;
		case SOIL_SENSOR_NUM:
			setSoilHumidity();
			break;
		case PRESSURE_SENSOR_NUM:
			setPressure();
			break;
		}
	} else {
		lcd.noDisplay();
		lcd.noBacklight();
	}
	delay(500);
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:27,代码来源:Senser.cpp

示例6: setInitialConfig

void LatticeSim::init(){
  lattice->setAA(fn_aa);
  setInitialConfig();
  setTemperature(0.2);
  lattice->stats.getLatticeStats(lattice);
  lattice->setNative();
  lattice->stats.getLatticeStats(lattice);
}
开发者ID:rganti,项目名称:simulations_exercises,代码行数:8,代码来源:LatticeSim.cpp

示例7: CanteraError

void PDSS_ConstVol::setState_TR(doublereal temp, doublereal rho) {
    doublereal rhoStored = m_mw / m_constMolarVolume;
    if (fabs(rhoStored - rho) / (rhoStored + rho) > 1.0E-4) {
        throw CanteraError("PDSS_ConstVol::setState_TR",
                           "Inconsistent supplied rho");
    }
    setTemperature(temp);
}
开发者ID:hkmoffat,项目名称:cantera,代码行数:8,代码来源:PDSS_ConstVol.cpp

示例8: setSolenoid

Status::Status(){
  setSolenoid(0);
  setReedSwitch(0);
  setVibration(0);
  setMic(1023);
  setHumidity(0.0);
  setTemperature(0.0);
}
开发者ID:spotbox,项目名称:slave,代码行数:8,代码来源:Status.cpp

示例9: setTemperature

/// initialise simulation and create lattice
void Simulation2D::init(string fn_pdb){
  
  
  lattice->readPDBMultiChain(fn_pdb);
  setTemperature(0.2);
  lattice->stats.getLatticeStats(lattice);
  lattice->setNative();
  lattice->stats.getLatticeStats(lattice);
}
开发者ID:rganti,项目名称:simulations_exercises,代码行数:10,代码来源:Simulation2D.cpp

示例10: maxEigenvalue

		Integrator::Integrator( double temperature, double frictionCoeff, double stepSize, const Parameters &params )
			: maxEigenvalue( 4.34e5 ), stepsSinceDiagonalize( 0 ), mParameters( params ), mAnalysis( new Analysis ) {
			setTemperature( temperature );
			setFriction( frictionCoeff );
			setStepSize( stepSize );
			setConstraintTolerance( 1e-4 );
			setMinimumLimit( mParameters.minLimit );
			setRandomNumberSeed( ( int ) time( 0 ) );
		}
开发者ID:Omegaice,项目名称:LTMDOpenMM,代码行数:9,代码来源:Integrator.cpp

示例11: setTemperature

bool TemperatureSensor::StoreTemperature(float t) {
	if (t == NAN) {
		// error reading value
		setTemperature (NAN);
		setRawTemperature(NAN);
		return false;
	}
	else {
		// raw, non-corrected, values
		setRawTemperature(t);
		// correct based on calibration values
		t = t * getCal(TEMP_CAL_INDEX_TEMP_SLOPE) + getCal(TEMP_CAL_INDEX_TEMP_OFFSET);

		// store the corrected temperature value
		setTemperature(t);
		return true;
	}
	return false;
}
开发者ID:intrepidor,项目名称:esp8266-Sensor,代码行数:19,代码来源:temperature.cpp

示例12: initSimulation

/// Initialized the main CoMD data stucture, SimFlat, based on command
/// line input from the user.  Also performs certain sanity checks on
/// the input to screen out certain non-sensical inputs.
///
/// Simple data members such as the time step dt are initialized
/// directly, substructures such as the potential, the link cells, the
/// atoms, etc., are initialized by calling additional initialization
/// functions (initPotential(), initLinkCells(), initAtoms(), etc.).
/// Initialization order is set by the natural dependencies of the
/// substructure such as the atoms need the link cells so the link cells
/// must be initialized before the atoms.
SimFlat* initSimulation(Command cmd)
{
   SimFlat* sim = comdMalloc(sizeof(SimFlat));
   sim->nSteps = cmd.nSteps;
   sim->printRate = cmd.printRate;
   sim->dt = cmd.dt;
   sim->domain = NULL;
   sim->boxes = NULL;
   sim->atoms = NULL;
   sim->ePotential = 0.0;
   sim->eKinetic = 0.0;
   sim->atomExchange = NULL;

   sim->pot = initPotential(cmd.doeam, cmd.potDir, cmd.potName, cmd.potType);
   real_t latticeConstant = cmd.lat;
   if (cmd.lat < 0.0)
      latticeConstant = sim->pot->lat;

   // ensure input parameters make sense.
   sanityChecks(cmd, sim->pot->cutoff, latticeConstant, sim->pot->latticeType);

   sim->species = initSpecies(sim->pot);

   real3 globalExtent;
   globalExtent[0] = cmd.nx * latticeConstant;
   globalExtent[1] = cmd.ny * latticeConstant;
   globalExtent[2] = cmd.nz * latticeConstant;

   sim->domain = initDecomposition(
      cmd.xproc, cmd.yproc, cmd.zproc, globalExtent);

   sim->boxes = initLinkCells(sim->domain, sim->pot->cutoff);
   sim->atoms = initAtoms(sim->boxes);

   // create lattice with desired temperature and displacement.
   createFccLattice(cmd.nx, cmd.ny, cmd.nz, latticeConstant, sim);
   setTemperature(sim, cmd.temperature);
   randomDisplacements(sim, cmd.initialDelta);

   sim->atomExchange = initAtomHaloExchange(sim->domain, sim->boxes);

   // Forces must be computed before we call the time stepper.
   startTimer(redistributeTimer);
   redistributeAtoms(sim);
   stopTimer(redistributeTimer);

   startTimer(computeForceTimer);
   computeForce(sim);
   stopTimer(computeForceTimer);

   kineticEnergy(sim);

   return sim;
}
开发者ID:shamouda,项目名称:ocr-apps,代码行数:65,代码来源:CoMD.c

示例13: setMassFractions_NoNorm

void Phase::restoreState(size_t lenstate, const doublereal* state)
{
    if (lenstate >= nSpecies() + 2) {
        setMassFractions_NoNorm(state + 2);
        setTemperature(state[0]);
        setDensity(state[1]);
    } else {
        throw ArraySizeError("Phase::restoreState",
                             lenstate,nSpecies()+2);
    }
}
开发者ID:MrKingKong,项目名称:cantera,代码行数:11,代码来源:Phase.cpp

示例14: setTemperature

  void SurfPhase::setStateFromXML(const XML_Node& state) {

    double t;
    if (getOptionalFloat(state, "temperature", t, "temperature")) {
      setTemperature(t);
    }

    if (state.hasChild("coverages")) {
      string comp = getChildValue(state,"coverages");
      setCoveragesByName(comp);
    }
  }
开发者ID:anujg1991,项目名称:cantera,代码行数:12,代码来源:SurfPhase.cpp

示例15: WaterPropsIAPWS

void PDSS_Water::constructSet()
{
    if (m_sub) {
        delete m_sub;
    }
    m_sub = new WaterPropsIAPWS();
    if (m_sub == 0) {
        throw CanteraError("PDSS_Water::initThermo",
                           "could not create new substance object.");
    }
    /*
     * Calculate the molecular weight.
     *  hard coded to Cantera's elements and Water.
     */
    m_mw = 2 * 1.00794 + 15.9994;

    /*
     * Set the baseline
     */
    doublereal T = 298.15;

    m_p0 = OneAtm;

    doublereal presLow = 1.0E-2;
    doublereal oneBar = 1.0E5;
    doublereal dens = 1.0E-9;
    m_dens = m_sub->density(T, presLow, WATER_GAS, dens);
    m_pres = presLow;
    SW_Offset = 0.0;
    doublereal s = entropy_mole();
    s -=  GasConstant * log(oneBar/presLow);
    if (s != 188.835E3) {
        SW_Offset = 188.835E3 - s;
    }
    s = entropy_mole();
    s -=  GasConstant * log(oneBar/presLow);
    //printf("s = %g\n", s);

    doublereal h = enthalpy_mole();
    if (h != -241.826E6) {
        EW_Offset = -241.826E6 - h;
    }
    h = enthalpy_mole();
    //printf("h = %g\n", h);

    /*
     * Set the initial state of the system to 298.15 K and
     * 1 bar.
     */
    setTemperature(298.15);
    m_dens = m_sub->density(298.15, OneAtm, WATER_LIQUID);
    m_pres = OneAtm;
}
开发者ID:anujg1991,项目名称:cantera,代码行数:53,代码来源:PDSS_Water.cpp


注:本文中的setTemperature函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。