From 7cd08162b396544334061c7624031070146c5e2c Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 18:23:31 -0600 Subject: [PATCH 1/9] [MATLAB-legacy] Remove toolbox interface --- interfaces/matlab/Contents.m.in | 9 - interfaces/matlab/ctpath.m.in | 4 - interfaces/matlab/testpath.m | 51 --- .../matlab/toolbox/1D/@Domain1D/Domain1D.m | 70 --- .../matlab/toolbox/1D/@Domain1D/clear.m | 9 - .../toolbox/1D/@Domain1D/componentIndex.m | 17 - .../toolbox/1D/@Domain1D/componentName.m | 17 - .../toolbox/1D/@Domain1D/disableEnergy.m | 11 - .../matlab/toolbox/1D/@Domain1D/domainIndex.m | 12 - .../matlab/toolbox/1D/@Domain1D/domainType.m | 10 - .../matlab/toolbox/1D/@Domain1D/domain_hndl.m | 12 - .../toolbox/1D/@Domain1D/enableEnergy.m | 11 - .../matlab/toolbox/1D/@Domain1D/gridPoints.m | 23 - .../matlab/toolbox/1D/@Domain1D/isFlow.m | 12 - .../matlab/toolbox/1D/@Domain1D/isInlet.m | 11 - .../matlab/toolbox/1D/@Domain1D/isSurface.m | 11 - .../matlab/toolbox/1D/@Domain1D/massFlux.m | 10 - .../toolbox/1D/@Domain1D/massFraction.m | 24 -- .../matlab/toolbox/1D/@Domain1D/nComponents.m | 10 - .../matlab/toolbox/1D/@Domain1D/nPoints.m | 10 - .../1D/@Domain1D/private/domain_methods.m | 15 - interfaces/matlab/toolbox/1D/@Domain1D/set.m | 98 ----- .../matlab/toolbox/1D/@Domain1D/setBounds.m | 14 - .../toolbox/1D/@Domain1D/setCoverageEqs.m | 28 -- .../1D/@Domain1D/setFixedTempProfile.m | 24 -- .../matlab/toolbox/1D/@Domain1D/setID.m | 10 - .../matlab/toolbox/1D/@Domain1D/setMdot.m | 10 - .../toolbox/1D/@Domain1D/setMoleFractions.m | 11 - .../matlab/toolbox/1D/@Domain1D/setPressure.m | 10 - .../matlab/toolbox/1D/@Domain1D/setProfile.m | 22 - .../1D/@Domain1D/setSteadyTolerances.m | 30 -- .../toolbox/1D/@Domain1D/setTemperature.m | 10 - .../1D/@Domain1D/setTransientTolerances.m | 30 -- .../matlab/toolbox/1D/@Domain1D/setupGrid.m | 9 - .../matlab/toolbox/1D/@Domain1D/temperature.m | 10 - interfaces/matlab/toolbox/1D/@Stack/Stack.m | 32 -- interfaces/matlab/toolbox/1D/@Stack/clear.m | 8 - interfaces/matlab/toolbox/1D/@Stack/display.m | 13 - .../matlab/toolbox/1D/@Stack/domainIndex.m | 17 - interfaces/matlab/toolbox/1D/@Stack/grid.m | 15 - .../matlab/toolbox/1D/@Stack/plotSolution.m | 19 - .../toolbox/1D/@Stack/private/stack_methods.m | 24 -- interfaces/matlab/toolbox/1D/@Stack/resid.m | 27 -- interfaces/matlab/toolbox/1D/@Stack/restore.m | 16 - interfaces/matlab/toolbox/1D/@Stack/save.m | 24 -- .../matlab/toolbox/1D/@Stack/saveSoln.m | 28 -- .../matlab/toolbox/1D/@Stack/setFlatProfile.m | 14 - .../matlab/toolbox/1D/@Stack/setMaxJacAge.m | 16 - .../matlab/toolbox/1D/@Stack/setProfile.m | 57 --- .../toolbox/1D/@Stack/setRefineCriteria.m | 37 -- .../matlab/toolbox/1D/@Stack/setTimeStep.m | 15 - .../matlab/toolbox/1D/@Stack/setValue.m | 26 -- .../matlab/toolbox/1D/@Stack/solution.m | 34 -- interfaces/matlab/toolbox/1D/@Stack/solve.m | 14 - interfaces/matlab/toolbox/1D/@Stack/subsref.m | 18 - .../matlab/toolbox/1D/@Stack/writeStats.m | 12 - interfaces/matlab/toolbox/1D/AxiStagnFlow.m | 10 - .../matlab/toolbox/1D/AxisymmetricFlow.m | 17 - .../toolbox/1D/CounterFlowDiffusionFlame.m | 219 ---------- interfaces/matlab/toolbox/1D/FreeFlame.m | 18 - interfaces/matlab/toolbox/1D/Inlet.m | 18 - interfaces/matlab/toolbox/1D/Outlet.m | 15 - interfaces/matlab/toolbox/1D/OutletRes.m | 14 - interfaces/matlab/toolbox/1D/Surface.m | 24 -- interfaces/matlab/toolbox/1D/SymmPlane.m | 16 - .../matlab/toolbox/@FlowDevice/FlowDevice.m | 35 -- interfaces/matlab/toolbox/@FlowDevice/clear.m | 8 - .../matlab/toolbox/@FlowDevice/install.m | 27 -- .../matlab/toolbox/@FlowDevice/massFlowRate.m | 10 - .../@FlowDevice/private/flowdevicemethods.m | 13 - .../matlab/toolbox/@FlowDevice/setFunction.m | 20 - .../toolbox/@FlowDevice/setMassFlowRate.m | 19 - .../toolbox/@FlowDevice/setValveCoeff.m | 25 -- interfaces/matlab/toolbox/@Func/Func.m | 99 ----- interfaces/matlab/toolbox/@Func/char.m | 97 ----- interfaces/matlab/toolbox/@Func/clear.m | 8 - interfaces/matlab/toolbox/@Func/display.m | 12 - interfaces/matlab/toolbox/@Func/func_hndl.m | 10 - interfaces/matlab/toolbox/@Func/plus.m | 14 - .../toolbox/@Func/private/funcmethods.m | 13 - interfaces/matlab/toolbox/@Func/rdivide.m | 12 - interfaces/matlab/toolbox/@Func/subsref.m | 21 - interfaces/matlab/toolbox/@Func/times.m | 12 - .../matlab/toolbox/@Interface/Interface.m | 41 -- .../toolbox/@Interface/concentrations.m | 23 - .../matlab/toolbox/@Interface/coverages.m | 23 - .../toolbox/@Interface/private/surfmethods.m | 24 -- .../matlab/toolbox/@Interface/setCoverages.m | 34 -- .../matlab/toolbox/@Kinetics/Kinetics.m | 67 --- .../toolbox/@Kinetics/advanceCoverages.m | 13 - interfaces/matlab/toolbox/@Kinetics/clear.m | 9 - .../matlab/toolbox/@Kinetics/creationRates.m | 25 -- .../toolbox/@Kinetics/destructionRates.m | 25 -- .../matlab/toolbox/@Kinetics/equil_Kc.m | 27 -- .../toolbox/@Kinetics/fwdRateConstants.m | 23 - .../toolbox/@Kinetics/getDeltaEnthalpies.m | 14 - .../toolbox/@Kinetics/getDeltaEntropies.m | 14 - .../matlab/toolbox/@Kinetics/getDeltaGibbs.m | 14 - .../matlab/toolbox/@Kinetics/isReversible.m | 25 -- .../matlab/toolbox/@Kinetics/kinetics_hndl.m | 12 - .../matlab/toolbox/@Kinetics/multiplier.m | 21 - .../matlab/toolbox/@Kinetics/nReactions.m | 12 - .../matlab/toolbox/@Kinetics/nTotalSpecies.m | 15 - .../matlab/toolbox/@Kinetics/netProdRates.m | 25 -- .../toolbox/@Kinetics/private/kinetics_get.m | 20 - .../toolbox/@Kinetics/private/kinetics_set.m | 4 - .../matlab/toolbox/@Kinetics/reactionEqn.m | 40 -- .../toolbox/@Kinetics/revRateConstants.m | 23 - interfaces/matlab/toolbox/@Kinetics/rop.m | 30 -- interfaces/matlab/toolbox/@Kinetics/rop_f.m | 25 -- interfaces/matlab/toolbox/@Kinetics/rop_net.m | 25 -- interfaces/matlab/toolbox/@Kinetics/rop_r.m | 25 -- .../matlab/toolbox/@Kinetics/setMultiplier.m | 40 -- .../matlab/toolbox/@Kinetics/stoich_net.m | 36 -- .../matlab/toolbox/@Kinetics/stoich_p.m | 51 --- .../matlab/toolbox/@Kinetics/stoich_r.m | 51 --- interfaces/matlab/toolbox/@Kinetics/ydot.m | 14 - interfaces/matlab/toolbox/@Mixture/Mixture.m | 63 --- interfaces/matlab/toolbox/@Mixture/addPhase.m | 28 -- .../matlab/toolbox/@Mixture/chemPotentials.m | 10 - interfaces/matlab/toolbox/@Mixture/clear.m | 8 - interfaces/matlab/toolbox/@Mixture/display.m | 15 - .../matlab/toolbox/@Mixture/elementIndex.m | 12 - .../matlab/toolbox/@Mixture/equilibrate.m | 61 --- interfaces/matlab/toolbox/@Mixture/mix_hndl.m | 10 - .../matlab/toolbox/@Mixture/nElements.m | 10 - interfaces/matlab/toolbox/@Mixture/nPhases.m | 10 - interfaces/matlab/toolbox/@Mixture/nSpecies.m | 10 - .../matlab/toolbox/@Mixture/phaseMoles.m | 23 - interfaces/matlab/toolbox/@Mixture/pressure.m | 10 - .../toolbox/@Mixture/private/mixturemethods.m | 17 - .../matlab/toolbox/@Mixture/setPhaseMoles.m | 12 - .../matlab/toolbox/@Mixture/setPressure.m | 10 - .../matlab/toolbox/@Mixture/setSpeciesMoles.m | 18 - .../matlab/toolbox/@Mixture/setTemperature.m | 10 - .../matlab/toolbox/@Mixture/speciesIndex.m | 12 - .../matlab/toolbox/@Mixture/temperature.m | 10 - interfaces/matlab/toolbox/@Reactor/Reactor.m | 55 --- interfaces/matlab/toolbox/@Reactor/clear.m | 8 - interfaces/matlab/toolbox/@Reactor/density.m | 10 - .../matlab/toolbox/@Reactor/enthalpy_mass.m | 15 - interfaces/matlab/toolbox/@Reactor/insert.m | 14 - .../matlab/toolbox/@Reactor/intEnergy_mass.m | 15 - interfaces/matlab/toolbox/@Reactor/mass.m | 12 - .../matlab/toolbox/@Reactor/massFraction.m | 19 - .../matlab/toolbox/@Reactor/massFractions.m | 16 - interfaces/matlab/toolbox/@Reactor/pressure.m | 12 - .../toolbox/@Reactor/private/reactormethods.m | 13 - .../matlab/toolbox/@Reactor/reactor_hndl.m | 11 - .../matlab/toolbox/@Reactor/setChemistry.m | 29 -- .../matlab/toolbox/@Reactor/setEnergy.m | 32 -- .../toolbox/@Reactor/setInitialVolume.m | 10 - .../matlab/toolbox/@Reactor/setKineticsMgr.m | 18 - .../matlab/toolbox/@Reactor/setMassFlowRate.m | 10 - .../matlab/toolbox/@Reactor/setThermoMgr.m | 18 - .../matlab/toolbox/@Reactor/temperature.m | 12 - interfaces/matlab/toolbox/@Reactor/volume.m | 12 - .../matlab/toolbox/@ReactorNet/ReactorNet.m | 46 -- .../matlab/toolbox/@ReactorNet/addReactor.m | 10 - .../matlab/toolbox/@ReactorNet/advance.m | 31 -- interfaces/matlab/toolbox/@ReactorNet/atol.m | 11 - interfaces/matlab/toolbox/@ReactorNet/clear.m | 8 - .../@ReactorNet/private/reactornetmethods.m | 13 - .../toolbox/@ReactorNet/reactornet_hndl.m | 11 - interfaces/matlab/toolbox/@ReactorNet/rtol.m | 10 - .../toolbox/@ReactorNet/setInitialTime.m | 15 - .../toolbox/@ReactorNet/setMaxTimeStep.m | 18 - .../toolbox/@ReactorNet/setTolerances.m | 12 - interfaces/matlab/toolbox/@ReactorNet/step.m | 36 -- interfaces/matlab/toolbox/@ReactorNet/time.m | 10 - .../toolbox/@ReactorSurface/ReactorSurface.m | 55 --- .../matlab/toolbox/@ReactorSurface/area.m | 10 - .../matlab/toolbox/@ReactorSurface/clear.m | 8 - .../matlab/toolbox/@ReactorSurface/install.m | 11 - .../private/reactorsurfacemethods.m | 13 - .../@ReactorSurface/reactorsurface_hndl.m | 11 - .../matlab/toolbox/@ReactorSurface/setArea.m | 10 - .../toolbox/@ReactorSurface/setKinetics.m | 17 - .../matlab/toolbox/@Solution/Solution.m | 60 --- interfaces/matlab/toolbox/@Solution/clear.m | 11 - .../matlab/toolbox/@ThermoPhase/ThermoPhase.m | 25 -- .../toolbox/@ThermoPhase/atomicMasses.m | 11 - .../matlab/toolbox/@ThermoPhase/charges.m | 12 - .../toolbox/@ThermoPhase/chemPotentials.m | 20 - .../matlab/toolbox/@ThermoPhase/clear.m | 10 - interfaces/matlab/toolbox/@ThermoPhase/cp_R.m | 12 - .../matlab/toolbox/@ThermoPhase/cp_mass.m | 12 - .../matlab/toolbox/@ThermoPhase/cp_mole.m | 12 - .../matlab/toolbox/@ThermoPhase/critDensity.m | 11 - .../toolbox/@ThermoPhase/critPressure.m | 11 - .../toolbox/@ThermoPhase/critTemperature.m | 11 - .../matlab/toolbox/@ThermoPhase/cv_mass.m | 12 - .../matlab/toolbox/@ThermoPhase/cv_mole.m | 12 - .../matlab/toolbox/@ThermoPhase/density.m | 11 - .../matlab/toolbox/@ThermoPhase/display.m | 5 - .../toolbox/@ThermoPhase/electricPotential.m | 11 - .../toolbox/@ThermoPhase/elementIndex.m | 39 -- .../matlab/toolbox/@ThermoPhase/elementName.m | 22 - .../@ThermoPhase/elementalMassFraction.m | 51 --- .../toolbox/@ThermoPhase/enthalpies_RT.m | 14 - .../toolbox/@ThermoPhase/enthalpy_mass.m | 11 - .../toolbox/@ThermoPhase/enthalpy_mole.m | 11 - .../matlab/toolbox/@ThermoPhase/entropies_R.m | 11 - .../toolbox/@ThermoPhase/entropy_mass.m | 11 - .../toolbox/@ThermoPhase/entropy_mole.m | 11 - .../matlab/toolbox/@ThermoPhase/eosType.m | 11 - .../matlab/toolbox/@ThermoPhase/equilibrate.m | 57 --- .../matlab/toolbox/@ThermoPhase/gibbs_RT.m | 11 - .../matlab/toolbox/@ThermoPhase/gibbs_mass.m | 11 - .../matlab/toolbox/@ThermoPhase/gibbs_mole.m | 11 - .../toolbox/@ThermoPhase/intEnergy_mass.m | 11 - .../toolbox/@ThermoPhase/intEnergy_mole.m | 11 - .../matlab/toolbox/@ThermoPhase/isIdealGas.m | 16 - .../@ThermoPhase/isothermalCompressibility.m | 12 - .../toolbox/@ThermoPhase/massFraction.m | 31 -- .../toolbox/@ThermoPhase/massFractions.m | 20 - .../matlab/toolbox/@ThermoPhase/maxTemp.m | 18 - .../@ThermoPhase/meanMolecularWeight.m | 14 - .../matlab/toolbox/@ThermoPhase/minTemp.m | 18 - .../toolbox/@ThermoPhase/molarDensity.m | 11 - .../toolbox/@ThermoPhase/moleFraction.m | 31 -- .../toolbox/@ThermoPhase/moleFractions.m | 20 - .../toolbox/@ThermoPhase/molecularWeights.m | 12 - .../matlab/toolbox/@ThermoPhase/nAtoms.m | 25 -- .../matlab/toolbox/@ThermoPhase/nElements.m | 11 - .../matlab/toolbox/@ThermoPhase/nSpecies.m | 11 - interfaces/matlab/toolbox/@ThermoPhase/name.m | 11 - .../matlab/toolbox/@ThermoPhase/pressure.m | 11 - .../toolbox/@ThermoPhase/private/phase_get.m | 8 - .../toolbox/@ThermoPhase/private/phase_set.m | 8 - .../toolbox/@ThermoPhase/private/thermo_get.m | 8 - .../toolbox/@ThermoPhase/private/thermo_set.m | 16 - .../matlab/toolbox/@ThermoPhase/refPressure.m | 12 - .../matlab/toolbox/@ThermoPhase/satPressure.m | 13 - .../toolbox/@ThermoPhase/satTemperature.m | 13 - interfaces/matlab/toolbox/@ThermoPhase/set.m | 206 --------- .../matlab/toolbox/@ThermoPhase/setDensity.m | 15 - .../@ThermoPhase/setElectricPotential.m | 11 - .../toolbox/@ThermoPhase/setMassFractions.m | 43 -- .../toolbox/@ThermoPhase/setMoleFractions.m | 43 -- .../matlab/toolbox/@ThermoPhase/setName.m | 15 - .../matlab/toolbox/@ThermoPhase/setPressure.m | 18 - .../matlab/toolbox/@ThermoPhase/setState_DP.m | 16 - .../matlab/toolbox/@ThermoPhase/setState_HP.m | 16 - .../matlab/toolbox/@ThermoPhase/setState_PV.m | 12 - .../toolbox/@ThermoPhase/setState_Psat.m | 16 - .../matlab/toolbox/@ThermoPhase/setState_SH.m | 12 - .../matlab/toolbox/@ThermoPhase/setState_SP.m | 18 - .../matlab/toolbox/@ThermoPhase/setState_ST.m | 12 - .../matlab/toolbox/@ThermoPhase/setState_SV.m | 18 - .../matlab/toolbox/@ThermoPhase/setState_TH.m | 12 - .../matlab/toolbox/@ThermoPhase/setState_TV.m | 12 - .../toolbox/@ThermoPhase/setState_Tsat.m | 16 - .../matlab/toolbox/@ThermoPhase/setState_UP.m | 12 - .../matlab/toolbox/@ThermoPhase/setState_UV.m | 16 - .../matlab/toolbox/@ThermoPhase/setState_VH.m | 12 - .../toolbox/@ThermoPhase/setState_satLiquid.m | 9 - .../toolbox/@ThermoPhase/setState_satVapor.m | 9 - .../toolbox/@ThermoPhase/setTemperature.m | 14 - .../matlab/toolbox/@ThermoPhase/soundspeed.m | 43 -- .../toolbox/@ThermoPhase/speciesIndex.m | 40 -- .../matlab/toolbox/@ThermoPhase/speciesName.m | 19 - .../toolbox/@ThermoPhase/speciesNames.m | 11 - .../matlab/toolbox/@ThermoPhase/temperature.m | 11 - .../@ThermoPhase/thermalExpansionCoeff.m | 11 - .../matlab/toolbox/@ThermoPhase/thermo_hndl.m | 12 - .../toolbox/@ThermoPhase/vaporFraction.m | 11 - .../matlab/toolbox/@Transport/Transport.m | 43 -- .../matlab/toolbox/@Transport/binDiffCoeffs.m | 13 - interfaces/matlab/toolbox/@Transport/clear.m | 9 - .../@Transport/electricalConductivity.m | 17 - .../matlab/toolbox/@Transport/mixDiffCoeffs.m | 26 -- .../toolbox/@Transport/multiDiffCoeffs.m | 29 -- .../toolbox/@Transport/private/trans_get.m | 14 - .../@Transport/setThermalConductivity.m | 15 - .../toolbox/@Transport/thermalConductivity.m | 17 - .../toolbox/@Transport/thermalDiffCoeffs.m | 17 - .../matlab/toolbox/@Transport/trans_hndl.m | 12 - .../matlab/toolbox/@Transport/viscosity.m | 17 - interfaces/matlab/toolbox/@Wall/Wall.m | 119 ------ interfaces/matlab/toolbox/@Wall/area.m | 10 - interfaces/matlab/toolbox/@Wall/clear.m | 8 - interfaces/matlab/toolbox/@Wall/install.m | 16 - .../toolbox/@Wall/private/wallmethods.m | 13 - interfaces/matlab/toolbox/@Wall/qdot.m | 15 - interfaces/matlab/toolbox/@Wall/ready.m | 10 - interfaces/matlab/toolbox/@Wall/setArea.m | 10 - .../toolbox/@Wall/setExpansionRateCoeff.m | 20 - interfaces/matlab/toolbox/@Wall/setHeatFlux.m | 24 -- .../toolbox/@Wall/setHeatTransferCoeff.m | 10 - .../toolbox/@Wall/setThermalResistance.m | 10 - interfaces/matlab/toolbox/@Wall/setVelocity.m | 23 - interfaces/matlab/toolbox/@Wall/vdot.m | 15 - interfaces/matlab/toolbox/@Wall/wall_hndl.m | 11 - interfaces/matlab/toolbox/Air.m | 12 - interfaces/matlab/toolbox/CarbonDioxide.m | 20 - .../matlab/toolbox/ConstPressureReactor.m | 26 -- interfaces/matlab/toolbox/FlowReactor.m | 24 -- interfaces/matlab/toolbox/GRI30.m | 39 -- interfaces/matlab/toolbox/HFC134a.m | 21 - interfaces/matlab/toolbox/Heptane.m | 20 - interfaces/matlab/toolbox/Hydrogen.m | 20 - .../toolbox/IdealGasConstPressureReactor.m | 28 -- interfaces/matlab/toolbox/IdealGasReactor.m | 25 -- .../matlab/toolbox/MassFlowController.m | 25 -- interfaces/matlab/toolbox/Methane.m | 17 - interfaces/matlab/toolbox/Nitrogen.m | 17 - interfaces/matlab/toolbox/Oxygen.m | 17 - interfaces/matlab/toolbox/Reservoir.m | 30 -- interfaces/matlab/toolbox/Valve.m | 36 -- interfaces/matlab/toolbox/Water.m | 20 - interfaces/matlab/toolbox/adddir.m | 11 - interfaces/matlab/toolbox/canteraGitCommit.m | 9 - interfaces/matlab/toolbox/canteraVersion.m | 10 - interfaces/matlab/toolbox/cleanup.m | 6 - interfaces/matlab/toolbox/faradayconstant.m | 8 - interfaces/matlab/toolbox/gasconstant.m | 8 - interfaces/matlab/toolbox/gaussian.m | 14 - .../matlab/toolbox/getDataDirectories.m | 10 - interfaces/matlab/toolbox/geterr.m | 10 - interfaces/matlab/toolbox/importEdge.m | 34 -- interfaces/matlab/toolbox/importInterface.m | 26 -- interfaces/matlab/toolbox/oneatm.m | 8 - interfaces/matlab/toolbox/polynom.m | 25 -- .../matlab/toolbox/useLegacyRateConstants.m | 14 - src/matlab/SConscript | 116 ----- src/matlab/ctfunctions.cpp | 105 ----- src/matlab/ctmatutils.h | 58 --- src/matlab/ctmethods.cpp | 150 ------- src/matlab/flowdevicemethods.cpp | 87 ---- src/matlab/funcmethods.cpp | 65 --- src/matlab/kineticsmethods.cpp | 189 -------- src/matlab/mexFunction.map | 6 - src/matlab/mixturemethods.cpp | 172 -------- src/matlab/mllogger.h | 38 -- src/matlab/onedimmethods.cpp | 402 ------------------ src/matlab/phasemethods.cpp | 294 ------------- src/matlab/reactormethods.cpp | 111 ----- src/matlab/reactornetmethods.cpp | 97 ----- src/matlab/reactorsurfacemethods.cpp | 80 ---- src/matlab/surfmethods.cpp | 94 ---- src/matlab/thermomethods.cpp | 277 ------------ src/matlab/transportmethods.cpp | 110 ----- src/matlab/wallmethods.cpp | 105 ----- test/matlab/TestImport.m | 12 - test/matlab/TestThermo.m | 72 ---- test/matlab/runCanteraTests.m | 19 - 347 files changed, 9339 deletions(-) delete mode 100644 interfaces/matlab/Contents.m.in delete mode 100644 interfaces/matlab/ctpath.m.in delete mode 100644 interfaces/matlab/testpath.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/Domain1D.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/clear.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/componentIndex.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/componentName.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/disableEnergy.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/domainIndex.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/domainType.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/domain_hndl.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/enableEnergy.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/gridPoints.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/isFlow.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/isInlet.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/isSurface.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/massFlux.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/massFraction.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/nComponents.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/nPoints.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/private/domain_methods.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/set.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setBounds.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setCoverageEqs.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setFixedTempProfile.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setID.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setMdot.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setMoleFractions.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setPressure.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setProfile.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setSteadyTolerances.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setTemperature.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setTransientTolerances.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/setupGrid.m delete mode 100644 interfaces/matlab/toolbox/1D/@Domain1D/temperature.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/Stack.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/clear.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/display.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/domainIndex.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/grid.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/plotSolution.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/private/stack_methods.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/resid.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/restore.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/save.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/saveSoln.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/setFlatProfile.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/setMaxJacAge.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/setProfile.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/setRefineCriteria.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/setTimeStep.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/setValue.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/solution.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/solve.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/subsref.m delete mode 100644 interfaces/matlab/toolbox/1D/@Stack/writeStats.m delete mode 100644 interfaces/matlab/toolbox/1D/AxiStagnFlow.m delete mode 100644 interfaces/matlab/toolbox/1D/AxisymmetricFlow.m delete mode 100644 interfaces/matlab/toolbox/1D/CounterFlowDiffusionFlame.m delete mode 100644 interfaces/matlab/toolbox/1D/FreeFlame.m delete mode 100644 interfaces/matlab/toolbox/1D/Inlet.m delete mode 100644 interfaces/matlab/toolbox/1D/Outlet.m delete mode 100644 interfaces/matlab/toolbox/1D/OutletRes.m delete mode 100644 interfaces/matlab/toolbox/1D/Surface.m delete mode 100644 interfaces/matlab/toolbox/1D/SymmPlane.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/clear.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/install.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/private/flowdevicemethods.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/setFunction.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/setMassFlowRate.m delete mode 100644 interfaces/matlab/toolbox/@FlowDevice/setValveCoeff.m delete mode 100644 interfaces/matlab/toolbox/@Func/Func.m delete mode 100644 interfaces/matlab/toolbox/@Func/char.m delete mode 100644 interfaces/matlab/toolbox/@Func/clear.m delete mode 100644 interfaces/matlab/toolbox/@Func/display.m delete mode 100644 interfaces/matlab/toolbox/@Func/func_hndl.m delete mode 100644 interfaces/matlab/toolbox/@Func/plus.m delete mode 100644 interfaces/matlab/toolbox/@Func/private/funcmethods.m delete mode 100644 interfaces/matlab/toolbox/@Func/rdivide.m delete mode 100644 interfaces/matlab/toolbox/@Func/subsref.m delete mode 100644 interfaces/matlab/toolbox/@Func/times.m delete mode 100644 interfaces/matlab/toolbox/@Interface/Interface.m delete mode 100644 interfaces/matlab/toolbox/@Interface/concentrations.m delete mode 100644 interfaces/matlab/toolbox/@Interface/coverages.m delete mode 100644 interfaces/matlab/toolbox/@Interface/private/surfmethods.m delete mode 100644 interfaces/matlab/toolbox/@Interface/setCoverages.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/Kinetics.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/advanceCoverages.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/clear.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/creationRates.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/destructionRates.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/equil_Kc.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/fwdRateConstants.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/getDeltaEnthalpies.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/getDeltaEntropies.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/getDeltaGibbs.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/isReversible.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/kinetics_hndl.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/multiplier.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/nReactions.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/nTotalSpecies.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/netProdRates.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/private/kinetics_get.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/private/kinetics_set.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/reactionEqn.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/revRateConstants.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/rop.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/rop_f.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/rop_net.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/rop_r.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/setMultiplier.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/stoich_net.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/stoich_p.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/stoich_r.m delete mode 100644 interfaces/matlab/toolbox/@Kinetics/ydot.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/Mixture.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/addPhase.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/chemPotentials.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/clear.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/display.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/elementIndex.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/equilibrate.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/mix_hndl.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/nElements.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/nPhases.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/nSpecies.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/phaseMoles.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/pressure.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/private/mixturemethods.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/setPhaseMoles.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/setPressure.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/setSpeciesMoles.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/setTemperature.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/speciesIndex.m delete mode 100644 interfaces/matlab/toolbox/@Mixture/temperature.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/Reactor.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/clear.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/density.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/enthalpy_mass.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/insert.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/intEnergy_mass.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/mass.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/massFraction.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/massFractions.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/pressure.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/private/reactormethods.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/reactor_hndl.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/setChemistry.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/setEnergy.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/setInitialVolume.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/setKineticsMgr.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/setMassFlowRate.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/setThermoMgr.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/temperature.m delete mode 100644 interfaces/matlab/toolbox/@Reactor/volume.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/ReactorNet.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/addReactor.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/advance.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/atol.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/clear.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/private/reactornetmethods.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/reactornet_hndl.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/rtol.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/setInitialTime.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/setMaxTimeStep.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/setTolerances.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/step.m delete mode 100644 interfaces/matlab/toolbox/@ReactorNet/time.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/ReactorSurface.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/area.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/clear.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/install.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/private/reactorsurfacemethods.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/reactorsurface_hndl.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/setArea.m delete mode 100644 interfaces/matlab/toolbox/@ReactorSurface/setKinetics.m delete mode 100644 interfaces/matlab/toolbox/@Solution/Solution.m delete mode 100644 interfaces/matlab/toolbox/@Solution/clear.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/atomicMasses.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/charges.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/chemPotentials.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/clear.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/cp_R.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/cp_mass.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/cp_mole.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/critDensity.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/critPressure.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/critTemperature.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/cv_mass.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/cv_mole.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/density.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/display.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/electricPotential.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/elementIndex.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/elementName.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/elementalMassFraction.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/enthalpies_RT.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mass.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mole.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/entropies_R.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/entropy_mass.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/entropy_mole.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/eosType.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/equilibrate.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/gibbs_RT.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/gibbs_mass.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/gibbs_mole.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mass.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mole.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/isothermalCompressibility.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/massFraction.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/massFractions.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/maxTemp.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/meanMolecularWeight.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/minTemp.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/molarDensity.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/moleFraction.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/moleFractions.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/molecularWeights.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/nAtoms.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/nElements.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/nSpecies.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/name.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/pressure.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/private/phase_get.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/private/phase_set.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/private/thermo_get.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/private/thermo_set.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/refPressure.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/satPressure.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/satTemperature.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/set.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setDensity.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setElectricPotential.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setMassFractions.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setMoleFractions.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setName.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setPressure.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_DP.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_HP.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_Psat.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_SP.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_SV.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_Tsat.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_UV.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_satLiquid.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setState_satVapor.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/setTemperature.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/soundspeed.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/speciesIndex.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/speciesName.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/speciesNames.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/temperature.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/thermalExpansionCoeff.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/thermo_hndl.m delete mode 100644 interfaces/matlab/toolbox/@ThermoPhase/vaporFraction.m delete mode 100644 interfaces/matlab/toolbox/@Transport/Transport.m delete mode 100644 interfaces/matlab/toolbox/@Transport/binDiffCoeffs.m delete mode 100644 interfaces/matlab/toolbox/@Transport/clear.m delete mode 100644 interfaces/matlab/toolbox/@Transport/electricalConductivity.m delete mode 100644 interfaces/matlab/toolbox/@Transport/mixDiffCoeffs.m delete mode 100644 interfaces/matlab/toolbox/@Transport/multiDiffCoeffs.m delete mode 100644 interfaces/matlab/toolbox/@Transport/private/trans_get.m delete mode 100644 interfaces/matlab/toolbox/@Transport/setThermalConductivity.m delete mode 100644 interfaces/matlab/toolbox/@Transport/thermalConductivity.m delete mode 100644 interfaces/matlab/toolbox/@Transport/thermalDiffCoeffs.m delete mode 100644 interfaces/matlab/toolbox/@Transport/trans_hndl.m delete mode 100644 interfaces/matlab/toolbox/@Transport/viscosity.m delete mode 100644 interfaces/matlab/toolbox/@Wall/Wall.m delete mode 100644 interfaces/matlab/toolbox/@Wall/area.m delete mode 100644 interfaces/matlab/toolbox/@Wall/clear.m delete mode 100644 interfaces/matlab/toolbox/@Wall/install.m delete mode 100644 interfaces/matlab/toolbox/@Wall/private/wallmethods.m delete mode 100644 interfaces/matlab/toolbox/@Wall/qdot.m delete mode 100644 interfaces/matlab/toolbox/@Wall/ready.m delete mode 100644 interfaces/matlab/toolbox/@Wall/setArea.m delete mode 100644 interfaces/matlab/toolbox/@Wall/setExpansionRateCoeff.m delete mode 100644 interfaces/matlab/toolbox/@Wall/setHeatFlux.m delete mode 100644 interfaces/matlab/toolbox/@Wall/setHeatTransferCoeff.m delete mode 100644 interfaces/matlab/toolbox/@Wall/setThermalResistance.m delete mode 100644 interfaces/matlab/toolbox/@Wall/setVelocity.m delete mode 100644 interfaces/matlab/toolbox/@Wall/vdot.m delete mode 100644 interfaces/matlab/toolbox/@Wall/wall_hndl.m delete mode 100644 interfaces/matlab/toolbox/Air.m delete mode 100644 interfaces/matlab/toolbox/CarbonDioxide.m delete mode 100644 interfaces/matlab/toolbox/ConstPressureReactor.m delete mode 100644 interfaces/matlab/toolbox/FlowReactor.m delete mode 100644 interfaces/matlab/toolbox/GRI30.m delete mode 100644 interfaces/matlab/toolbox/HFC134a.m delete mode 100644 interfaces/matlab/toolbox/Heptane.m delete mode 100644 interfaces/matlab/toolbox/Hydrogen.m delete mode 100644 interfaces/matlab/toolbox/IdealGasConstPressureReactor.m delete mode 100644 interfaces/matlab/toolbox/IdealGasReactor.m delete mode 100644 interfaces/matlab/toolbox/MassFlowController.m delete mode 100644 interfaces/matlab/toolbox/Methane.m delete mode 100644 interfaces/matlab/toolbox/Nitrogen.m delete mode 100644 interfaces/matlab/toolbox/Oxygen.m delete mode 100644 interfaces/matlab/toolbox/Reservoir.m delete mode 100644 interfaces/matlab/toolbox/Valve.m delete mode 100644 interfaces/matlab/toolbox/Water.m delete mode 100644 interfaces/matlab/toolbox/adddir.m delete mode 100644 interfaces/matlab/toolbox/canteraGitCommit.m delete mode 100644 interfaces/matlab/toolbox/canteraVersion.m delete mode 100644 interfaces/matlab/toolbox/cleanup.m delete mode 100644 interfaces/matlab/toolbox/faradayconstant.m delete mode 100644 interfaces/matlab/toolbox/gasconstant.m delete mode 100644 interfaces/matlab/toolbox/gaussian.m delete mode 100644 interfaces/matlab/toolbox/getDataDirectories.m delete mode 100644 interfaces/matlab/toolbox/geterr.m delete mode 100644 interfaces/matlab/toolbox/importEdge.m delete mode 100644 interfaces/matlab/toolbox/importInterface.m delete mode 100644 interfaces/matlab/toolbox/oneatm.m delete mode 100644 interfaces/matlab/toolbox/polynom.m delete mode 100644 interfaces/matlab/toolbox/useLegacyRateConstants.m delete mode 100644 src/matlab/SConscript delete mode 100644 src/matlab/ctfunctions.cpp delete mode 100644 src/matlab/ctmatutils.h delete mode 100644 src/matlab/ctmethods.cpp delete mode 100644 src/matlab/flowdevicemethods.cpp delete mode 100644 src/matlab/funcmethods.cpp delete mode 100644 src/matlab/kineticsmethods.cpp delete mode 100644 src/matlab/mexFunction.map delete mode 100644 src/matlab/mixturemethods.cpp delete mode 100644 src/matlab/mllogger.h delete mode 100644 src/matlab/onedimmethods.cpp delete mode 100644 src/matlab/phasemethods.cpp delete mode 100644 src/matlab/reactormethods.cpp delete mode 100644 src/matlab/reactornetmethods.cpp delete mode 100644 src/matlab/reactorsurfacemethods.cpp delete mode 100644 src/matlab/surfmethods.cpp delete mode 100644 src/matlab/thermomethods.cpp delete mode 100644 src/matlab/transportmethods.cpp delete mode 100644 src/matlab/wallmethods.cpp delete mode 100644 test/matlab/TestImport.m delete mode 100644 test/matlab/TestThermo.m delete mode 100644 test/matlab/runCanteraTests.m diff --git a/interfaces/matlab/Contents.m.in b/interfaces/matlab/Contents.m.in deleted file mode 100644 index 232effc33e..0000000000 --- a/interfaces/matlab/Contents.m.in +++ /dev/null @@ -1,9 +0,0 @@ -% Cantera Toolbox -% Version @cantera_version@ -% -% Cantera is a suite of object-oriented software tools for -% problems involving chemical kinetics, thermodynamics, -% and/or transport processes. -% -% Documentation for Cantera can be found at -% https://cantera.org/documentation/index.html diff --git a/interfaces/matlab/ctpath.m.in b/interfaces/matlab/ctpath.m.in deleted file mode 100644 index 8bf84bdfad..0000000000 --- a/interfaces/matlab/ctpath.m.in +++ /dev/null @@ -1,4 +0,0 @@ -path('@ct_matlab_dir@', path) -path('@ct_matlab_dir@/1D', path) -setenv('PYTHON_CMD', '@python_cmd@') -setenv('PYTHONPATH', [getenv('PYTHONPATH'), ':@python_module_loc_sc@']) diff --git a/interfaces/matlab/testpath.m b/interfaces/matlab/testpath.m deleted file mode 100644 index ef5924b2ee..0000000000 --- a/interfaces/matlab/testpath.m +++ /dev/null @@ -1,51 +0,0 @@ -% testpath.m -% Set up environment for testing the Cantera Matlab interface -% from within the Cantera source tree. Run this file from the -% root of the Cantera source tree, for example: -% -% cd ~/src/cantera -% run interfaces/matlab/testpath.m - -% Unload the mex file so copying the DLL will work -clear ctmethods - -% get the list of directories on the Matlab path -dirs = regexp(path, ['([^' pathsep ']*)'], 'match'); - -% if 'cantera' is already in the path, remove it -for i = 1:length(dirs) - if strfind(dirs{i}, 'Cantera') - rmpath(dirs{i}); - continue; - end - if strfind(dirs{i}, 'cantera') - rmpath(dirs{i}); - end -end - -% Add the Cantera toolbox to the Matlab path -path(path, fullfile(pwd, 'toolbox')); -path(path, fullfile(pwd, 'toolbox', '1D')); - -cantera_root = fullfile(pwd, '..', '..'); - -% Copy the Cantera shared library from the build directory if necessary -if strcmp(getenv('OS'), 'Windows_NT') - copyfile(fullfile(cantera_root, 'build', 'lib', 'cantera_shared.dll'), ... - fullfile(pwd, 'toolbox')) -end - -% Set path to Python module -if strcmp(getenv('PYTHONPATH'), '') - setenv('PYTHONPATH', fullfile(cantera_root, 'build', 'python')) -end - -% A simple test to make sure that the ctmethods.mex file is present and working -f = Func('polynomial', 3, [1,2,3,4]); -if f(1) == 10 - disp('Cantera MEX file successfully loaded.') -else - disp('Something is wrong with the Cantera MEX file.') -end - -adddir(fullfile(cantera_root, 'data', 'inputs')) diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/Domain1D.m b/interfaces/matlab/toolbox/1D/@Domain1D/Domain1D.m deleted file mode 100644 index 62191d59fb..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/Domain1D.m +++ /dev/null @@ -1,70 +0,0 @@ -function d = Domain1D(a, b, c) -% DOMAIN1D Domain1D class constructor. -% d = Domain1D(a, b, c) -% :param a: -% Integer type of domain. Possible values are -% -% * 1 - Stagnation Flow -% * 2 - Inlet1D -% * 3 - Surf1D -% * 4 - Symm1D -% * 5 - Outlet1D -% * 6 - Reacting Surface -% * 8 - Sim1D -% * -2 - OutletRes -% -% :param b: -% Instance of class :mat:func:`Solution` (for ``a == 1``) -% or :mat:func:`Interface` (for ``a == 6``). Not used for -% all other valid values of ``a``. -% :param c: -% Integer, either 1 or 2, indicating whether an axisymmetric -% stagnation flow or a free flame should be created. If not -% specified, defaults to 1. Ignored if ``a != 1``. -% - -d.dom_id = -1; - -% Valid job numbers for one argument -valid_jobs = [2, 3, 4, 5, -2]; -if nargin == 1 - if any(a == valid_jobs) - d.dom_id = domain_methods(0, a); - else - error('Not enough arguments for that job number') - end -elseif nargin == 2 - % a stagnation flow - if a == 1 - if isa(b, 'Solution') - d.dom_id = domain_methods(0, 1, thermo_hndl(b), kinetics_hndl(b), ... - trans_hndl(b), 1); - else - error('Wrong argument type. Expecting instance of class Solution.'); - end - elseif a == 6 - if isa(b, 'Interface') - d.dom_id = domain_methods(0, 6, kinetics_hndl(b)); - else - error('Wrong argument type. Expecting instance of class Interface.'); - end - else - error('Wrong object type.'); - end -elseif nargin == 3 - if a == 1 - if isa(b, 'Solution') - d.dom_id = domain_methods(0, 1, thermo_hndl(b), kinetics_hndl(b), ... - trans_hndl(b), c); - else - error('Wrong argument type. Expecting instance of class Solution.'); - end - else - error('Unknown domain type.'); - end -end -if d.dom_id < 0 - error(geterr); -end -d.domain_type = a; -d = class(d, 'Domain1D'); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/clear.m b/interfaces/matlab/toolbox/1D/@Domain1D/clear.m deleted file mode 100644 index 62c8db6327..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/clear.m +++ /dev/null @@ -1,9 +0,0 @@ -function clear(d) -% CLEAR Delete the C++ Domain1D object. -% clear(d) -% :param d: -% Instance of class :mat:func:`Domain1D` (or another -% object that derives from Domain1D) -% - -domain_methods(d.dom_id, 10); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/componentIndex.m b/interfaces/matlab/toolbox/1D/@Domain1D/componentIndex.m deleted file mode 100644 index 33b4e03d2b..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/componentIndex.m +++ /dev/null @@ -1,17 +0,0 @@ -function n = componentIndex(d, name) -% COMPONENTINDEX Get the index of a component given its name. -% n = componentIndex(d, name) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param name: -% String name of the component to look up. If a numeric value -% is passed, it will be returned. -% :return: -% Index of the component, or input numeric value. -% - -if isa(name, 'double') - n = name; -else - n = domain_methods(d.dom_id, 18, name); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/componentName.m b/interfaces/matlab/toolbox/1D/@Domain1D/componentName.m deleted file mode 100644 index c558a48fe3..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/componentName.m +++ /dev/null @@ -1,17 +0,0 @@ -function s = componentName(d, n) -% COMPONENTNAME Get the name of a component given its index. -% s = componentName(d, n) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param n: -% Integer or vector of integers of components' names -% to get. -% :return: -% Cell array of component names. -% - -m = length(n); -s = cell(m); -for i = 1:m - s{i} = domain_methods(d.dom_id, 40, n(i)); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/disableEnergy.m b/interfaces/matlab/toolbox/1D/@Domain1D/disableEnergy.m deleted file mode 100644 index 7ba64a8b04..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/disableEnergy.m +++ /dev/null @@ -1,11 +0,0 @@ -function d = disableEnergy(d) -% DISABLEENERGY Disable the energy equation. -% d = disableEnergy(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% - -disp(' '); -disp('Disabling the energy equation...'); - -domain_methods(d.dom_id, 66, 0); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/domainIndex.m b/interfaces/matlab/toolbox/1D/@Domain1D/domainIndex.m deleted file mode 100644 index bb51443012..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/domainIndex.m +++ /dev/null @@ -1,12 +0,0 @@ -function i = domainIndex(d) -% DOMAININDEX Get the domain index. -% i = domainIndex(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% This function returns an integer flag denoting the location -% of the domain, beginning with 1 at the left. -% - -i = domain_methods(d.dom_id, 13) + 1; - diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/domainType.m b/interfaces/matlab/toolbox/1D/@Domain1D/domainType.m deleted file mode 100644 index 1c94c6a08c..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/domainType.m +++ /dev/null @@ -1,10 +0,0 @@ -function v = domainType(d) -% DOMAINTYPE Get the type of domain. -% v = domainType(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% This function returns a string describing the domain type. -% - -v = domain_methods(d.dom_id, 12); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/domain_hndl.m b/interfaces/matlab/toolbox/1D/@Domain1D/domain_hndl.m deleted file mode 100644 index 11c0c79a2d..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/domain_hndl.m +++ /dev/null @@ -1,12 +0,0 @@ -function n = domain_hndl(d) -% DOMAIN_HNDL Get the integer used to access the kernel object. -% n = domain_hndl(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% for which the handle is desired. -% :return: -% Integer used to access the kernel object -% - -n = d.dom_id; - diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/enableEnergy.m b/interfaces/matlab/toolbox/1D/@Domain1D/enableEnergy.m deleted file mode 100644 index ec533af4a1..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/enableEnergy.m +++ /dev/null @@ -1,11 +0,0 @@ -function d = enableEnergy(d) -% ENABLEENERGY Enable the energy equation. -% d = enableEnergy(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% - -disp(' '); -disp('Enabling the energy equation...'); - -domain_methods(d.dom_id, 66, 1); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/gridPoints.m b/interfaces/matlab/toolbox/1D/@Domain1D/gridPoints.m deleted file mode 100644 index 746429411b..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/gridPoints.m +++ /dev/null @@ -1,23 +0,0 @@ -function zz = gridPoints(d, n) -% GRIDPOINTS Get grid points from a domain. -% zz = gridPoints(d, n) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param n: -% Optional, vector of grid points to be retrieved. -% :return: -% Vector of grid points. Length of ``n`` or :mat:func:`nPoints`. -% - -if nargin == 1 - zz = zeros(1, nPoints(d)); - for i = 1:nPoints(d) - zz(i) = domain_methods(d.dom_id, 19, i); - end -else - m = length(n); - zz = zeros(1, m); - for i = 1:m - zz(i) = domain_methods(d.dom_id, 19, n(i)); - end -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/isFlow.m b/interfaces/matlab/toolbox/1D/@Domain1D/isFlow.m deleted file mode 100644 index 4b282b7cb0..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/isFlow.m +++ /dev/null @@ -1,12 +0,0 @@ -function a = isFlow(d) -% ISFLOW Determine whether a domain is a flow. -% a = isFlow(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% 1 if the domain is a flow domain, and 0 otherwise. -% - -v = domainType(d); -a = int8(strcmp(v, 'free-flow') || strcmp(v, 'axisymmetric-flow')); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/isInlet.m b/interfaces/matlab/toolbox/1D/@Domain1D/isInlet.m deleted file mode 100644 index 0e5eb19a9f..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/isInlet.m +++ /dev/null @@ -1,11 +0,0 @@ -function a = isInlet(d) -% ISINLET Determine whether a domain is an inlet. -% a = isInlet(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% 1 if the domain is an inlet, and 0 otherwise. -% - -a = int8(strcmp(domainType(d), 'inlet')); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/isSurface.m b/interfaces/matlab/toolbox/1D/@Domain1D/isSurface.m deleted file mode 100644 index f52d1386c4..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/isSurface.m +++ /dev/null @@ -1,11 +0,0 @@ -function a = isSurface(d) -% ISSURFACE Determine if a domain is a surface. -% a = isSurface(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% 1 if the domain is a surface, and 0 otherwise. -% - -a = int8(strcmp(domainType(d), 'surface')); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/massFlux.m b/interfaces/matlab/toolbox/1D/@Domain1D/massFlux.m deleted file mode 100644 index a8a87348e7..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/massFlux.m +++ /dev/null @@ -1,10 +0,0 @@ -function mdot = massFlux(d) -% MASSFLUX Get the mass flux. -% mdot = massFlux(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% The mass flux in the domain. -% - -mdot = domain_methods(d.dom_id, 17); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/massFraction.m b/interfaces/matlab/toolbox/1D/@Domain1D/massFraction.m deleted file mode 100644 index 4fdce45e5f..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/massFraction.m +++ /dev/null @@ -1,24 +0,0 @@ -function y = massFraction(d, k) -% MASSFRACTION Get the mass fraction of a species given its integer index. -% y = massFraction(d, k) -% This method returns the mass fraction of species ``k``, where -% k is the integer index of the species in the flow domain -% to which the boundary domain is attached. -% -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param k: -% Integer species index -% :return: -% Mass fraction of species -% - -if domainIndex(d) == 0 - error('No flow domain attached!') -end - -if isInlet(d) - y = domain_methods(d.dom_id, 16, k-1); -else - error('Input domain must be an inlet'); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/nComponents.m b/interfaces/matlab/toolbox/1D/@Domain1D/nComponents.m deleted file mode 100644 index 05de095891..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/nComponents.m +++ /dev/null @@ -1,10 +0,0 @@ -function n = nComponents(d) -% NCOMPONENTS Get the number of components. -% n = nComponents(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% Number of variables at each grid point -% - -n = domain_methods(d.dom_id, 11); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/nPoints.m b/interfaces/matlab/toolbox/1D/@Domain1D/nPoints.m deleted file mode 100644 index 66aeb58328..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/nPoints.m +++ /dev/null @@ -1,10 +0,0 @@ -function npts = nPoints(d) -% NPOINTS Get the number of grid points. -% npts = nPoints(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% Integer number of grid points. -% - -npts = domain_methods(d.dom_id, 14); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/private/domain_methods.m b/interfaces/matlab/toolbox/1D/@Domain1D/private/domain_methods.m deleted file mode 100644 index 31e33ab5a1..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/private/domain_methods.m +++ /dev/null @@ -1,15 +0,0 @@ -function v = domain_methods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(90, n, job); -elseif nargin == 3 - v = ctmethods(90, n, job, a); -elseif nargin == 4 - v = ctmethods(90, n, job, a, b); -elseif nargin == 5 - v = ctmethods(90, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(90, n, job, a, b, c, d); -elseif nargin == 7 - v = ctmethods(90, n, job, a, b, c, d, e); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/set.m b/interfaces/matlab/toolbox/1D/@Domain1D/set.m deleted file mode 100644 index 98a77786dd..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/set.m +++ /dev/null @@ -1,98 +0,0 @@ -function a = set(a,varargin) -% SET Set properties of a Domain1D. -% a = set(a,varargin) -% The properties that may be set are -% -% * Temperature (T) -% * Pressure (P) -% * Mole Fractions (X) -% * Mass Flux (mdot) -% * tol -% * tol-time -% * grid -% * bounds -% * T_fixed -% * ID -% -% Either the full property name or the symbol may be -% specified. Mole and mass -% fractions must be input as vectors (either row or column) with -% length equal to the number of species. -% -% Examples:: -% -% >> set(gas,'Temperature',600.0); -% >> set(gas,'T',600.0); -% >> set(gas,'T',600.0,'P',2*oneatm,'Y',massfracs); -% >> set(gas,'X',ones(nSpecies(gas),1)); -% -% Alternatively, individual methods to set properties may be -% called (setTemperature, setMoleFractions, etc.) -% -% See also: :mat:func:`setBounds`, :mat:func:`setFixedTempProfile` :mat:func:`setID`, -% :mat:func:`setMdot`, :mat:func:`setMoleFractions`, :mat:func:`setPressure`, -% :mat:func:`setProfile`, :mat:func:`setSteadyTolerances`, :mat:func:`setTemperature`, -% :mat:func:`setTransientTolerances`, :mat:func:`setupGrid` -% -% :param a: -% Instance of class :mat:func:`Domain1D` -% :param varargin: -% Comma separated list of ``property, value`` pairs to be set -% - -property_argin = varargin; - -while length(property_argin) >= 2, - prop = property_argin{1}; - val = property_argin{2}; - property_argin = property_argin(3:end); - switch prop - case 'Temperature' - setTemperature(a, val); - case 'T' - setTemperature(a, val); - case 'mdot' - setMdot(a, val); - case 'MassFlux' - setMdot(a, val); - case 'P' - setPressure(a, val); - case 'Pressure' - setPressure(a, val); - case 'tol' - sz = size(val); - if sz == nComponents(a) - setSteadyTolerances(a, val(1,:), val(2,:)); - elseif length(val) == 2 - setSteadyTolerances(a, 'default', val(1), val(2)); - else - error('Wrong array size for error tolerances.'); - end - case 'tol-time' - sz = size(val); - if sz == nComponents(a) - setTransientTolerances(a, val(1,:), val(2,:)); - elseif length(val) == 2 - rt = val(1); - at = val(2); - setTransientTolerances(a, 'default', rt, at); - else - error('Wrong array size for error tolerances.'); - end - case 'grid' - setupGrid(a, val); - case 'bounds' - setBounds(a, val(1,:), val(2,:)); - case 'X' - setMoleFractions(a, val); - case 'MoleFractions' - setMoleFractions(a, val); - case 'T_fixed' - setFixedTempProfile(a, val); - case 'ID' - setID(a, val); - otherwise - error(['unknown property ' char(prop)]); - end -end - diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setBounds.m b/interfaces/matlab/toolbox/1D/@Domain1D/setBounds.m deleted file mode 100644 index c789c6d9e5..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setBounds.m +++ /dev/null @@ -1,14 +0,0 @@ -function setBounds(d, component, lower, upper) -% SETBOUNDS Set bounds on the solution components. -% d = setBounds(d, component, lower, upper) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param component: -% String, component to set the bounds on -% :param lower: -% Lower bound -% :param upper: -% Upper bound -% -n = componentIndex(d, component); -domain_methods(d.dom_id, 51, n, lower, upper); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setCoverageEqs.m b/interfaces/matlab/toolbox/1D/@Domain1D/setCoverageEqs.m deleted file mode 100644 index 218070dd98..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setCoverageEqs.m +++ /dev/null @@ -1,28 +0,0 @@ -function setCoverageEqs(d, onoff) -% SETCOVERAGEEQS Enable or disable solving the coverage equations. -% d = setCoverageEqs(d,onoff) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param onoff: -% String, one of ``'on'`` or ``'yes'`` to turn solving -% the coverage equations on. One of ``'off'`` or ``'no'`` -% to turn off the coverage equations. -% - -if d.domain_type ~= 6 - error('Wrong domain type. Expected a reacting surface domain.') -end - -ion = -1; -if isa(onoff,'char') - if strcmp(onoff, 'on') || strcmp(onoff, 'yes') - ion = 1; - elseif strcmp(onoff, 'off') || strcmp(onoff, 'no') - ion = 0; - else - error(strcat('unknown option: ', onoff)) - end -elseif isa(onoff, 'numeric') - ion = onoff; -end -domain_methods(d.dom_id, 120, ion); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setFixedTempProfile.m b/interfaces/matlab/toolbox/1D/@Domain1D/setFixedTempProfile.m deleted file mode 100644 index 9772dede6b..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setFixedTempProfile.m +++ /dev/null @@ -1,24 +0,0 @@ -function setFixedTempProfile(d, profile) -% SETFIXEDTEMPPROFILE Set a fixed temperature profile. -% d = setFixedTempProfile(d, profile) -% Set the temperature profile to use when the -% energy equation is not being solved. The profile must be entered -% as an array of positions / temperatures, which may be in rows or -% columns. -% -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param profile: -% n x 2 or 2 x n array of ``n`` points at which the temperature -% is specified. -% - -sz = size(profile); -if sz(1) == 2 - domain_methods(d.dom_id, 64, profile(1,:), profile(2,:)); -elseif sz(2) == 2 - domain_methods(d.dom_id, 64, profile(:,1), profile(:,2)); -else - error('Wrong temperature profile array shape.'); -end - diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setID.m b/interfaces/matlab/toolbox/1D/@Domain1D/setID.m deleted file mode 100644 index 2278298195..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setID.m +++ /dev/null @@ -1,10 +0,0 @@ -function setID(d, id) -% SETID Set the ID tag for a domain. -% d = setID(d, id) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param id: -% String ID to assign -% - -domain_methods(d.dom_id, 54, id); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setMdot.m b/interfaces/matlab/toolbox/1D/@Domain1D/setMdot.m deleted file mode 100644 index a857da407c..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setMdot.m +++ /dev/null @@ -1,10 +0,0 @@ -function setMdot(d, mdot) -% SETMDOT Set the mass flow rate. -% d = setMdot(d, mdot) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param mdot: -% Mass flow rate -% - -domain_methods(d.dom_id, 60, mdot); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setMoleFractions.m b/interfaces/matlab/toolbox/1D/@Domain1D/setMoleFractions.m deleted file mode 100644 index a40a7d3114..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setMoleFractions.m +++ /dev/null @@ -1,11 +0,0 @@ -function setMoleFractions(d, x) -% SETMOLEFRACTIONS Set the mole fractions. -% d = setMoleFractions(d, x) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param x: -% String specifying the species and mole fractions in -% the format ``'SPEC:X,SPEC2:X2'``. -% - -domain_methods(d.dom_id, 62, x); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setPressure.m b/interfaces/matlab/toolbox/1D/@Domain1D/setPressure.m deleted file mode 100644 index b84c758a97..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setPressure.m +++ /dev/null @@ -1,10 +0,0 @@ -function setPressure(d, p) -% SETPRESSURE Set the pressure. -% d = setPressure(d, p) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param p: -% Pressure to be set. Units: Pa -% - -domain_methods(d.dom_id, 63, p); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setProfile.m b/interfaces/matlab/toolbox/1D/@Domain1D/setProfile.m deleted file mode 100644 index 1d20086751..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setProfile.m +++ /dev/null @@ -1,22 +0,0 @@ -function setProfile(d, n, p) -% SETPROFILE Set the profile of a component. -% d = setProfile(d, n, p) -% Convenience function to allow an instance of :mat:func:`Domain1D` to -% have a profile of its components set when it is part of a :mat:func:`Stack`. -% -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param n: -% Integer index of component, vector of component indices, string -% of component name, or cell array of strings of component names. -% :param p: -% n x 2 array, whose columns are the relative (normalized) positions -% and the component values at those points. The number of positions -% ``n`` is arbitrary. -% - -if d.stack == 0 - error('Install domain in stack before calling setProfile.'); -end - -setProfile(d.stack,domainIndex(d), n, p); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setSteadyTolerances.m b/interfaces/matlab/toolbox/1D/@Domain1D/setSteadyTolerances.m deleted file mode 100644 index 7d61d3ab00..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setSteadyTolerances.m +++ /dev/null @@ -1,30 +0,0 @@ -function setSteadyTolerances(d, component, rtol, atol) -% SETSTEADYTOLERANCES Set the steady-state tolerances. -% d = setSteadyTolerances(d, component, rtol, atol) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param component: -% String or cell array of strings of component values -% whose tolerances should be set. If ``'default'`` is -% specified, the tolerance of all components will be set. -% :param rtol: -% Relative tolerance -% :param atol: -% Absolute tolerance -% - -if strcmp(component, 'default') - nc = nComponents(d); - for ii = 1:nc - domain_methods(d.dom_id, 55, ii, rtol, atol); - end -elseif iscell(component) - nc = length(component); - for ii = 1:nc - n = componentIndex(d, component{ii}); - domain_methods(d.dom_id, 55, n, rtol, atol); - end -else - n = componentIndex(d, component); - domain_methods(d.dom_id, 55, n, rtol, atol); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setTemperature.m b/interfaces/matlab/toolbox/1D/@Domain1D/setTemperature.m deleted file mode 100644 index 536942c9c3..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setTemperature.m +++ /dev/null @@ -1,10 +0,0 @@ -function setTemperature(d, t) -% SETTEMPERATURE Set the temperature. -% d = setTemperature(d, t) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param t: -% Temperature to be set. Units: K -% - -domain_methods(d.dom_id, 61, t); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setTransientTolerances.m b/interfaces/matlab/toolbox/1D/@Domain1D/setTransientTolerances.m deleted file mode 100644 index 7f69779386..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setTransientTolerances.m +++ /dev/null @@ -1,30 +0,0 @@ -function setTransientTolerances(d, component, rtol, atol) -% SETTRANSIENTTOLERANCES Set the transient tolerances. -% d = setTransientTolerances(d, component, rtol, atol) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param component: -% String or cell array of strings of component values -% whose tolerances should be set. If ``'default'`` is -% specified, the tolerance of all components will be set. -% :param rtol: -% Relative tolerance -% :param atol: -% Absolute tolerance -% - -if strcmp(component, 'default') - nc = nComponents(d); - for ii = 1:nc - domain_methods(d.dom_id, 56, ii, rtol, atol); - end -elseif iscell(component) - nc = length(component); - for ii = 1:nc - n = componentIndex(d, component{ii}); - domain_methods(d.dom_id, 56, n, rtol, atol); - end -else - n = componentIndex(d, component); - domain_methods(d.dom_id, 56, n, rtol, atol); -end diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/setupGrid.m b/interfaces/matlab/toolbox/1D/@Domain1D/setupGrid.m deleted file mode 100644 index 1474cc790f..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/setupGrid.m +++ /dev/null @@ -1,9 +0,0 @@ -function setupGrid(d, grid) -% SETUPGRID Set up the solution grid. -% d = setupGrid(d, grid) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param grid: -% - -domain_methods(d.dom_id, 53, grid); diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/temperature.m b/interfaces/matlab/toolbox/1D/@Domain1D/temperature.m deleted file mode 100644 index 394443d350..0000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/temperature.m +++ /dev/null @@ -1,10 +0,0 @@ -function t = temperature(d) -% TEMPERATURE Get the boundary temperature. -% t = temperature(d) -% :param d: -% Instance of class :mat:func:`Domain1D` -% :return: -% Temperature. Units: K -% - -t = domain_methods(d.dom_id, 15); diff --git a/interfaces/matlab/toolbox/1D/@Stack/Stack.m b/interfaces/matlab/toolbox/1D/@Stack/Stack.m deleted file mode 100644 index 412d8d9dfd..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/Stack.m +++ /dev/null @@ -1,32 +0,0 @@ -function s = Stack(domains) -% STACK Stack class constructor. -% s = Stack(domains) -% A stack object is a container for one-dimensional domains, -% which are instances of class Domain1D. The domains are of two -% types - extended domains, and connector domains. -% -% See also: :mat:func:`Domain1D` -% -% :param domains: -% Vector of domain instances -% :return: -% Instance of class :mat:func:`Stack` -% - -s.stack_id = -1; -s.domains = domains; -if nargin == 1 - nd = length(domains); - ids = zeros(1, nd); - for n=1:nd - ids(n) = domain_hndl(domains(n)); - end - s.stack_id = stack_methods(0, 8, nd, ids); -else - help(Stack); - error('Wrong number of parameters.'); -end -if s.stack_id < 0 - error(geterr); -end -s = class(s, 'Stack'); diff --git a/interfaces/matlab/toolbox/1D/@Stack/clear.m b/interfaces/matlab/toolbox/1D/@Stack/clear.m deleted file mode 100644 index c27c0b42a3..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(s) -% CLEAR Delete the C++ Sim1D object. -% clear(s) -% :param s: -% Instance of class :mat:func:`Stack` -% - -stack_methods(s.stack_id, 110); diff --git a/interfaces/matlab/toolbox/1D/@Stack/display.m b/interfaces/matlab/toolbox/1D/@Stack/display.m deleted file mode 100644 index 36048017fa..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/display.m +++ /dev/null @@ -1,13 +0,0 @@ -function display(s, fname) -% DISPLAY Show all domains. -% display(s, fname) -% :param s: -% Instance of class :mat:func:`Stack` -% :param fname: -% File to write summary to. If omitted, output is to the screen. -% - -if nargin == 1 - fname = '-'; -end -stack_methods(s.stack_id, 103, fname); diff --git a/interfaces/matlab/toolbox/1D/@Stack/domainIndex.m b/interfaces/matlab/toolbox/1D/@Stack/domainIndex.m deleted file mode 100644 index e9cd0df61b..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/domainIndex.m +++ /dev/null @@ -1,17 +0,0 @@ -function n = domainIndex(s, name) -% DOMAININDEX Get the index of a domain in a stack given its name. -% n = domainIndex(s, name) -% :param s: -% Instance of class :mat:func:`Stack` -% :param name: -% If double, the value is returned. Otherwise, -% the name is looked up and its index is returned. -% :return: -% Index of domain -% - -if isa(name, 'double') - n = name; -else - n = stack_methods(s.stack_id, 109, name); -end diff --git a/interfaces/matlab/toolbox/1D/@Stack/grid.m b/interfaces/matlab/toolbox/1D/@Stack/grid.m deleted file mode 100644 index 02fa048a65..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/grid.m +++ /dev/null @@ -1,15 +0,0 @@ -function z = grid(s, name) -% GRID Get the grid in one domain. -% z = grid(s, name) -% :param s: -% Instance of class :mat:func:`Stack` -% :param name: -% Name of the domain for which the grid -% should be retrieved. -% :return: -% The grid in domain name -% - -n = domainIndex(s, name); -d = s.domains(n); -z = gridPoints(d); diff --git a/interfaces/matlab/toolbox/1D/@Stack/plotSolution.m b/interfaces/matlab/toolbox/1D/@Stack/plotSolution.m deleted file mode 100644 index fff0f048fa..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/plotSolution.m +++ /dev/null @@ -1,19 +0,0 @@ -function plotSolution(s, domain, component) -% PLOTSOLUTION Plot a specified solution component. -% plotSolution(s, domain, component) -% :param s: -% Instance of class :mat:func:`Stack` -% :param domain: -% Name of domain from which the component should be -% retrieved -% :param component: -% Name of the component to be plotted -% - -n = domainIndex(s, domain); -d = s.domains(n); -z = gridPoints(d); -x = solution(s, domain, component); -plot(z, x); -xlabel('z (m)'); -ylabel(component); diff --git a/interfaces/matlab/toolbox/1D/@Stack/private/stack_methods.m b/interfaces/matlab/toolbox/1D/@Stack/private/stack_methods.m deleted file mode 100644 index 624b6d63df..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/private/stack_methods.m +++ /dev/null @@ -1,24 +0,0 @@ -function v = stack_methods(n, job, a, b, c, d, e, f) -% STACK_METHODS - converter function for methods of class Stack -% -% All Cantera functions and methods are handled by the single MEX -% file 'ctmethods.' This function is provided only for convenience, -% and simply calls ctmethods with a flag associated with this class -% as the first parameter, followed by the input arguments. -if nargin == 2 - v = ctmethods(90, n, job); -elseif nargin == 3 - v = ctmethods(90, n, job, a); -elseif nargin == 4 - v = ctmethods(90, n, job, a, b); -elseif nargin == 5 - v = ctmethods(90, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(90, n, job, a, b, c, d); -elseif nargin == 7 - v = ctmethods(90, n, job, a, b, c, d, e); -elseif nargin == 8 - v = ctmethods(90, n, job, a, b, c, d, e, f); -else - error('too many arguments'); -end diff --git a/interfaces/matlab/toolbox/1D/@Stack/resid.m b/interfaces/matlab/toolbox/1D/@Stack/resid.m deleted file mode 100644 index 01ae0c3700..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/resid.m +++ /dev/null @@ -1,27 +0,0 @@ -function r = resid(s, domain, rdt, count) -% RESID Get the residuals. -% r = resid(s, domain, rdt, count) -% :param s: -% Instance of class :mat:func:`Stack` -% :param domain: -% Name of the domain -% :param rdt: -% :param count: -% :returns: -% - -if nargin == 2 - rdt = 0.0; - count = 0; -end - -idom = domainIndex(s, domain); -d = s.domains(idom); - -r = zeros(nComponents(d), nPoints(d)); -stack_methods(s.stack_id, 113, rdt, count); -for m = 1:nComponents(d) - for n = 1:nPoints(d) - r(m,n) = stack_methods(s.stack_id, 31, idom, m, n); - end -end diff --git a/interfaces/matlab/toolbox/1D/@Stack/restore.m b/interfaces/matlab/toolbox/1D/@Stack/restore.m deleted file mode 100644 index 3594e7b5a9..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/restore.m +++ /dev/null @@ -1,16 +0,0 @@ -function restore(s, fname, id) -% RESTORE Restore a previously-saved solution. -% restore(s, fname, id) -% This method can be used to provide an initial guess for the solution. -% -% See also: :mat:func:`save` -% -% :param s: -% Instance of class :mat:func:`Stack` -% :param fname: -% File name of a YAML file containing solution information -% :param id: -% ID of the element that should be restored -% - -stack_methods(s.stack_id, 111, fname, id); diff --git a/interfaces/matlab/toolbox/1D/@Stack/save.m b/interfaces/matlab/toolbox/1D/@Stack/save.m deleted file mode 100644 index cb8d24bb7a..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/save.m +++ /dev/null @@ -1,24 +0,0 @@ -function save(s, fname, id, desc) -% SAVE Save a solution to a file. -% save(s, fname, id, desc) -% The output file is in a format that -% can be used by :mat:func:`restore` -% -% :param s: -% Instance of class :mat:func:`Stack` -% :param fname: -% File name where YAML file should be written -% :param id: -% ID to be assigned to the YAML element when it is -% written -% :param desc: -% Description to be written to the output file -% - -if nargin == 2 - id = 'solution'; - desc = '-'; -elseif nargin == 3 - desc = '-'; -end -stack_methods(s.stack_id, 107, fname, id, desc); diff --git a/interfaces/matlab/toolbox/1D/@Stack/saveSoln.m b/interfaces/matlab/toolbox/1D/@Stack/saveSoln.m deleted file mode 100644 index fc868b4598..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/saveSoln.m +++ /dev/null @@ -1,28 +0,0 @@ -function saveSoln(s, fname, id, desc) -% SAVESOLN Save a solution to a file. -% saveSoln(s, fname, id, desc) -% The output file is in a format that -% can be used by :mat:func:`restore` -% -% :param s: -% Instance of class :mat:func:`Stack` -% :param fname: -% File name where YAML file should be written -% :param id: -% ID to be assigned to the YAML element when it is -% written -% :param desc: -% Description to be written to the output file -% - -if nargin == 1 - fname = 'soln.yaml'; - id = 'solution'; - desc = '--'; -elseif nargin == 2 - id = 'solution'; - desc = '--'; -elseif nargin == 3 - desc = '--'; -end -stack_methods(s.stack_id, 107, fname, id, desc); diff --git a/interfaces/matlab/toolbox/1D/@Stack/setFlatProfile.m b/interfaces/matlab/toolbox/1D/@Stack/setFlatProfile.m deleted file mode 100644 index 52e46dcb29..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/setFlatProfile.m +++ /dev/null @@ -1,14 +0,0 @@ -function setFlatProfile(s, domain, comp, v) -% SETFLATPROFILE Set a component to a value across the entire domain. -% setFlatProfile(s, domain, comp, v) -% :param s: -% Instance of class :mat:func:`Stack` -% :param domain: -% Integer ID of the domain -% :param comp: -% Component to be set -% :param v: -% Double, value to be set -% - -stack_methods(s.stack_id, 102, domain, comp, v); diff --git a/interfaces/matlab/toolbox/1D/@Stack/setMaxJacAge.m b/interfaces/matlab/toolbox/1D/@Stack/setMaxJacAge.m deleted file mode 100644 index 5904340260..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/setMaxJacAge.m +++ /dev/null @@ -1,16 +0,0 @@ -function setMaxJacAge(s, ss_age, ts_age) -% SETMAXJACAGE Set the number of times the Jacobian will be used before it is recomputed. -% setMaxJacAge(s, ss_age, ts_age) -% :param s: -% Instance of class :mat:func:`Stack` -% :param ss_age: -% Maximum age of the Jacobian for steady state analysis -% :param ts_age: -% Maximum age of the Jacobian for transient analysis. If -% not specified, defaults to ``ss_age``. -% - -if nargin == 2 - ts_age = ss_age; -end -stack_methods(s.stack_id, 114, ss_age, ts_age); diff --git a/interfaces/matlab/toolbox/1D/@Stack/setProfile.m b/interfaces/matlab/toolbox/1D/@Stack/setProfile.m deleted file mode 100644 index 533fe4b7b5..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/setProfile.m +++ /dev/null @@ -1,57 +0,0 @@ -function setProfile(s, name, comp, p) -% SETPROFILE Specify a profile for one component. -% setProfile(s, name, comp, p) -% The solution vector values for this component will be linearly -% interpolated from the discrete function defined by p(:,1) vs. p(:,2). -% Note that ``p(1,1) = 0.0`` corresponds to the leftmost grid point in -% the specified domain, and ``p(1,n) = 1.0`` corresponds to the rightmost -% grid point. This method can be called at any time, but is -% usually used to set the initial guess for the solution. -% -% Example (assuming ``s`` is an instance of :mat:func:`Stack`):: -% -% >> zr = [0 0.1 0.2 0.4 0.8 1]; -% >> v = [500 650 700 730 800 900]; -% >> setProfile(s, 1, 2, [zr, v]); -% -% :param s: -% Instance of class :mat:func:`Stack` -% :param name: -% Domain name -% :param comp: -% component number -% :param p: -% n x 2 array, whose columns are the relative (normalized) positions -% and the component values at those points. The number of positions -% ``n`` is arbitrary. -% - -if isa(name, 'double') - n = name; -else - n = domainIndex(s, name); -end - -d = s.domains(n); - -if isa(comp, 'double') || isa(comp, 'cell') - c = comp; -elseif isa(comp, 'char') - c = {comp}; -else - error('Wrong type.'); -end - -np = length(c); -sz = size(p); -if sz(1) == np + 1; - for j = 1:np - ic = componentIndex(d, c{j}); - stack_methods(s.stack_id, 101, n, ic, p(1,:), p(j+1,:)); - end -elseif sz(2) == np + 1; - ic = componentIndex(d,c{j}); - stack_methods(s.stack_id, 101, n, ic, p(:,1), p(:,j+1)); -else - error('Wrong profile shape.'); -end diff --git a/interfaces/matlab/toolbox/1D/@Stack/setRefineCriteria.m b/interfaces/matlab/toolbox/1D/@Stack/setRefineCriteria.m deleted file mode 100644 index c24391173f..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/setRefineCriteria.m +++ /dev/null @@ -1,37 +0,0 @@ -function setRefineCriteria(s, n, ratio, slope, curve, prune) -% SETREFINECRITERIA Set the criteria used to refine the grid. -% s = setRefineCriteria(s, n, ratio, slope, curve, prune) -% :param s: -% Instance of class :mat:func:`Stack` -% :param n: -% Domain number -% :param ratio: -% Maximum size ratio between adjacent cells -% :param slope: -% Maximum relative difference in value between -% adjacent points -% :param curve: -% Maximum relative difference in slope between -% adjacent cells -% :param prune: -% Minimum value for slope or curve for which points -% will be retained in the grid. If the computed -% slope or curve value is below prune for all -% components, it will be deleted, unless either -% neighboring point is already marked for deletion. -% - -if nargin < 3 - ratio = 10.0; -end -if nargin < 4 - slope = 0.8; -end -if nargin < 5 - curve = 0.8; -end -if nargin < 6 - prune = -0.1; -end - -stack_methods(s.stack_id, 106, n, ratio, slope, curve, prune); diff --git a/interfaces/matlab/toolbox/1D/@Stack/setTimeStep.m b/interfaces/matlab/toolbox/1D/@Stack/setTimeStep.m deleted file mode 100644 index e5679d8e38..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/setTimeStep.m +++ /dev/null @@ -1,15 +0,0 @@ -function setTimeStep(s, stepsize, steps) -% SETTIMESTEP Specify a sequence of time steps. -% setTimeStep(s, stepsize, steps) -% :param stepsize: -% Initial step size (s) -% :param steps: -% Vector of number of steps to take before -% re-attempting solution of steady-state problem. For -% example, steps = [1, 2, 5, 10] would cause one time -% step to be taken first the the steady-state -% solution attempted. If this failed, two time steps -% would be taken, etc. -% - -stack_methods(s.stack_id, 112, stepsize, length(steps), steps) diff --git a/interfaces/matlab/toolbox/1D/@Stack/setValue.m b/interfaces/matlab/toolbox/1D/@Stack/setValue.m deleted file mode 100644 index 0bf4967332..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/setValue.m +++ /dev/null @@ -1,26 +0,0 @@ -function setValue(s, n, comp, localPoint, v) -% SETVALUE Set the value of a single entry in the solution vector. -% setValue(s, n, comp, localPoint, v) -% Example (assuming ``s`` is an instance of :mat:func:`Stack`):: -% -% setValue(s, 3, 5, 1, 5.6) -% -% This sets component 5 at the leftmost point (local point 1) in domain 3 -% to the value 5.6. Note that the local index always begins at 1 -% at the left of each domain, independent of the global index of -% the point, which depends on the location of this domain in the -% stack. -% -% :param s: -% Instance of class :mat:func:`Stack` -% :param n: -% Domain number -% :param comp: -% Component number -% :param localPoint: -% Local index of the grid point in the domain -% :param v: -% Value -% - -stack_methods(s.stack_id, 100, n, comp, localPoint, v); diff --git a/interfaces/matlab/toolbox/1D/@Stack/solution.m b/interfaces/matlab/toolbox/1D/@Stack/solution.m deleted file mode 100644 index 5a022d6917..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/solution.m +++ /dev/null @@ -1,34 +0,0 @@ -function x = solution(s, domain, component) -% SOLUTION Get a solution component in one domain. -% x = solution(s, domain, component) -% :param s: -% Instance of class :mat:func:`Stack` -% :param domain: -% String, name of the domain from which the solution is desired -% :param component: -% String, component for which the solution is desired. If omitted, -% solutions for all of the components will be returned in an -% :mat:func:`nPoints` x :mat:func:`nComponents` array. -% :return: -% Either an :mat:func:`nPoints` x 1 vector, or -% :mat:func:`nPoints` x :mat:func:`nComponents` array. -% - -idom = domainIndex(s, domain); -d = s.domains(idom); -np = nPoints(d); -if nargin == 3 - icomp = componentIndex(d, component); - x = zeros(1, np); - for n = 1:np - x(n) = stack_methods(s.stack_id, 30, idom, icomp, n); - end -else - nc = nComponents(d); - x = zeros(nc, np); - for m = 1:nc - for n = 1:np - x(m,n) = stack_methods(s.stack_id, 30, idom, m, n); - end - end -end diff --git a/interfaces/matlab/toolbox/1D/@Stack/solve.m b/interfaces/matlab/toolbox/1D/@Stack/solve.m deleted file mode 100644 index db924b270a..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/solve.m +++ /dev/null @@ -1,14 +0,0 @@ -function solve(s, loglevel, refine_grid) -% SOLVE Solve the problem. -% solve(s, loglevel, refine_grid) -% :param s: -% Instance of class :mat:func:`Stack` -% :param loglevel: -% Integer flag controlling the amount of diagnostic -% output. Zero supresses all output, and 5 produces -% very verbose output. -% :param refine_grid: -% Integer, 1 to allow grid refinement, 0 to disallow. -% - -stack_methods(s.stack_id, 104, loglevel, refine_grid); diff --git a/interfaces/matlab/toolbox/1D/@Stack/subsref.m b/interfaces/matlab/toolbox/1D/@Stack/subsref.m deleted file mode 100644 index ad604125f1..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/subsref.m +++ /dev/null @@ -1,18 +0,0 @@ -function b = subsref(s, index) -% SUBSREF Redefine subscripted references. -% b = subsref(s,index) -% :param s: -% Instance of class :mat:func:`Stack` -% :param index: -% :return: -% - -switch index.type - case '()' - b = s.domains(index.subs{:}); - case '.' - n = domainIndex(s, index.subs); - b = s.domains(n); - otherwise - error('syntax error'); -end diff --git a/interfaces/matlab/toolbox/1D/@Stack/writeStats.m b/interfaces/matlab/toolbox/1D/@Stack/writeStats.m deleted file mode 100644 index c96359ed52..0000000000 --- a/interfaces/matlab/toolbox/1D/@Stack/writeStats.m +++ /dev/null @@ -1,12 +0,0 @@ -function writeStats(s) -% WRITESTATS Print statistics for the current solution. -% writeStats(s) -% Prints a summary of the number of function and -% Jacobian evaluations for each grid, and the CPU time spent on -% each one. -% -% :param s: -% Instance of class :mat:func:`Stack` -% - -stack_methods(s.stack_id, 108); diff --git a/interfaces/matlab/toolbox/1D/AxiStagnFlow.m b/interfaces/matlab/toolbox/1D/AxiStagnFlow.m deleted file mode 100644 index 2e663c8bc8..0000000000 --- a/interfaces/matlab/toolbox/1D/AxiStagnFlow.m +++ /dev/null @@ -1,10 +0,0 @@ -function m = AxiStagnFlow(gas) -% AXISTAGNFLOW Get an axisymmetric stagnation flow domain. -% m = AxiStagnFlow(gas) -% :param gas: -% Instance of class :mat:func:`Solution` -% :return: -% Domain1D instance representing an axisymmetric -% stagnation flow. - -m = Domain1D(1, gas); diff --git a/interfaces/matlab/toolbox/1D/AxisymmetricFlow.m b/interfaces/matlab/toolbox/1D/AxisymmetricFlow.m deleted file mode 100644 index bf59b5ab83..0000000000 --- a/interfaces/matlab/toolbox/1D/AxisymmetricFlow.m +++ /dev/null @@ -1,17 +0,0 @@ -function m = AxisymmetricFlow(gas, id) -% AXISYMMETRICFLOW Create an axisymmetric flow domain. -% m = AxisymmetricFlow(gas, id) -% :param gas: -% Instance of class :mat:func:`Solution` -% :param id: -% String, ID of the flow -% :return: -% Domain1D instance representing an axisymmetric flow. -% - -m = Domain1D(1, gas); -if nargin == 1 - setID(m, 'flow'); -else - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/1D/CounterFlowDiffusionFlame.m b/interfaces/matlab/toolbox/1D/CounterFlowDiffusionFlame.m deleted file mode 100644 index ea9c0e2b12..0000000000 --- a/interfaces/matlab/toolbox/1D/CounterFlowDiffusionFlame.m +++ /dev/null @@ -1,219 +0,0 @@ -function flame = CounterFlowDiffusionFlame(left, flow, right, tp_f, tp_o, oxidizer) -% COUNTERFLOWDIFFUSIONFLAME Create a counter flow diffusion flame stack. -% flame = CounterFlowDiffusionFlame(left, flow, right, tp_f, tp_o, oxidizer) -% :param left: -% Object representing the left inlet, which must be -% created using function :mat:func:`Inlet`. -% :param flow: -% Object representing the flow, created with -% function :mat:func:`AxisymmetricFlow`. -% :param right: -% Object representing the right inlet, which must be -% created using function :mat:func:`Inlet`. -% :param tp_f: -% Object representing the fuel inlet gas, instance of class -% :mat:func:`Solution`, and an ideal gas. -% :param tp_o: -% Object representing the oxidizer inlet gas, instance of class -% :mat:func:`Solution`, and an ideal gas. -% :param oxidizer: -% String representing the oxidizer species. Most commonly O2. -% :return: -% Instance of :mat:func:`Stack` object representing the left -% inlet, flow, and right inlet. -% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Check input parameters -% - -if nargin ~= 6 - error('CounterFlowDiffusionFlame expects six input arguments.'); -end -if ~isIdealGas(tp_f) - error('Fuel gas object must represent an ideal gas mixture.'); -end -if ~isIdealGas(tp_o) - error('Oxidizer gas object must represent an ideal gas mixture.'); -end -if ~isInlet(left) - error('Left inlet object of wrong type.'); -end -if ~isFlow(flow) - error('Flow object of wrong type.'); -end -if ~isInlet(right) - error('Right inlet object of wrong type.'); -end -if ~ischar(oxidizer) - error('Oxidizer name must be of format character.'); -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Get the density of both fuel and oxidizer streams. To be used in -% determining velocity of each stream. Also get the temperature of both -% inlet streams. -% - -rhof = density(tp_f); -rho0 = density(tp_o); -tf = temperature(left); -tox = temperature(right); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Find the species index of the oxidizer. To be used in determining initial -% strain rate. -% - -ioxidizer = speciesIndex(tp_o, oxidizer); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Calculate the stoichiometric mixture fraction. Needed for determining -% location of flame edges and composition. elMoles function used to -% calculate the number of moles of C, H, and O atoms in the fuel and -% oxidizer streams: elMoles = elementalMassFraction/element atomic weight. -% From this, the stoichiometric Air/Fuel ratio can be determined. -% 1 Mole of O needs 2 Moles of C and 0.5 Moles of H for stoichiometric -% conditions. The stoichiometric mixture fraction, Zst, is then calculated. -% - -sFuel = elMoles(tp_f,'O')- 2*elMoles(tp_f,'C')- 0.5*elMoles(tp_f,'H'); -sOx = elMoles(tp_o,'O')- 2*elMoles(tp_o,'C')- 0.5*elMoles(tp_o,'H'); -phi = sFuel/sOx; -zst = 1.0/(1.0 - phi); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Compute the stoichiometric mass fractions of each species. Use this to -% set the fuel gas object and calculate adiabatic flame temperature and -% equilibrium composition. -% - -spec = speciesNames(tp_f); % Get all of the species names in gas object. -nsp = nSpecies(tp_f); % Get total number of species in gas object. -% Get the current mass fractions of both fuel and inlet streams. -yox = massFractions(tp_o); -yf = massFractions(tp_f); -ystoich_double = zeros(1, nsp); % Create empty vector for stoich mass frac. - -for n = 1:nsp - % Calculate stoichiometric mass fractions. - ystoich_double(n) = zst*yf(n) + (1.0 - zst)*yox(n); - % Convert mass fraction vector to string vector. - ystoich_str{n} = num2str(ystoich_double(n)); - % Convert string vector to cell with SPECIES:MASS FRACTION format. - y_stoich{n} = [spec{n}, ':', ystoich_str{n}]; -end -% Initialize stoichiometric mass fraction cell with first SP:Y value. -ystoich = [y_stoich{1}]; -for i = 2:nsp - % Update cell to have format similar to N2:Yst,O2:Yst,... - ystoich = [ystoich ',', y_stoich{i}]; -end -% Set the fuel gas object as stoichiometric values and use equilibrate -% function to determine stoichiometric equilibrium temperature and mass -% fractions. -set(tp_f, 'T', tf, 'P', pressure(tp_f), 'Y', ystoich); -equilibrate(tp_f, 'HP'); -teq = temperature(tp_f); -yeq = massFractions(tp_f); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Estimate the strain rate based on the inlet stream velocities and -% determine initial "guess" for mixture fraction based on mass flux ratio. -% - -zz = gridPoints(flow); -dz = zz(end) - zz(1); -uleft = massFlux(left)/rhof; -uright = massFlux(right)/rho0; -a = (abs(uleft) + abs(uright))/dz; -diff = mixDiffCoeffs(tp_f); -f = sqrt(a/(2.0*diff(ioxidizer))); -x0num = sqrt(uleft*massFlux(left))*dz; -x0den = sqrt(uleft*massFlux(left)) + sqrt(uright*massFlux(right)); -x0 = x0num/x0den; -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Calculate initial values of temperature and mass fraction of species in -% flame at each gridpoint. These values to be used for energy equation -% solution. Method is based on the Burke-Schumann model. -% - -nz = nPoints(flow); -zm = zeros(1, nz); -u = zeros(1, nz); -v = zeros(1, nz); -y = zeros(nz, nsp); -t = zeros(1, nz); -for j = 1:nz - x = zz(j); - zeta = f*(x - x0); - zmix = 0.5*(1.0 - erf(zeta)); % Mixture fraction in flame. - zm(j) = zmix; - u(j) = a*(x0 - zz(j)); % Axial velocity. - v(j) = a; % Radial velocity. - if zmix > zst - for n = 1:nsp - y(j,n) = yeq(n) + (zmix - zst)*(yf(n) - yeq(n))/(1.0 - zst); - end - t(j) = teq + (tf - teq)*(zmix - zst)/(1.0 - zst); - else - for n = 1:nsp - y(j,n) = yox(n) + zmix*(yeq(n) - yox(n))/zst; - end - t(j) = tox + zmix*(teq - tox)/zst; - end -end -zrel = zz/dz; -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Create the flame stack with the fuel inlet, flow object, and oxidizer -% inlet. Set the profile of the flame with the estimated axial velocities, -% radial velocities, temperature, and mass fractions calculated above. -% - -flame = Stack([left flow right]); -setProfile(flame, 2, {'velocity', 'spread_rate'}, [zrel; u; v]); -setProfile(flame, 2, 'T', [zrel; t] ); -for n = 1:nsp - nm = speciesName(tp_f, n); - setProfile(flame, 2, nm, [zrel; transpose(y(:,n))]) -end -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Define elMoles function -% - -function moles = elMoles(tp, element) -% ELMOLES Determine the elemental moles in a gas object per unit mass. -% moles = Moles(tp, element) -% :param tp: -% Object representing the gas, instance of class :mat:func:`Solution`, -% and an ideal gas. The state of this object should be set to an -% estimate of the gas state before calling Moles. -% :param element: -% String representing the element name. -% :return: -% Elemental moles within a gas object per unit mass of mixture. -% Units: kmol/kg -% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Check input parameters -% - -if nargin ~= 2 - error('elMoles expects two input arguments.'); -end -if ~isIdealGas(tp) - error('Gas object must represent an ideal gas mixture.'); -end -if ~ischar(element) - error('Element name must be of format character.'); -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Calculate the moles per mass of mixture of an element within a gas -% object. The equation used is: elmoles = elMassFrac/Mel where elMassFrac -% is the elemental mass fraction within the gas object using the -% elementalMassFraction function; Mel is the atomic mass of the element. -% - -elMassFrac = elementalMassFraction(tp, element); -eli = elementIndex(tp, element); -M = atomicMasses(tp); -Mel = M(eli); -moles = elMassFrac/Mel; -end diff --git a/interfaces/matlab/toolbox/1D/FreeFlame.m b/interfaces/matlab/toolbox/1D/FreeFlame.m deleted file mode 100644 index 00893b6c5d..0000000000 --- a/interfaces/matlab/toolbox/1D/FreeFlame.m +++ /dev/null @@ -1,18 +0,0 @@ -function m = FreeFlame(gas, id) -% FREEFLAME Create a freely-propagating flat flame. -% m = FreeFlame(gas, id) -% :param gas: -% Instance of class :mat:func:`Solution` -% :param id: -% String, ID of the flow -% :return: -% Domain1D instance representing a freely propagating, -% adiabatic flame -% - -m = Domain1D(1, gas, 2); -if nargin == 1 - setID(m, 'flame'); -else - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/1D/Inlet.m b/interfaces/matlab/toolbox/1D/Inlet.m deleted file mode 100644 index 22fb15b3b9..0000000000 --- a/interfaces/matlab/toolbox/1D/Inlet.m +++ /dev/null @@ -1,18 +0,0 @@ -function m = Inlet(id) -% INLET Create an inlet domain. -% m = Inlet(id) -% Note that an inlet can only be a terminal domain - it must be -% either the leftmost or rightmost domain in a stack. -% -% :param id: -% String name of the inlet. -% :return: -% Instance of class :mat:func:`Domain1D` representing an inlet. -% - -m = Domain1D(2); -if nargin == 0 - setID(m, 'inlet'); -else - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/1D/Outlet.m b/interfaces/matlab/toolbox/1D/Outlet.m deleted file mode 100644 index 4e757b003d..0000000000 --- a/interfaces/matlab/toolbox/1D/Outlet.m +++ /dev/null @@ -1,15 +0,0 @@ -function m = Outlet(id) -% OUTLET Create an outlet domain. -% m = Outlet(id) -% :param id: -% String ID of the outlet. -% :return: -% Instance of :mat:func:`Domain1D` representing an outlet. -% - -m = Domain1D(5); -if nargin == 0 - setID(m, 'outlet'); -else - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/1D/OutletRes.m b/interfaces/matlab/toolbox/1D/OutletRes.m deleted file mode 100644 index 39b515b54d..0000000000 --- a/interfaces/matlab/toolbox/1D/OutletRes.m +++ /dev/null @@ -1,14 +0,0 @@ -function m = OutletRes(id) -% OUTLETRES Create an outlet reservoir domain. -% m = OutletRes(id) -% :return: -% Instance of :mat:func:`Domain1D` representing an outlet -% reservoir. -% - -m = Domain1D(-2); -if nargin == 0 - setID(m, 'outletres'); -else - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/1D/Surface.m b/interfaces/matlab/toolbox/1D/Surface.m deleted file mode 100644 index 37fd1229a3..0000000000 --- a/interfaces/matlab/toolbox/1D/Surface.m +++ /dev/null @@ -1,24 +0,0 @@ -function m = Surface(id, surface_mech) -% SURFACE Create a surface domain. -% m = Surface(id, surface_mech) -% :param id: -% String ID of surface -% :param surface_mech: -% Instance of class :mat:func:`Interface` defining -% the surface reaction mechanism to be used. Optional. -% :return: -% Instance of class :mat:func:`Domain1D` representing a -% non-reacting or reacting surface. -% - -if nargin < 2 - m = Domain1D(3); - if nargin == 0 - setID(m, 'surface'); - elseif nargin == 1 - setID(m, id); - end -else - m = Domain1D(6, surface_mech); - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/1D/SymmPlane.m b/interfaces/matlab/toolbox/1D/SymmPlane.m deleted file mode 100644 index 99e0bce2b6..0000000000 --- a/interfaces/matlab/toolbox/1D/SymmPlane.m +++ /dev/null @@ -1,16 +0,0 @@ -function m = SymmPlane(id) -% SYMMPLANE Create a symmetry plane domain. -% m = SymmPlane(id) -% :param id: -% String ID of the symmetry plane. -% :return: -% Instance of class :mat:func:`Domain1D` representing a symmetry -% plane. -% - -m = Domain1D(4); -if nargin == 0 - setID(m, 'symmetry_plane'); -else - setID(m, id); -end diff --git a/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m b/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m deleted file mode 100644 index f31eeb4cca..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m +++ /dev/null @@ -1,35 +0,0 @@ -function x = FlowDevice(typ) -% FLOWDEVICE FlowDevice class constructor. -% x = FlowDevice(typ) -% Base class for devices that allow flow between reactors. -% :mat:func:`FlowDevice` objects are assumed to be adiabatic, -% non-reactive, and have negligible internal volume, so that they are -% internally always in steady-state even if the upstream and downstream -% reactors are not. The fluid enthalpy, chemical composition, and mass -% flow rate are constant across a :mat:func:`FlowDevice`, and the -% pressure difference equals the difference in pressure between the -% upstream and downstream reactors. -% -% See also: :mat:func:`MassFlowController`, :mat:func:`Valve` -% -% :param typ: -% Type of :mat:func:`FlowDevice` to be created. ``typ='MassFlowController'`` -% for :mat:func:`MassFlowController`, ``typ='PressureController'`` for -% :mat:func:`PressureController` and ``typ='Valve'`` for -% :mat:func:`Valve` -% :return: -% Instance of class :mat:func:`FlowDevice` -% - -if nargin == 0 - typ = 'MassFlowController'; -end - -x.type = char(typ); -x.index = flowdevicemethods(0, x.type); -if x.index < 0 - error(geterr); -end -x.upstream = -1; -x.downstream = -1; -x = class(x, 'FlowDevice'); diff --git a/interfaces/matlab/toolbox/@FlowDevice/clear.m b/interfaces/matlab/toolbox/@FlowDevice/clear.m deleted file mode 100644 index ee7f73ed89..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(f) -% CLEAR Clear the specified flow device from memory. -% clear(f) -% :param f: -% Instance of :mat:func:`FlowDevice` to be cleared. -% - -flowdevicemethods(1, f.index); diff --git a/interfaces/matlab/toolbox/@FlowDevice/install.m b/interfaces/matlab/toolbox/@FlowDevice/install.m deleted file mode 100644 index ae3244bfde..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/install.m +++ /dev/null @@ -1,27 +0,0 @@ -function install(f, upstream, downstream) -% INSTALL Install a flow device between reactors or reservoirs. -% install(f, upstream, downstream) -% :param f: -% Instance of class :mat:func:`FlowDevice` to install -% :param upstream: -% Upstream :mat:func:`Reactor` or :mat:func:`Reservoir` -% :param downstream: -% Downstream :mat:func:`Reactor` or :mat:func:`Reservoir` -% :return: -% Instance of class :mat:func:`FlowDevice` -% - -if nargin == 3 - if ~isa(upstream, 'Reactor') || ~isa(downstream, 'Reactor') - error(['Flow devices can only be installed between reactors or' ... - ' reservoirs']) - end - i = reactor_hndl(upstream); - j = reactor_hndl(downstream); - ok = flowdevicemethods(2, f.index, i, j); - if ok < 0 - error(geterr) - end -else - error('install requires 3 arguments') -end diff --git a/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m b/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m deleted file mode 100644 index 8bd408c13e..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m +++ /dev/null @@ -1,10 +0,0 @@ -function mdot = massFlowRate(f) -% MASSFLOWRATE Get the mass flow rate. -% mdot = massFlowRate(f) -% :param f: -% Instance of class :mat:func:`MassFlowController` -% :return: -% The mass flow rate through the :mat:func:`FlowDevice` at the current time -% - -mdot = flowdevicemethods(21, f.index); diff --git a/interfaces/matlab/toolbox/@FlowDevice/private/flowdevicemethods.m b/interfaces/matlab/toolbox/@FlowDevice/private/flowdevicemethods.m deleted file mode 100644 index ab0e7101b4..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/private/flowdevicemethods.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = flowdevicemethods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(80, n, job); -elseif nargin == 3 - v = ctmethods(80, n, job, a); -elseif nargin == 4 - v = ctmethods(80, n, job, a, b); -elseif nargin == 5 - v = ctmethods(80, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(80, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@FlowDevice/setFunction.m b/interfaces/matlab/toolbox/@FlowDevice/setFunction.m deleted file mode 100644 index 36e4b55f41..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/setFunction.m +++ /dev/null @@ -1,20 +0,0 @@ -function setFunction(f, mf) -% SETFUNCTION Set the mass flow rate with class :mat:func:`Func`. -% setFunction(f, mf) -% -% See also: :mat:func:`MassFlowController`, :mat:func:`Func` -% -% :param f: -% Instance of class :mat:func:`MassFlowController` -% :param mf: -% Instance of class :mat:func:`Func` -% - -if strcmp(f.type, 'MassFlowController') - k = flowdevicemethods(9, f.index, func_hndl(mf)); - if k < 0 - error(geterr); - end -else - error('Mass flow rate can only be set for mass flow controllers') -end diff --git a/interfaces/matlab/toolbox/@FlowDevice/setMassFlowRate.m b/interfaces/matlab/toolbox/@FlowDevice/setMassFlowRate.m deleted file mode 100644 index 7dad0f6141..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/setMassFlowRate.m +++ /dev/null @@ -1,19 +0,0 @@ -function setMassFlowRate(f, mdot) -% SETMASSFLOWRATE Set the mass flow rate to a constant value. -% setMassFlowRate(f, mdot) -% -% See also: :mat:func:`MassFlowController` -% -% :param f: -% Instance of class :mat:func:`MassFlowController` -% :param mdot: -% Mass flow rate -% -if strcmp(f.type, 'MassFlowController') - k = flowdevicemethods(10, f.index, mdot); - if k < 0 - error(geterr); - end -else - error('Mass flow rate can only be set for mass flow controllers') -end diff --git a/interfaces/matlab/toolbox/@FlowDevice/setValveCoeff.m b/interfaces/matlab/toolbox/@FlowDevice/setValveCoeff.m deleted file mode 100644 index 0dc015c62e..0000000000 --- a/interfaces/matlab/toolbox/@FlowDevice/setValveCoeff.m +++ /dev/null @@ -1,25 +0,0 @@ -function setValveCoeff(f, k) -% SETVALVECOEFF Set the valve coefficient :math:`K`. -% setValveCoeff(f, k) -% The mass flow rate [kg/s] is computed from the expression -% -% .. math:: \dot{m} = K(P_{upstream} - P_{downstream}) -% -% as long as this produces a positive value. If this expression is -% negative, zero is returned. -% -% See also: :mat:func:`Valve` -% -% :param f: -% Instance of class :mat:func:`Valve` -% :param k: -% Value of the valve coefficient. Units: kg/Pa-s -% - -if ~strcmp(f.type, 'Valve') - error('Valve coefficient can only be set for valves') -end -ok = flowdevicemethods(4, f.index, k); -if ok < 0 - error(geterr); -end diff --git a/interfaces/matlab/toolbox/@Func/Func.m b/interfaces/matlab/toolbox/@Func/Func.m deleted file mode 100644 index 7365340a33..0000000000 --- a/interfaces/matlab/toolbox/@Func/Func.m +++ /dev/null @@ -1,99 +0,0 @@ -function x = Func(typ, n, p) -% FUNC Func class constructor. -% x = Func(typ, n, p) -% A class for functors. -% A functor is an object that behaves like a function. Cantera -% defines a set of functors to use to create arbitrary functions to -% specify things like heat fluxes, piston speeds, etc., in reactor -% network simulations. Of course, they can be used for other things -% too. -% -% The main feature of a functor class is that it overloads the ``()`` -% operator to evaluate the function. For example, suppose object -% ``f`` is a functor that evaluates the polynomial :math:`2x^2 - 3x + 1`. -% Then writing ``f(2)`` would cause the method that evaluates the -% function to be invoked, and would pass it the argument ``2``. The -% return value would of course be 3. -% -% The types of functors you can create in Cantera are these: -% -% 1. A polynomial -% 2. A Fourier series -% 3. A sum of Arrhenius terms -% 4. A Gaussian. -% -% You can also create composite functors by adding, multiplying, or -% dividing these basic functors, or other composite functors. -% -% Note: this MATLAB class shadows the underlying C++ Cantera class -% "Func1". See the Cantera C++ documentation for more details. -% -% See also: :mat:func:`polynom`, :mat:func:`gaussian`, :mat:func:`plus`, -% :mat:func:`rdivide`, :mat:func:`times` -% -% :param typ: -% String indicating type of functor to create. Possible values are: -% -% * ``'polynomial'`` -% * ``'fourier'`` -% * ``'gaussian'`` -% * ``'arrhenius'`` -% * ``'sum'`` -% * ``'diff'`` -% * ``'ratio'`` -% * ``'composite'`` -% * ``'periodic'`` -% -% :param n: -% Number of parameters required for the functor -% :param p: -% Vector of parameters -% :return: -% Instance of class :mat:func:`Func` - -if ~isa(typ, 'char') - error('Function type must be a string') -end - -x.f1 = 0; -x.f2 = 0; -x.coeffs = 0; - -itype = -1; -if strcmp(typ, 'polynomial') - itype = 2; -elseif strcmp(typ, 'fourier') - itype = 1; -elseif strcmp(typ, 'arrhenius') - itype = 3; -elseif strcmp(typ, 'gaussian') - itype = 4; -end - -if itype > 0 - x.coeffs = p; - x.index = funcmethods(0, itype, n, p); -elseif strcmp(typ, 'periodic') - itype = 50; - x.f1 = n; - x.coeffs = p; - x.index = funcmethods(0, itype, n.index, p); -else - if strcmp(typ, 'sum') - itype = 20; - elseif strcmp(typ, 'diff') - itype = 25; - elseif strcmp(typ, 'prod') - itype = 30; - elseif strcmp(typ, 'ratio') - itype = 40; - elseif strcmp(typ, 'composite') - itype = 60; - end - x.f1 = n; - x.f2 = p; - x.index = funcmethods(0, itype, n.index, p.index); -end - -x.typ = typ; -x = class(x, 'Func'); diff --git a/interfaces/matlab/toolbox/@Func/char.m b/interfaces/matlab/toolbox/@Func/char.m deleted file mode 100644 index e7f9634029..0000000000 --- a/interfaces/matlab/toolbox/@Func/char.m +++ /dev/null @@ -1,97 +0,0 @@ -function s = char(p) -% CHAR Get the formatted string to display the function. -% s = char(p) -% :param p: -% Instance of class :mat:func:`Func` -% :return: -% Formatted string displaying the function -% - -if strcmp(p.typ,'sum') - s = ['(' char(p.f1) ') + (' char(p.f2) ')']; -elseif strcmp(p.typ,'diff') - s = ['(' char(p.f1) ') - (' char(p.f2) ')']; -elseif strcmp(p.typ,'prod') - s = ['(' char(p.f1) ') * (' char(p.f2) ')']; -elseif strcmp(p.typ,'ratio') - s = ['(' char(p.f1) ') / (' char(p.f2) ')']; -elseif all(p.coeffs == 0) - s = '0'; -else - if strcmp(p.typ,'polynomial') - d = length(p.coeffs) - 1; - s = []; - nn = 0; - for b = p.coeffs; - cc(d+1-nn) = b; - nn = nn + 1; - end - for a = cc; - if a ~= 0; - if ~isempty(s) - if a > 0 - s = [s ' + ']; - else - s = [s ' - ']; - a = -a; - end - end - if a ~= 1 || d == 0 - s = [s num2str(a)]; - if d > 0 - s = [s '*']; - end - end - if d >= 2 - s = [s 'x^' int2str(d)]; - elseif d == 1 - s = [s 'x']; - end - end - d = d - 1; - end - elseif strcmp(p.typ, 'gaussian') - s = ['Gaussian(' num2str(p.coeffs(1)) ',' ... - num2str(p.coeffs(2)) ',' ... - num2str(p.coeffs(3)) ')']; - elseif strcmp(p.typ, 'fourier') - c = reshape(p.coeffs, [], 2); - Ao = c(1, 1); - w = c(1, 2); - A = c(2:end, 1); - B = c(2:end, 2); - N = size(c, 1) - 1; - if Ao ~= 0 - s = num2str(Ao/2); - else - s = ''; - end - for n=1:N - if A(n) ~= 0 - if A(n) < 0 - prefix = ' - '; - elseif s - prefix = ' + '; - else - prefix = ''; - end - - s = [s prefix num2str(abs(A(n))) '*cos(' num2str(n*w) '*x)']; - end - - if B(n) ~= 0 - if B(n) < 0 - prefix = ' - '; - elseif s - prefix = ' + '; - else - prefix = ''; - end - - s = [s prefix num2str(abs(B(n))) '*sin(' num2str(n*w) '*x)']; - end - end - else - s = ['*** char not yet implemented for' p.typ ' ***']; - end -end diff --git a/interfaces/matlab/toolbox/@Func/clear.m b/interfaces/matlab/toolbox/@Func/clear.m deleted file mode 100644 index 4e29fd04ef..0000000000 --- a/interfaces/matlab/toolbox/@Func/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(f) -% CLEAR Delete the C++ Func1 object. -% clear(f) -% :param f: -% Instance of class :mat:func:`Func` -% - -funcmethods(f.index, 1); diff --git a/interfaces/matlab/toolbox/@Func/display.m b/interfaces/matlab/toolbox/@Func/display.m deleted file mode 100644 index 55534fa89a..0000000000 --- a/interfaces/matlab/toolbox/@Func/display.m +++ /dev/null @@ -1,12 +0,0 @@ -function display(a) -% DISPLAY Display the equation of the input function on the terminal. -% display(a) -% :param a: -% Instance of class :mat:func:`Func` -% - -disp(' '); -disp([inputname(1),' = ']) -disp(' '); -disp([' ' char(a)]) -disp(' '); diff --git a/interfaces/matlab/toolbox/@Func/func_hndl.m b/interfaces/matlab/toolbox/@Func/func_hndl.m deleted file mode 100644 index 7ab6fe0288..0000000000 --- a/interfaces/matlab/toolbox/@Func/func_hndl.m +++ /dev/null @@ -1,10 +0,0 @@ -function i = func_hndl(f) -% FUNC_HNDL Get the integer used to access the kernel object. -% i = func_hndl(f) -% :param f: -% Instance of class :mat:func:`Func` -% :return: -% The handle of the input function -% - -i = f.index; diff --git a/interfaces/matlab/toolbox/@Func/plus.m b/interfaces/matlab/toolbox/@Func/plus.m deleted file mode 100644 index 434cb1db05..0000000000 --- a/interfaces/matlab/toolbox/@Func/plus.m +++ /dev/null @@ -1,14 +0,0 @@ -function r = plus(a, b) -% PLUS Get a functor representing the sum of two input functors. -% r = plus(a, b) -% :param a: -% Instance of class :mat:func:`Func` -% :param b: -% Instance of class :mat:func:`Func` -% :return: -% Instance of class :mat:func:`Func` -% -% PLUS - Return a functor representing the sum of two functors a -% and b. -% -r = Func('sum', a, b); diff --git a/interfaces/matlab/toolbox/@Func/private/funcmethods.m b/interfaces/matlab/toolbox/@Func/private/funcmethods.m deleted file mode 100644 index 89640c0a9c..0000000000 --- a/interfaces/matlab/toolbox/@Func/private/funcmethods.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = funcmethods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(110, n, job); -elseif nargin == 3 - v = ctmethods(110, n, job, a); -elseif nargin == 4 - v = ctmethods(110, n, job, a, b); -elseif nargin == 5 - v = ctmethods(110, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(110, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@Func/rdivide.m b/interfaces/matlab/toolbox/@Func/rdivide.m deleted file mode 100644 index d7c19e9a62..0000000000 --- a/interfaces/matlab/toolbox/@Func/rdivide.m +++ /dev/null @@ -1,12 +0,0 @@ -function r = rdivide(a, b) -% RDIVIDE Get a functor that is the ratio of the input functors. -% r = rdivide(a,b) -% :param a: -% Instance of class :mat:func:`Func` -% :param b: -% Instance of class :mat:func:`Func` -% :return: -% Instance of class :mat:func:`Func` -% - -r = Func('ratio', a, b); diff --git a/interfaces/matlab/toolbox/@Func/subsref.m b/interfaces/matlab/toolbox/@Func/subsref.m deleted file mode 100644 index 6be0bf7167..0000000000 --- a/interfaces/matlab/toolbox/@Func/subsref.m +++ /dev/null @@ -1,21 +0,0 @@ -function b = subsref(a, s) -% SUBSREF Redefine subscripted references for functors. -% b = subsref(a, s) -% :param a: -% Instance of class :mat:func:`Func` -% :param s: -% Value at which the function should be evaluated. -% :return: -% Returns the value of the function evaluated at ``s`` -% - -switch s.type - case '()' - ind = s.subs{:}; - b = zeros(1, length(ind)); - for k = 1:length(ind) - b(k) = funcmethods(2, a.index, ind(k)); - end - otherwise - error('Specify value for x as p(x)') -end diff --git a/interfaces/matlab/toolbox/@Func/times.m b/interfaces/matlab/toolbox/@Func/times.m deleted file mode 100644 index 97e9ddb275..0000000000 --- a/interfaces/matlab/toolbox/@Func/times.m +++ /dev/null @@ -1,12 +0,0 @@ -function r = times(a, b) -% TIMES Create a functor that multiplies two other functors. -% r = times(a, b) -% :param a: -% Instance of class :mat:func:`Func` -% :param b: -% Instance of class :mat:func:`Func` -% :return: -% Instance of class :mat:func:`Func` -% - -r = Func('prod', a, b); diff --git a/interfaces/matlab/toolbox/@Interface/Interface.m b/interfaces/matlab/toolbox/@Interface/Interface.m deleted file mode 100644 index 8ca4a2dc4c..0000000000 --- a/interfaces/matlab/toolbox/@Interface/Interface.m +++ /dev/null @@ -1,41 +0,0 @@ -function s = Interface(src, id, p1, p2, p3, p4) -% INTERFACE Interface class constructor. -% s = Interface(src, id, p1, p2, p3, p4) -% -% See `ideal-surface `__ -% and `Declaring adjacent phases `__. -% -% See also: :mat:func:`importEdge`, :mat:func:`importInterface` -% -% :param src: -% YAML file containing the interface or edge phase. -% :param id: -% Name of the interface or edge phase in the YAML file. -% :param p1: -% Adjoining phase to the interface. -% :param p2: -% Adjoining phase to the interface. -% :param p3: -% Adjoining phase to the interface. -% :param p4: -% Adjoining phase to the interface. -% :return: -% Instance of class :mat:func:`Interface` -% - -t = ThermoPhase(src, id); -if nargin == 2 - k = Kinetics(t, src, id); -elseif nargin == 3 - k = Kinetics(t, src, id, p1); -elseif nargin == 4 - k = Kinetics(t, src, id, p1, p2); -elseif nargin == 5 - k = Kinetics(t, src, id, p1, p2, p3); -elseif nargin == 6 - k = Kinetics(t, src, id, p1, p2, p3, p4); -end - -s.kin = k; -s.th = t; -s = class(s,'Interface', t, k); diff --git a/interfaces/matlab/toolbox/@Interface/concentrations.m b/interfaces/matlab/toolbox/@Interface/concentrations.m deleted file mode 100644 index fb3b7c7f25..0000000000 --- a/interfaces/matlab/toolbox/@Interface/concentrations.m +++ /dev/null @@ -1,23 +0,0 @@ -function c = concentrations(s) -% CONCENTRATIONS Get the concentrations of the species on an interface. -% c = concentrations(s) -% :param s: -% Instance of class :mat:func:`Interface` with surface species -% :return: -% If no output value is assigned, a bar graph will be plotted. -% Otherwise, a vector of length ``n_surf_species`` will be -% returned. -% - -c = surfmethods(thermo_hndl(s), 103); -if nargout == 0 - figure - set(gcf, 'Name', 'Concentrations') - bar(c); - colormap(summer); - nm = speciesNames(s); - set(gca, 'XTickLabel', nm); - xlabel('Species Name'); - ylabel('Concentration [kmol/m2]'); - title('Surface Species Concentrations'); -end diff --git a/interfaces/matlab/toolbox/@Interface/coverages.m b/interfaces/matlab/toolbox/@Interface/coverages.m deleted file mode 100644 index 8bf4c1688e..0000000000 --- a/interfaces/matlab/toolbox/@Interface/coverages.m +++ /dev/null @@ -1,23 +0,0 @@ -function c = coverages(s) -% COVERAGES Get the surface coverages of the species on an interface. -% c = coverages(s) -% :param s: -% Instance of class :mat:func:`Interface` with surface species -% :return: -% If no output value is assigned, a bar graph will be plotted. -% Otherwise, a vector of length ``n_surf_species`` will be -% returned. -% - -c = surfmethods(thermo_hndl(s), 101); -if nargout == 0 - figure - set(gcf, 'Name', 'Coverages') - bar(c); - colormap(summer); - nm = speciesNames(s); - set(gca,'XTickLabel', nm); - xlabel('Species Name'); - ylabel('Coverage'); - title('Surface Species Coverages'); -end diff --git a/interfaces/matlab/toolbox/@Interface/private/surfmethods.m b/interfaces/matlab/toolbox/@Interface/private/surfmethods.m deleted file mode 100644 index 3c9fa8ff0c..0000000000 --- a/interfaces/matlab/toolbox/@Interface/private/surfmethods.m +++ /dev/null @@ -1,24 +0,0 @@ -function v = surfmethods(n, job, a, b, c, d, e, f) -% SURFMETHODS - converter function for methods of class Stack -% -% All Cantera functions and methods are handled by the single MEX -% file 'ctmethods.' This function is provided only for convenience, -% and simply calls ctmethods with a flag associated with this class -% as the first parameter, followed by the input arguments. -if nargin == 2 - v = ctmethods(100, n, job); -elseif nargin == 3 - v = ctmethods(100, n, job, a); -elseif nargin == 4 - v = ctmethods(100, n, job, a, b); -elseif nargin == 5 - v = ctmethods(100, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(100, n, job, a, b, c, d); -elseif nargin == 7 - v = ctmethods(100, n, job, a, b, c, d, e); -elseif nargin == 8 - v = ctmethods(100, n, job, a, b, c, d, e, f); -else - error('too many arguments'); -end diff --git a/interfaces/matlab/toolbox/@Interface/setCoverages.m b/interfaces/matlab/toolbox/@Interface/setCoverages.m deleted file mode 100644 index 7b45acbb18..0000000000 --- a/interfaces/matlab/toolbox/@Interface/setCoverages.m +++ /dev/null @@ -1,34 +0,0 @@ -function setCoverages(s, cov, norm) -% SETCOVERAGES Set surface coverages of the species on an interface. -% setCoverages(s, cov, norm) -% :param s: -% Instance of class :mat:func:`Interface` -% :param cov: -% Coverage of the species. ``cov`` can be either a vector of -% length ``n_surf_species``, or a string in the format -% ``'Species:Coverage, Species:Coverage'`` -% :param norm: -% Optional flag that denotes whether or not to normalize the species -% coverages. ``norm`` is either of the two strings ``'nonorm'``` or -% ``'norm'``. If left unset, the default is `norm`. This only works if -% ``s`` is a vector, not a string. Since unnormalized coverages can lead to -% unphysical results, ``'nonorm'`` should be used only in rare cases, such -% as computing partial derivatives with respect to a species coverage. -% - -if nargin == 3 && strcmp(norm,'nonorm') - norm_flag = 0; -else - norm_flag = 1; -end - -if isa(cov, 'double') - sz = length(cov); - if sz == nSpecies(s) - surfmethods(thermo_hndl(s), 3, cov, norm_flag); - else - error('wrong size for coverage array'); - end -elseif isa(cov,'char') - surfmethods(thermo_hndl(s), 5, cov); -end diff --git a/interfaces/matlab/toolbox/@Kinetics/Kinetics.m b/interfaces/matlab/toolbox/@Kinetics/Kinetics.m deleted file mode 100644 index 8bec94e3b6..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/Kinetics.m +++ /dev/null @@ -1,67 +0,0 @@ -function k = Kinetics(ph, src, id, neighbor1, neighbor2, neighbor3, neighbor4) -% KINETICS Kinetics class constructor. -% k = Kinetics(r, ph, neighbor1, neighbor2, neighbor3, neighbor4) -% Class Kinetics represents kinetics managers, which are classes -% that manage reaction mechanisms. The reaction mechanism -% attributes are specified in a YAML file. -% Instances of class :mat:func:`Kinetics` are responsible for evaluating reaction rates -% of progress, species production rates, and other quantities pertaining to -% a reaction mechanism. -% -% :param ph: -% An instance of class :mat:func:`ThermoPhase` representing the phase -% in which reactions occur -% :param src: -% Input string of YAML file name. -% :param id: -% ID of the phase to import as specified in the input file. (optional) -% :param neighbor1: -% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a -% neighboring phase. -% :param neighbor2: -% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a -% neighboring phase. -% :param neighbor3: -% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a -% neighboring phase. -% :param neighbor4: -% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a -% neighboring phase. -% :return: -% Instance of class :mat:func:`Kinetics` -% - -% indices for bulk phases in a heterogeneous mechanism. -% initialize < 0 so that bulk phases will not be included. -ineighbor1 = -1; -ineighbor2 = -1; -ineighbor3 = -1; -ineighbor4 = -1; -if nargin == 2 - id = '-'; -end - -k.owner = 1; -% get the integer indices used to find the stored objects -% representing the phases participating in the mechanism. -iphase = thermo_hndl(ph); -if nargin > 3 - ineighbor1 = thermo_hndl(neighbor1); - if nargin > 4 - ineighbor2 = thermo_hndl(neighbor2); - if nargin > 5 - ineighbor3 = thermo_hndl(neighbor3); - if nargin > 6 - ineighbor4 = thermo_hndl(neighbor4); - end - end - end -end -k.id = kinetics_get(0, 0, src, id, iphase, ineighbor1, ineighbor2, ... - ineighbor3, ineighbor4); -if k.id < 0 - error(geterr); -end - -k = class(k, 'Kinetics'); - diff --git a/interfaces/matlab/toolbox/@Kinetics/advanceCoverages.m b/interfaces/matlab/toolbox/@Kinetics/advanceCoverages.m deleted file mode 100644 index ce6e8d3304..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/advanceCoverages.m +++ /dev/null @@ -1,13 +0,0 @@ -function advanceCoverages(k, dt) -% ADVANCECOVERAGES Advance the surface coverages forward in time. -% advanceCoverages(k, dt) -% The bulk phase concentrations are held fixed during this operation. -% -% :param k: -% Instance of class :mat:func:`Interface` with an associated -% :mat:func:`Kinetics` object. -% :param dt: -% Time interval by which the coverages should be advanced -% - -kinetics_set(k.id, 5, 0, dt); diff --git a/interfaces/matlab/toolbox/@Kinetics/clear.m b/interfaces/matlab/toolbox/@Kinetics/clear.m deleted file mode 100644 index eeffee7507..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/clear.m +++ /dev/null @@ -1,9 +0,0 @@ -function clear(k) -% CLEAR Delete the Kinetics instance. -% clear(k) -% :param k: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% - -kinetics_set(k.id, 3, 0, 0); diff --git a/interfaces/matlab/toolbox/@Kinetics/creationRates.m b/interfaces/matlab/toolbox/@Kinetics/creationRates.m deleted file mode 100644 index ebf1863c0e..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/creationRates.m +++ /dev/null @@ -1,25 +0,0 @@ -function cdot = creationRates(a) -% CREATIONRATES Get the chemical creation rates. -% cdot = creationRates(a) -% -% See also: :mat:func:`destructionRates`, :mat:func:`netProdRates` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which creation rates are desired. -% :return: -% Returns a column vector of the creation rates of all -% species. If the output is not assigned to a variable, a -% bar graph is produced. Units: kmol/m**3-s -% - -cdot = kinetics_get(a.id, 21, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Creation Rates') - bar(cdot) - xlabel('Species Number') - ylabel('Creation Rate (kmol/m^3-s)') - title('Species Chemical Creation Rates') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/destructionRates.m b/interfaces/matlab/toolbox/@Kinetics/destructionRates.m deleted file mode 100644 index 048252c980..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/destructionRates.m +++ /dev/null @@ -1,25 +0,0 @@ -function ddot = destructionRates(a) -% DESTRUCTIONRATES Get the chemical destruction rates. -% ddot = destructionRates(a) -% -% See also: :mat:func:`creationRates`, :mat:func:`netProdRates` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which destruction rates are desired. -% :return: -% Returns a column vector of the destruction rates of all -% species. If the output is not assigned to a variable, a -% bar graph is produced. Units: kmol/m**3-s -% - -ddot = kinetics_get(a.id, 22, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Destruction Rates') - bar(ddot) - xlabel('Species Number') - ylabel('Destruction Rate (kmol/m^3/s)') - title('Species Chemical Destruction Rates') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/equil_Kc.m b/interfaces/matlab/toolbox/@Kinetics/equil_Kc.m deleted file mode 100644 index 95e32957f0..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/equil_Kc.m +++ /dev/null @@ -1,27 +0,0 @@ -function kc = equil_Kc(a) -% EQUIL_KC Get the equilibrium constants for all reactions -% kc = equil_Kc(a) -% -% See also: :mat:func:`fwdRateConstants`, :mat:func:`revRateConstants` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which equilibrium constants are desired. -% :return: -% Returns a column vector of the equilibrium constants -% for all reactions. The vector has an entry for every -% reaction, whether reversible or not, but non-zero values -% occur only for the reversible reactions. If the output is -% not assigned to a variable, a bar graph is produced instead. -% - -kc = kinetics_get(a.id, 14, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Equilibrium Constants') - bar(log10(kc)) - xlabel('Reaction Number') - ylabel('log_{10} Kc [kmol, m, s]') - title('Equilibrium Constants Kc') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/fwdRateConstants.m b/interfaces/matlab/toolbox/@Kinetics/fwdRateConstants.m deleted file mode 100644 index 50959aca3a..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/fwdRateConstants.m +++ /dev/null @@ -1,23 +0,0 @@ -function kf = fwdRateConstants(a) -% FWDRATECONSTANTS Get the forward reaction rate constants. -% kf = fwdRateConstants(a) -% -% The computed values include all temperature-dependent and pressure-dependent -% contributions. By default, third-body concentrations are only considered if -% they are part of the reaction rate definition; for a legacy implementation that -% includes third-body concentrations see :mat:func:`useLegacyRateConstants`. -% Units are a combination of kmol, m^3 and s, that depend on the rate expression -% for the reaction. -% -% see also: :mat:func:`revRateConstants`, :mat:func:`equil_Kc` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which forward rate constants are desired. -% :return: -% Returns a column vector of the forward rate constants of -% all of the reactions. -% - -kf = kinetics_get(a.id, 15, 0); diff --git a/interfaces/matlab/toolbox/@Kinetics/getDeltaEnthalpies.m b/interfaces/matlab/toolbox/@Kinetics/getDeltaEnthalpies.m deleted file mode 100644 index 3f678d0a3d..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/getDeltaEnthalpies.m +++ /dev/null @@ -1,14 +0,0 @@ -function dH = getDeltaEnthalpies(a) -% GETDELTAENTHALPIES Get the enthalpy of reaction for each reaction. -% dH = getDeltaEnthalpies(a) -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) for which the enthalpies of -% reaction are desired. -% :return: -% Returns a vector of the enthalpy of reaction for each -% reaction. Units: J/kmol -% - -dH = kinetics_get(a.id, 17, 0); diff --git a/interfaces/matlab/toolbox/@Kinetics/getDeltaEntropies.m b/interfaces/matlab/toolbox/@Kinetics/getDeltaEntropies.m deleted file mode 100644 index 0db6945a1b..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/getDeltaEntropies.m +++ /dev/null @@ -1,14 +0,0 @@ -function dS = getDeltaEntropies(a) -% GETDELTAENTROPIES Get the entropy of reaction for each reaction. -% dS = getDeltaEntropies(a) -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) for which the entropies of -% reaction are desired. -% :return: -% Returns a vector of the entropy of reaction for each -% reaction. Units: J/kmol-K -% - -dS = kinetics_get(a.id, 17, 2); diff --git a/interfaces/matlab/toolbox/@Kinetics/getDeltaGibbs.m b/interfaces/matlab/toolbox/@Kinetics/getDeltaGibbs.m deleted file mode 100644 index e77925a975..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/getDeltaGibbs.m +++ /dev/null @@ -1,14 +0,0 @@ -function dG = getDeltaGibbs(a) -% GETDELTAGIBBS Get the Gibbs free energy of reaction for each reaction. -% dG = getDeltaGibbs(a) -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) for which the Gibbs free -% energies of reaction are desired. -% :return: -% Returns a vector of the Gibbs free energy of reaction -% for each reaction. Units: J/kmol -% - -dG = kinetics_get(a.id, 17, 1); diff --git a/interfaces/matlab/toolbox/@Kinetics/isReversible.m b/interfaces/matlab/toolbox/@Kinetics/isReversible.m deleted file mode 100644 index e0980f3d1d..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/isReversible.m +++ /dev/null @@ -1,25 +0,0 @@ -function yn = isReversible(a, i) -% ISREVERSIBLE Get an array of flags indicating reversibility of a reaction. -% yn = isReversible(a, i) -% A reversible reaction is one that runs in both the forward -% direction (reactants -> products) and in the reverse direction -% (products -> reactants). The reverse rate for reversible -% reactions can computed from thermochemistry, so that the -% reaction satisfies detailed balance, and the net rate of -% progress is zero in states of chemical equilibrium. The reverse -% rate can also be specified directly by a rate expression. An -% irreversible reaction is one whose reverse reaction rate is -% zero. -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the reversible flags are desired. -% :param i: -% Integer reaction number -% :return: -% 1 if reaction number ``i`` is -% reversible, and 0 if it is irreversible. -% - -yn = kinetics_get(a.id, 4, i); diff --git a/interfaces/matlab/toolbox/@Kinetics/kinetics_hndl.m b/interfaces/matlab/toolbox/@Kinetics/kinetics_hndl.m deleted file mode 100644 index 7b2baaa41e..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/kinetics_hndl.m +++ /dev/null @@ -1,12 +0,0 @@ -function i = kinetics_hndl(k) -% KINETICS_HNDL Get the integer used to access kernel object. -% i = kinetics_hndl(k) -% :param k: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the handle is desired. -% :return: -% Returns the integer ID of the kinetics kernel object. -% - -i = k.id; diff --git a/interfaces/matlab/toolbox/@Kinetics/multiplier.m b/interfaces/matlab/toolbox/@Kinetics/multiplier.m deleted file mode 100644 index 6c3627a693..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/multiplier.m +++ /dev/null @@ -1,21 +0,0 @@ -function n = multiplier(a,irxn) -% MULTIPLIER Get the multiplier for reaction rate of progress. -% n = multiplier(a,irxn) -% The multiplier multiplies the reaction rate of progress. It may -% be used to implement sensitivity analysis, or to selectively -% disable reactions. For reversible reactions, it multiplies both -% the forward and reverse rates. By default, the multiplier value -% is 1.0, but it may be set to any other value by calling method -% :mat:func:`setMultiplier`. -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the multipliers are desired. -% :param irxn: -% Integer reaction number for which the multiplier is desired. -% :return: -% Multiplier of the rate of progress of reaction number ``irxn`` -% - -n = kinetics_get(a.id, 2, irxn); diff --git a/interfaces/matlab/toolbox/@Kinetics/nReactions.m b/interfaces/matlab/toolbox/@Kinetics/nReactions.m deleted file mode 100644 index c2513a1fc1..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/nReactions.m +++ /dev/null @@ -1,12 +0,0 @@ -function n = nReactions(a) -% NREACTIONS Get the number of reactions. -% n = nReactions(a) -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the number of reactions is desired. -% :return: -% Integer number of reactions -% - -n = kinetics_get(a.id, 1, 0); diff --git a/interfaces/matlab/toolbox/@Kinetics/nTotalSpecies.m b/interfaces/matlab/toolbox/@Kinetics/nTotalSpecies.m deleted file mode 100644 index 85d309637e..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/nTotalSpecies.m +++ /dev/null @@ -1,15 +0,0 @@ -function nsp = nTotalSpecies(a) -% NTOTALSPECIES Get the total number of species. -% nsp = nTotalSpecies(a) -% The total number of species, summed over all -% participating phases. -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the number of species is desired. -% :return: -% Integer total number of species -% - -nsp = kinetics_get(a.id, 3, 0); diff --git a/interfaces/matlab/toolbox/@Kinetics/netProdRates.m b/interfaces/matlab/toolbox/@Kinetics/netProdRates.m deleted file mode 100644 index 14629a24f5..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/netProdRates.m +++ /dev/null @@ -1,25 +0,0 @@ -function wdot = netProdRates(a) -% NETPRODRATES Get the net chemical production rates for all species. -% wdot = netProdRates(a) -% -% See also: :mat:func:`creationRates`, :mat:func:`destructionRates` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which net production rates are desired. -% :return: -% Returns a column vector of the net production (creation - -% destruction) rates of all species. If the output is not -% assigned to a variable, a bar plot is produced. -% - -wdot = kinetics_get(a.id, 23, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Production Rates') - bar(wdot) - xlabel('Species Number') - ylabel('Net Production Rate (kmol/m^3/s)') - title('Species Net Chemical Production Rates') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/private/kinetics_get.m b/interfaces/matlab/toolbox/@Kinetics/private/kinetics_get.m deleted file mode 100644 index d262a9bda4..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/private/kinetics_get.m +++ /dev/null @@ -1,20 +0,0 @@ -function v = kinetics_get(n, job, a, b, c, d, e, f, g) -% KINETICS_GET - get kinetics attributes -% -if nargin == 2 - v = ctmethods(40, n, job); -elseif nargin == 3 - v = ctmethods(40, n, job, a); -elseif nargin == 4 - v = ctmethods(40, n, job, a, b); -elseif nargin == 5 - v = ctmethods(40, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(40, n, job, a, b, c, d); -elseif nargin == 7 - v = ctmethods(40, n, job, a, b, c, d, e); -elseif nargin == 8 - v = ctmethods(40, n, job, a, b, c, d, e, f); -elseif nargin == 9 - v = ctmethods(40, n, job, a, b, c, d, e, f, g); -end diff --git a/interfaces/matlab/toolbox/@Kinetics/private/kinetics_set.m b/interfaces/matlab/toolbox/@Kinetics/private/kinetics_set.m deleted file mode 100644 index 2634394dc6..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/private/kinetics_set.m +++ /dev/null @@ -1,4 +0,0 @@ -function kinetics_set(n, job, a, b) -% KINETICS_SET - get kinetics attributes -% -ctmethods(40, n, -job, a, b) diff --git a/interfaces/matlab/toolbox/@Kinetics/reactionEqn.m b/interfaces/matlab/toolbox/@Kinetics/reactionEqn.m deleted file mode 100644 index 2207270160..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/reactionEqn.m +++ /dev/null @@ -1,40 +0,0 @@ -function e = reactionEqn(a, irxn) -% REACTIONEQN Get the reaction equation of a reaction. -% e = reactionEqn(a, irxn) -% If only the first argument -% is given, the reaction equations of all of the reactions are -% returned in a cell array. Otherwise, ``irxn`` must be an integer -% or vector of integers. -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the reaction equations are desired. -% :param irxn: -% Optional. Integer or vector of integer reaction numbers. -% :return: -% String or cell array of strings of the reaction equations. -% - -if nargin == 1 - m = nReactions(a); - n = 1; - irxn = (1:m)'; -elseif nargin == 2 - if isa(irxn,'double') - [m, n] = size(irxn); - else - error('reaction number(s) must be numeric'); - end -end - -if m == 1 && n == 1 - e = kinetics_get(a.id, 31, irxn); -else - e = cell(m,n); - for i = 1:m - for j = 1:n - e{i, j} = kinetics_get(a.id, 31, irxn(i,j)); - end - end -end diff --git a/interfaces/matlab/toolbox/@Kinetics/revRateConstants.m b/interfaces/matlab/toolbox/@Kinetics/revRateConstants.m deleted file mode 100644 index a517b79eb5..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/revRateConstants.m +++ /dev/null @@ -1,23 +0,0 @@ -function kr = revRateConstants(a) -% REVRATECONSTANTS Get the reverse reaction rate constants. -% kr = revRateConstants(a) -% -% The computed values include all temperature-dependent and pressure-dependent -% contributions. By default, third-body concentrations are only considered if -% they are part of the reaction rate definition; for a legacy implementation that -% includes third-body concentrations see :mat:func:`useLegacyRateConstants`. -% Units are a combination of kmol, m^3 and s, that depend on the rate expression -% for the reaction. -% -% See also: :mat:func:`fwdRateConstants`, :mat:func:`equil_KC` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which reverse rate constants are desired. -% :return: -% Returns a column vector of the reverse rate constants of -% all of the reactions. -% - -kr = kinetics_get(a.id, 16, 0); diff --git a/interfaces/matlab/toolbox/@Kinetics/rop.m b/interfaces/matlab/toolbox/@Kinetics/rop.m deleted file mode 100644 index 15ea3e49cc..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/rop.m +++ /dev/null @@ -1,30 +0,0 @@ -function rop = rop(a) -% ROP Get the forward and reverse rates of progress. -% rop = rop(a) -% -% See also: :mat:func:`rop_f`, :mat:func:`rop_r`, :mat:func:`rop_net` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which forward and reverse rates of progress are desired. -% :return: -% Returns an I x 2 array of reaction rates of -% progress, where I is the number of reactions. The first -% column contains the forward rates of progress, and the -% second column the reverse rates. If this function -% is called with no output argument, a bar graph is produced. -% - -f = rop_f(a); -r = rop_r(a); -rop = [f r]; -if nargout == 0 - figure - set(gcf, 'Name', 'Rates of Progress'); - bar(rop); - xlabel('Reaction Number'); - ylabel('Rate of Progress [kmol/m^3-s]'); - title('Rates of Progress'); - legend('Forward', 'Reverse'); -end diff --git a/interfaces/matlab/toolbox/@Kinetics/rop_f.m b/interfaces/matlab/toolbox/@Kinetics/rop_f.m deleted file mode 100644 index fbbf45975c..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/rop_f.m +++ /dev/null @@ -1,25 +0,0 @@ -function q = rop_f(a) -% ROP_F Forward rates of progress for all reactions. -% q = rop_f(a) -% -% See also: :mat:func:`rop_r`, :mat:func:`rop_net`, :mat:func:`rop` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which forward rates of progress are desired. -% :return: -% Returns a column vector of the forward rates of progress -% for all reactions. If this function -% is called with no output argument, a bar graph is produced. -% - -q = kinetics_get(a.id, 11, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Rates of Progress') - bar(q) - xlabel('Reaction Number') - ylabel('Forward Rate of Progress [kmol/m^3]') - title('Forward Rates of Progress') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/rop_net.m b/interfaces/matlab/toolbox/@Kinetics/rop_net.m deleted file mode 100644 index 7786f1e22e..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/rop_net.m +++ /dev/null @@ -1,25 +0,0 @@ -function q = rop_net(a) -% ROP_NET Net rates of progress for all reactions. -% q = rop_net(a) -% -% See also: :mat:func:`rop_f`, :mat:func:`rop_r`, :mat:func:`rop` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the net rates of progress are desired. -% :return: -% Returns a column vector of the net rates of progress -% for all reactions. If this function -% is called with no output argument, a bar graph is produced. -% - -q = kinetics_get(a.id, 13, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Net Rates of Progress') - bar(q) - xlabel('Reaction Number') - ylabel('Net Rate of Progress [kmol/m^3]') - title('Net Rates of Progress') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/rop_r.m b/interfaces/matlab/toolbox/@Kinetics/rop_r.m deleted file mode 100644 index dc28ebec85..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/rop_r.m +++ /dev/null @@ -1,25 +0,0 @@ -function q = rop_r(a) -% ROP_R Get the reverse rates of progress for all reactions. -% q = rop_r(a) -% -% See also: :mat:func:`rop_f`, :mat:func:`rop_net`, :mat:func:`rop` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which reverse rates of progress are desired. -% :return: -% Returns a column vector of the reverse rates of progress -% for all reactions. If this function -% is called with no output argument, a bar graph is produced. -% - -q = kinetics_get(a.id, 12, 0); -if nargout == 0 - figure - set(gcf, 'Name', 'Reverse Rates of Progress') - bar(q) - xlabel('Reaction Number') - ylabel('Reverse Rate of Progress [kmol/m^3]') - title('Reverse Rates of Progress') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/setMultiplier.m b/interfaces/matlab/toolbox/@Kinetics/setMultiplier.m deleted file mode 100644 index b0a66c2896..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/setMultiplier.m +++ /dev/null @@ -1,40 +0,0 @@ -function setMultiplier(a, irxn, v) -% SETMULTIPLIER Set the multiplier for the reaction rate of progress. -% setMultiplier(a,irxn,v) -% The multiplier multiplies the reaction rate of progress. It may -% be used to implement sensitivity analysis, or to selectively -% disable reactions. For reversible reactions, it multiplies both -% the forward and reverse rates. By default, the multiplier value -% is 1.0, but the current value may be checked by calling method -% :mat:func:`multiplier`. -% -% If only two arguments are given, it is assumed that the second is -% the desired multiplication factor for all of the reactions. -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the multipliers should be set. -% :param irxn: -% Integer or vector of integers. Reaction number(s) for which -% the multiplier should be set. Optional. -% :param v: -% Value by which the reaction rate of progress should be multiplied -% - -if nargin == 2 - v = irxn; - m = nReactions(a); - irxn = (1:m)'; - n = 1; -elseif nargin == 3 - [m, n] = size(irxn); -else - error('setMultiplier requires 2 or 3 arguments.') -end - -for jm = 1:m - for jn = 1:n - kinetics_set(a.id, 1, irxn(jm,jn), v); - end -end diff --git a/interfaces/matlab/toolbox/@Kinetics/stoich_net.m b/interfaces/matlab/toolbox/@Kinetics/stoich_net.m deleted file mode 100644 index cb74419da4..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/stoich_net.m +++ /dev/null @@ -1,36 +0,0 @@ -function nu = stoich_net(a, species, rxns) -% STOICH_NET Get the net stoichiometric coefficients. -% nu = stoich_net(a,species,rxns) -% -% See also: :mat:func:`stoich_r`, :mat:func:`stoich_p` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the net stoichiometric coefficients are desired. -% :param species: -% Species indices for which net stoichiometric coefficients -% should be retrieved. Optional argument; if specified, ``rxns`` -% must be specified as well. -% :param rxns: -% Reaction indices for which net stoichiometric coefficients -% should be retrieved. Optional argument; if specified, ``species`` -% must be specified as well. -% :return: -% Returns a sparse matrix of all net stoichiometric -% coefficients. The matrix element ``nu(k,i)`` is the -% stoichiometric coefficient of species k as a net in -% reaction i. If ``species`` and ``rxns`` are specified, the matrix -% will contain only entries for the specified species and -% reactions. For example, ``stoich_p(a,3,[1 3 5 7])`` returns a -% sparse matrix containing only the coefficients for species 3 -% in reactions 1, 3, 5, and 7. -% - -if nargin == 1 - nu = stoich_p(a) - stoich_r(a); -elseif nargin == 3 - nu = stoich_p(a, species, rxns) - stoich_r(a, species, rxns); -else - error(['stoich_net requires 1 or 3 arguments.']) -end diff --git a/interfaces/matlab/toolbox/@Kinetics/stoich_p.m b/interfaces/matlab/toolbox/@Kinetics/stoich_p.m deleted file mode 100644 index b96e115ca9..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/stoich_p.m +++ /dev/null @@ -1,51 +0,0 @@ -function nu_p = stoich_p(a, species, rxns) -% STOICH_P Get the product stoichiometric coefficients. -% nu_p = stoich_p(a,species,rxns) -% -% See also: :mat:func:`stoich_r`, :mat:func:`stoich_net` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the product stoichiometric coefficients are desired. -% :param species: -% Species indices for which product stoichiometric coefficients -% should be retrieved. Optional argument; if specified, ``rxns`` -% must be specified as well. -% :param rxns: -% Reaction indices for which product stoichiometric coefficients -% should be retrieved. Optional argument; if specified, ``species`` -% must be specified as well. -% :return: -% Returns a sparse matrix of all product stoichiometric -% coefficients. The matrix element ``nu(k,i)`` is the -% stoichiometric coefficient of species k as a product in -% reaction i. If ``species`` and ``rxns`` are specified, the matrix -% will contain only entries for the specified species and -% reactions. For example, ``stoich_p(a,3,[1 3 5 7])`` returns a -% sparse matrix containing only the coefficients for species 3 -% in reactions 1, 3, 5, and 7. -% - -nsp = nTotalSpecies(a); -nr = nReactions(a); -b = sparse(nsp, nr); -if nargin == 1 - kvals = 1:nsp; - ivals = 1:nr; -elseif nargin == 3 - kvals = species; - ivals = rxns; -else - error('stoich_p requires 1 or 3 arguments.') -end - -for k = kvals - for i = ivals - nu = kinetics_get(a.id, 6, i, k); - if nu ~= 0.0 - b(k, i) = nu; - end - end -end -nu_p = b; diff --git a/interfaces/matlab/toolbox/@Kinetics/stoich_r.m b/interfaces/matlab/toolbox/@Kinetics/stoich_r.m deleted file mode 100644 index ec7fe98bb5..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/stoich_r.m +++ /dev/null @@ -1,51 +0,0 @@ -function nu_r = stoich_r(a, species, rxns) -% STOICH_R Get the reactant stoichiometric coefficients. -% nu_r = stoich_r(a,species,rxns) -% -% See also: :mat:func:`stoich_p`, :mat:func:`stoich_net` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the reactant stoichiometric coefficients are desired. -% :param species: -% Species indices for which reactant stoichiometric coefficients -% should be retrieved. Optional argument; if specified, ``rxns`` -% must be specified as well. -% :param rxns: -% Reaction indices for which reactant stoichiometric coefficients -% should be retrieved. Optional argument; if specified, ``species`` -% must be specified as well. -% :return: -% Returns a sparse matrix of all reactant stoichiometric -% coefficients. The matrix element ``nu(k,i)`` is the -% stoichiometric coefficient of species k as a reactant in -% reaction i. If ``species`` and ``rxns`` are specified, the matrix -% will contain only entries for the specified species and -% reactions. For example, ``stoich_r(a,3,[1 3 5 7])`` returns a -% sparse matrix containing only the coefficients for species 3 -% in reactions 1, 3, 5, and 7. -% - -nsp = nTotalSpecies(a); -nr = nReactions(a); -b = sparse(nsp, nr); -if nargin == 1 - kvals = 1:nsp; - ivals = 1:nr; -elseif nargin == 3 - kvals = species; - ivals = rxns; -else - error('stoich_r requires 1 or 3 arguments.') -end - -for k = kvals - for i = ivals - nu = kinetics_get(a.id, 5, i, k); - if nu ~= 0.0 - b(k, i) = nu; - end - end -end -nu_r = b; diff --git a/interfaces/matlab/toolbox/@Kinetics/ydot.m b/interfaces/matlab/toolbox/@Kinetics/ydot.m deleted file mode 100644 index 548818e2d8..0000000000 --- a/interfaces/matlab/toolbox/@Kinetics/ydot.m +++ /dev/null @@ -1,14 +0,0 @@ -function v = ydot(a) -% YDOT Get the mass production rates of the species. -% v = ydot(a) -% Evaluates the source term :math:`\dot{\omega}_k M_k /\rho` -% -% :param a: -% Instance of class :mat:func:`Kinetics` (or another -% object deriving from Kinetics) -% for which the ydots are desired. -% :return: -% Returns a vector of length nSpecies. Units: kg/s -% - -v = kinetics_get(a.id, 24, 0); diff --git a/interfaces/matlab/toolbox/@Mixture/Mixture.m b/interfaces/matlab/toolbox/@Mixture/Mixture.m deleted file mode 100644 index a74190f16d..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/Mixture.m +++ /dev/null @@ -1,63 +0,0 @@ -function m = Mixture(phases) -% MIXTURE Multiphase mixture class constructor. -% m = Mixture(phases) -% Class :mat:func:`Mixture` represents mixtures of one or more phases of matter. -% To construct a mixture, supply a cell array of phases and -% mole numbers:: -% -% >> gas = Solution('gas.yaml'); -% >> graphite = Solution('graphite.yaml'); -% >> mix = Mixture({gas, 1.0; graphite, 0.1}); -% -% Phases may also be added later using the addPhase method:: -% -% >> water = Solution('water.yaml'); -% >> addPhase(mix, water, 3.0); -% -% Note that the objects representing each phase compute only the -% intensive state of the phase - they do not store any information -% on the amount of this phase. Mixture objects, on the other hand, -% represent the full extensive state. -% -% Mixture objects are 'lightweight' in the sense that they do not -% store parameters needed to compute thermodynamic or kinetic -% properties of the phases. These are contained in the -% ('heavyweight') phase objects. Multiple mixture objects may be -% constructed using the same set of phase objects. Each one stores -% its own state information locally, and synchronizes the phase -% objects whenever it requires phase properties. -% -% :param phases: -% Cell array of phases and mole numbers -% :return: -% Instance of class :mat:func:`Mixture` -% - -if nargin > 1 - error('Mixture: wrong number of arguments'); -end - -% create an empty mixture -m.mixindex = mixturemethods(0, 0, 0); -m.phases = phases; - -m = class(m, 'Mixture'); - -% if phases are supplied, add them -if nargin == 1 - if ~isa(phases, 'cell') - error('Enter phases as a cell array.'); - end - - % first column contains the phase objects, and the second column - % the mole numbers of each phase - [np nc] = size(phases); - if nc ~= 2 - error('Cell array of phases should have each phase on a new row'); - end - for n = 1:np - addPhase(m, phases{n,1}, phases{n,2}); - end - setTemperature(m, temperature(phases{n,1})); - setPressure(m, pressure(phases{n,1})); -end diff --git a/interfaces/matlab/toolbox/@Mixture/addPhase.m b/interfaces/matlab/toolbox/@Mixture/addPhase.m deleted file mode 100644 index 85ce277fb0..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/addPhase.m +++ /dev/null @@ -1,28 +0,0 @@ -function addPhase(self, phase, moles) -% ADDPHASE Add a phase to a mixture. -% addPhase(self, phase, moles) -% :param self: -% Instance of class :mat:func:`Mixture` to which phases should be -% added -% :param phase: -% Instance of class :mat:func:`ThermoPhase` which should be added -% :param moles: -% Number of moles of the ``phase`` to be added to this mixture. -% Units: kmol -% - -if ~isa(phase,'ThermoPhase') - error('Phase object of wrong type.'); -end -if ~isa(moles,'numeric') - error('Number of moles must be numeric.'); -end -if moles < 0.0 - error('Negative moles!'); -end - -iphase = thermo_hndl(phase); -iok = mixturemethods(4, mix_hndl(self), iphase, moles); -if iok < 0 - error('Error adding phase'); -end diff --git a/interfaces/matlab/toolbox/@Mixture/chemPotentials.m b/interfaces/matlab/toolbox/@Mixture/chemPotentials.m deleted file mode 100644 index 81abe6d4a0..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/chemPotentials.m +++ /dev/null @@ -1,10 +0,0 @@ -function mu = chemPotentials(self) -% CHEMPOTENTIALS Get the chemical potentials of species in a mixture. -% mu = chemPotentials(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% :return: -% Vector of chemical potentials. Units: J/kmol -% - -mu = mixturemethods(41, mix_hndl(self)); diff --git a/interfaces/matlab/toolbox/@Mixture/clear.m b/interfaces/matlab/toolbox/@Mixture/clear.m deleted file mode 100644 index e657635d9d..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(m) -% CLEAR Delete the C++ MultiPhase object. -% clear(m) -% :param m: -% Instance of class :mat:func:`Mixture` -% - -mixturemethods(1, m.mixindex); diff --git a/interfaces/matlab/toolbox/@Mixture/display.m b/interfaces/matlab/toolbox/@Mixture/display.m deleted file mode 100644 index 60ae4605bb..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/display.m +++ /dev/null @@ -1,15 +0,0 @@ -function display(self) -% DISPLAY Display the state of the mixture on the terminal. -% display(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% - -mixturemethods(9, mix_hndl(self)); -[np nc] = size(self.phases); -for n = 1:np - s = [sprintf('\n******************* Phase %d', n) ... - sprintf(' ******************************\n\n Moles: %12.6g', phaseMoles(self,n))]; - disp(s); - display(self.phases{n, 1}); -end diff --git a/interfaces/matlab/toolbox/@Mixture/elementIndex.m b/interfaces/matlab/toolbox/@Mixture/elementIndex.m deleted file mode 100644 index 5a08124f50..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/elementIndex.m +++ /dev/null @@ -1,12 +0,0 @@ -function n = elementIndex(self, name) -% ELEMENTINDEX Get the index of an element. -% n = elementIndex(self, name) -% :param self: -% Instance of class :mat:func:`Mixture` -% :param name: -% Name of the element whose index is desired -% :return: -% Index of element with name ``name`` -% - -n = mixturemethods(22, mix_hndl(self), name); diff --git a/interfaces/matlab/toolbox/@Mixture/equilibrate.m b/interfaces/matlab/toolbox/@Mixture/equilibrate.m deleted file mode 100644 index 72cef08390..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/equilibrate.m +++ /dev/null @@ -1,61 +0,0 @@ -function r = equilibrate(self, XY, err, maxsteps, maxiter, loglevel) -% EQUILIBRATE Set the mixture to a state of chemical equilibrium. -% r = equilibrate(self, XY, err, maxsteps, maxiter, loglevel) -% This method uses a version of the VCS algorithm to find the -% composition that minimizes the total Gibbs free energy of the -% mixture, subject to element conservation constraints. For a -% description of the theory, see Smith and Missen, "Chemical -% Reaction Equilibrium." The VCS algorithm is implemented in -% Cantera kernel class MultiPhaseEquil. -% -% The VCS algorithm solves for the equilibrium composition for -% specified temperature and pressure. If any other property pair -% other than "TP" is specified, then an outer iteration loop is -% used to adjust T and/or P so that the specified property -% values are obtained. :: -% -% >> equilibrate(mix, 'TP') -% >> equilibrate('TP', 1.0e-6, 500) -% -% :param self: -% Instance of class :mat:func:`Mixture` -% :param XY: -% Two-letter string specifying the two properties to hold -% fixed. Currently, ``'TP'``, ``'HP'``, ``'TV'``, and ``'SP'`` are -% implemented. Default: ``'TP'``. -% :param err: -% Error tolerance. Iteration will continue until :math:`\Delta\mu)/RT` -% is less than this value for each reaction. Default: -% 1.0e-9. Note that this default is very conservative, and good -% equilibrium solutions may be obtained with larger error -% tolerances. -% :param maxsteps: -% Maximum number of steps to take while solving the -% equilibrium problem for specified T and P. Default: 1000. -% :param maxiter: -% Maximum number of temperature and/or pressure -% iterations. This is only relevant if a property pair other -% than (T,P) is specified. Default: 200. -% :param loglevel: -% Set to a value > 0 to write diagnostic output. -% Larger values generate more detailed information. -% :return: -% The error in the solution -% - -if nargin < 6 - loglevel = 0; -end -if nargin < 5 - maxiter = 200; -end -if nargin < 4 - maxsteps = 1000; -end -if nargin < 3 - err = 1.0e-9; -end -if nargin < 2 - XY = 'TP'; -end -r = mixturemethods(31, mix_hndl(self), XY, err, maxsteps, maxiter, loglevel); diff --git a/interfaces/matlab/toolbox/@Mixture/mix_hndl.m b/interfaces/matlab/toolbox/@Mixture/mix_hndl.m deleted file mode 100644 index 034bd5c40d..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/mix_hndl.m +++ /dev/null @@ -1,10 +0,0 @@ -function i = mix_hndl(self) -% MIX_HNDL Get the integer used to access the kernel object. -% i = mix_hndl(self) -% :param self: -% Instance of :mat:func:`Mixture` -% :return: -% Integer used to access the kernel object -% - -i = self.mixindex; diff --git a/interfaces/matlab/toolbox/@Mixture/nElements.m b/interfaces/matlab/toolbox/@Mixture/nElements.m deleted file mode 100644 index b1511c36ca..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/nElements.m +++ /dev/null @@ -1,10 +0,0 @@ -function n = nElements(self) -% NELEMENTS Get the number of elements in a mixture. -% n = nElements(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% :return: -% Number of elements in the input -% - -n = mixturemethods(21, mix_hndl(self)); diff --git a/interfaces/matlab/toolbox/@Mixture/nPhases.m b/interfaces/matlab/toolbox/@Mixture/nPhases.m deleted file mode 100644 index 0ca06044e2..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/nPhases.m +++ /dev/null @@ -1,10 +0,0 @@ -function n = nPhases(self) -% NPHASES Get the number of phases in a mixture. -% n = nPhases(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% :return: -% Number of phases in the input -% - -n = mixturemethods(19, mix_hndl(self)); diff --git a/interfaces/matlab/toolbox/@Mixture/nSpecies.m b/interfaces/matlab/toolbox/@Mixture/nSpecies.m deleted file mode 100644 index ec618fb8c8..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/nSpecies.m +++ /dev/null @@ -1,10 +0,0 @@ -function n = nSpecies(self) -% NSPECIES Get the number of species in a mixture. -% n = nSpecies(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% :return: -% Number of species in the input -% - -n = mixturemethods(24, mix_hndl(self)); diff --git a/interfaces/matlab/toolbox/@Mixture/phaseMoles.m b/interfaces/matlab/toolbox/@Mixture/phaseMoles.m deleted file mode 100644 index 8a887d0943..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/phaseMoles.m +++ /dev/null @@ -1,23 +0,0 @@ -function moles = phaseMoles(self, n) -% PHASEMOLES Get the number of moles of a phase in a mixture. -% moles = phaseMoles(self, n) -% :param self: -% Instance of class :mat:func:`Mixture` -% :param n: -% Integer phase number in the input -% :return: -% Moles of phase number ``n``. Units: kmol -% - -if nargin == 2 - moles = mixturemethods(28, mix_hndl(self), n); -elseif nargin == 1 - np = nPhases(self); - m = zeros(1, np); - for n = 1:np - m(n) = mixturemethods(28, mix_hndl(self), n); - end - moles = m; -else - error('wrong number of arguments'); -end diff --git a/interfaces/matlab/toolbox/@Mixture/pressure.m b/interfaces/matlab/toolbox/@Mixture/pressure.m deleted file mode 100644 index ca516992e8..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/pressure.m +++ /dev/null @@ -1,10 +0,0 @@ -function p = pressure(self) -% PRESSURE Get the pressure of the mixture. -% p = pressure(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% :return: -% Pressure. Units: Pa -% - -p = mixturemethods(26, mix_hndl(self)); diff --git a/interfaces/matlab/toolbox/@Mixture/private/mixturemethods.m b/interfaces/matlab/toolbox/@Mixture/private/mixturemethods.m deleted file mode 100644 index 5d47e20ea8..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/private/mixturemethods.m +++ /dev/null @@ -1,17 +0,0 @@ -function v = mixturemethods(n, job, a, b, c, d, e, f) -% -if nargin == 2 - v = ctmethods(120, n, job); -elseif nargin == 3 - v = ctmethods(120, n, job, a); -elseif nargin == 4 - v = ctmethods(120, n, job, a, b); -elseif nargin == 5 - v = ctmethods(120, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(120, n, job, a, b, c, d); -elseif nargin == 7 - v = ctmethods(120, n, job, a, b, c, d, e); -elseif nargin == 8 - v = ctmethods(120, n, job, a, b, c, d, e, f); -end diff --git a/interfaces/matlab/toolbox/@Mixture/setPhaseMoles.m b/interfaces/matlab/toolbox/@Mixture/setPhaseMoles.m deleted file mode 100644 index 4a66e7a43d..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/setPhaseMoles.m +++ /dev/null @@ -1,12 +0,0 @@ -function setPhaseMoles(self, n, moles) -% SETPHASEMOLES Set the number of moles of a phase in a mixture. -% setPhaseMoles(self, n, moles) -% :param self: -% Instance of class :mat:func:`Mixture` -% :param n: -% Phase number in the input -% :param moles: -% Number of moles to add. Units: kmol -% - -mixturemethods(7, mix_hndl(self), n, moles); diff --git a/interfaces/matlab/toolbox/@Mixture/setPressure.m b/interfaces/matlab/toolbox/@Mixture/setPressure.m deleted file mode 100644 index 6f37fc8781..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/setPressure.m +++ /dev/null @@ -1,10 +0,0 @@ -function setPressure(self, P) -% SETPRESSURE Set the pressure of the mixture. -% setPressure(self, P) -% :param self: -% Instance of class :mat:func:`Mixture` -% :param P: -% Pressure. Units: Pa -% - -mixturemethods(6, mix_hndl(self), P); diff --git a/interfaces/matlab/toolbox/@Mixture/setSpeciesMoles.m b/interfaces/matlab/toolbox/@Mixture/setSpeciesMoles.m deleted file mode 100644 index 85513ce78d..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/setSpeciesMoles.m +++ /dev/null @@ -1,18 +0,0 @@ -function setSpeciesMoles(self, moles) -% SETSPECIESMOLES Set the moles of the species. -% setSpeciesMoles(self, moles) -% Set the moles of the species in kmol. The moles may -% be specified either as a string, or as an vector. If a vector is -% used, it must be dimensioned at least as large as the total number -% of species in the mixture. Note that the species may belong to any -% phase, and unspecified species are set to zero. :: -% -% >> setSpeciesMoles(mix, 'C(s):1.0, CH4:2.0, O2:0.2'); -% -% :param self: -% Instance of class :mat:func:`Mixture` -% :param moles: -% Vector or string specifying the moles of species -% - -mixturemethods(8, mix_hndl(self), moles); diff --git a/interfaces/matlab/toolbox/@Mixture/setTemperature.m b/interfaces/matlab/toolbox/@Mixture/setTemperature.m deleted file mode 100644 index 81fc67516a..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/setTemperature.m +++ /dev/null @@ -1,10 +0,0 @@ -function setTemperature(self, T) -% SETTEMPERATURE Set the mixture temperature. -% setTemperature(self, T) -% :param self: -% Instance of class :mat:func:`Mixture` -% :param T: -% Temperature. Units: K -% - -mixturemethods(5, mix_hndl(self), T); diff --git a/interfaces/matlab/toolbox/@Mixture/speciesIndex.m b/interfaces/matlab/toolbox/@Mixture/speciesIndex.m deleted file mode 100644 index b74a1edc62..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/speciesIndex.m +++ /dev/null @@ -1,12 +0,0 @@ -function n = speciesIndex(self, k, p) -% SPECIESINDEX Get the index of a species in a mixture. -% n = speciesIndex(self, k, p) -% :param self: -% Instance of class :mat:func:`Mixture` -% :param name: -% Name of the speces whose index is desired -% :return: -% Index of species with name ``name`` -% - -n = mixturemethods(23, mix_hndl(self), k, p); diff --git a/interfaces/matlab/toolbox/@Mixture/temperature.m b/interfaces/matlab/toolbox/@Mixture/temperature.m deleted file mode 100644 index dfa62727e8..0000000000 --- a/interfaces/matlab/toolbox/@Mixture/temperature.m +++ /dev/null @@ -1,10 +0,0 @@ -function t = temperature(self) -% TEMPERATURE Get the temperature of a mixture. -% t = temperature(self) -% :param self: -% Instance of class :mat:func:`Mixture` -% :return: -% Temperature (K) -% - -t = mixturemethods(25, mix_hndl(self)); diff --git a/interfaces/matlab/toolbox/@Reactor/Reactor.m b/interfaces/matlab/toolbox/@Reactor/Reactor.m deleted file mode 100644 index f10028b9d7..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/Reactor.m +++ /dev/null @@ -1,55 +0,0 @@ -function x = Reactor(contents, typ) -% REACTOR Reactor class constructor. -% x = Reactor(contents, typ) -% A :mat:func:`Reactor` object simulates a perfectly-stirred reactor. -% It has a time-dependent state, and may be coupled to other reactors -% through flow lines or through walls that may expand or -% contract and/or conduct heat. -% -% .. code-block:: matlab -% -% >> r1 = Reactor % an empty reactor -% >> r2 = Reactor(gas) % a reactor containing a phase -% -% See also: :mat:func:`Reservoir`, :mat:func:`IdealGasReactor`, -% :mat:func:`IdealGasConstPressureReactor`, :mat:func:`ConstPressureReactor` -% -% :param contents: -% Instance of class :mat:func:`Solution` representing the contents of the -% reactor -% :param typ: -% Character array, reactor type. Options are: -% -% 'Reservoir' -% 'Reactor' -% 'FlowReactor' -% 'ConstPressureReactor' -% 'IdealGasReactor' -% 'IdealGasConstPressureReactor' -% -% :return: -% Instance of class :mat:func:`Reactor` -% - -if nargin == 0 - contents = 0; - typ = 'Reactor'; -elseif nargin == 1 - typ = 'Reactor'; -elseif nargin > 2 - error('too many arguments'); -end - -x.type = char(typ); -x.index = reactormethods(0, x.type); -if x.index < 0 - error(geterr); -end -x.contents = contents; -x = class(x, 'Reactor'); - -if isa(contents, 'Solution') - insert(x, contents); -elseif ~(isa(contents, 'double') && contents == 0) - error('Reactor contents must be an object of type "Solution"') -end diff --git a/interfaces/matlab/toolbox/@Reactor/clear.m b/interfaces/matlab/toolbox/@Reactor/clear.m deleted file mode 100644 index 08e05bc8d2..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(r) -% CLEAR Clear a reactor from memory. -% clear(r) -% :param f: -% Instance of :mat:func:`Reactor` to be cleared. -% - -reactormethods(1, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/density.m b/interfaces/matlab/toolbox/@Reactor/density.m deleted file mode 100644 index a31b9b4d7f..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/density.m +++ /dev/null @@ -1,10 +0,0 @@ -function rho = density(r) -% DENSITY Get the density of the reactor. -% rho = density(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% Density of the phase in the input. Units: kg/m**3 -% - -rho = reactormethods(25, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/enthalpy_mass.m b/interfaces/matlab/toolbox/@Reactor/enthalpy_mass.m deleted file mode 100644 index e5b7cd1599..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/enthalpy_mass.m +++ /dev/null @@ -1,15 +0,0 @@ -function h = enthalpy_mass(r) -% ENTHALPY_MASS The specific enthalpy of the reactor. -% h = enthalpy_mass(r) -% -% See also: :mat:func:`intEnergy_mass` -% -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The specific enthalpy of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% The enthalpy is retrieved from the solution vector. Units: J/kg -% - -h = reactormethods(27, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/insert.m b/interfaces/matlab/toolbox/@Reactor/insert.m deleted file mode 100644 index 696f199427..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/insert.m +++ /dev/null @@ -1,14 +0,0 @@ -function insert(r, gas) -% INSERT Insert a solution or mixture into a reactor. -% insert(r, gas) -% :param r: -% Instance of class :mat:func:`Reactor` -% :param gas: -% Instance of class :mat:func:`Solution` to be inserted -% - -r.contents = gas; -setThermoMgr(r, gas); -if ~strcmp(r.type, 'Reservoir') - setKineticsMgr(r, gas); -end diff --git a/interfaces/matlab/toolbox/@Reactor/intEnergy_mass.m b/interfaces/matlab/toolbox/@Reactor/intEnergy_mass.m deleted file mode 100644 index bfb35c1923..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/intEnergy_mass.m +++ /dev/null @@ -1,15 +0,0 @@ -function u = intEnergy_mass(r) -% INTENERGY_MASS Get the specific internal energy. -% u = intEnergy_mass(r) -% See also: :mat:func:`enthalpy_mass` -% -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The specific internal energy of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% The internal energy is retrieved from the solution vector. -% Units: J/kg -% - -u = reactormethods(28, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/mass.m b/interfaces/matlab/toolbox/@Reactor/mass.m deleted file mode 100644 index 21b60026a3..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/mass.m +++ /dev/null @@ -1,12 +0,0 @@ -function m = mass(r) -% MASS Get the mass of the reactor. -% m = mass(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The mass of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% The mass is retrieved from the solution vector. Units: kg -% - -m = reactormethods(23, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/massFraction.m b/interfaces/matlab/toolbox/@Reactor/massFraction.m deleted file mode 100644 index 99abb91772..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/massFraction.m +++ /dev/null @@ -1,19 +0,0 @@ -function y = massFraction(r, species) -% MASSFRACTION Get the mass fraction of a species. -% y = massFraction(r, species) -% :param r: -% Instance of class :mat:func:`Reactor` -% :param species: -% String or the one-based integer index of the species -% :return: -% The mass fraction of the specifed species in the reactor at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% - -if ischar(species) - k = speciesIndex(r.contents, species) - 1; -else - k = species - 1; -end - -y = reactormethods(30, reactor_hndl(r), k); diff --git a/interfaces/matlab/toolbox/@Reactor/massFractions.m b/interfaces/matlab/toolbox/@Reactor/massFractions.m deleted file mode 100644 index b550819d1c..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/massFractions.m +++ /dev/null @@ -1,16 +0,0 @@ -function y = massFractions(r) -% MASSFRACTIONS Get the mass fractions of the species. -% y = massFractions(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The mass fractions of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% - -nsp = nSpecies(r.contents); -ir = reactor_hndl(r); -y = zeros(1, nsp); -for k = 1:nsp - y(k) = reactormethods(30, ir, k-1); -end diff --git a/interfaces/matlab/toolbox/@Reactor/pressure.m b/interfaces/matlab/toolbox/@Reactor/pressure.m deleted file mode 100644 index d7e021fb4b..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/pressure.m +++ /dev/null @@ -1,12 +0,0 @@ -function p = pressure(r) -% PRESSURE Get the pressure of the reactor. -% p = pressure(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The pressure of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% Units: Pa -% - -p = reactormethods(29, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/private/reactormethods.m b/interfaces/matlab/toolbox/@Reactor/private/reactormethods.m deleted file mode 100644 index 4fa794e6d3..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/private/reactormethods.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = reactormethods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(60, n, job); -elseif nargin == 3 - v = ctmethods(60, n, job, a); -elseif nargin == 4 - v = ctmethods(60, n, job, a, b); -elseif nargin == 5 - v = ctmethods(60, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(60, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@Reactor/reactor_hndl.m b/interfaces/matlab/toolbox/@Reactor/reactor_hndl.m deleted file mode 100644 index 5b3b9a5cb9..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/reactor_hndl.m +++ /dev/null @@ -1,11 +0,0 @@ -function i = reactor_hndl(r) -% REACTOR_HNDL Get the integer used to access the kernel object. -% i = reactor_hndl(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% for which the handle is desired. -% :return: -% Integer used to access the kernel object -% - -i = r.index; diff --git a/interfaces/matlab/toolbox/@Reactor/setChemistry.m b/interfaces/matlab/toolbox/@Reactor/setChemistry.m deleted file mode 100644 index 3fb14062ed..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/setChemistry.m +++ /dev/null @@ -1,29 +0,0 @@ -function setChemistry(r, flag) -% SETCHEMISTRY Enable or disable changing reactor composition by reactions. -% setChemistry(r, flag) -% If the chemistry is disabled, then the reactor composition is -% constant. The parameter should be the string ``'on'`` to enable the -% species equations, or ``'off'`` to disable it. -% -% By default, Reactor objects are created with the species equations -% enabled if there are reactions present in the mechanism file, and -% disabled otherwise. :: -% -% >> setChemistry(r, 'on'); -% >> setChemistry(r, 'off'); -% -% :param r: -% Instance of class :mat:func:`Reactor` -% :param flag: -% String, either ``'on'`` or ``'off'`` to enable and disable -% solving the energy equation, respectively -% - -if strcmp(flag, {'on'}) - iflag = true; -elseif strcmp(flag, {'off'}) - iflag = false; -else - error('Input to setChemistry not understood. It must be either "on" or "off".'); -end -reactormethods(8, r.index, iflag); diff --git a/interfaces/matlab/toolbox/@Reactor/setEnergy.m b/interfaces/matlab/toolbox/@Reactor/setEnergy.m deleted file mode 100644 index e42a7229de..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/setEnergy.m +++ /dev/null @@ -1,32 +0,0 @@ -function setEnergy(r, flag) -% SETENERGY Enable or disable solving the energy equation. -% setEnergy(r, flag) -% If the energy equation is disabled, then the reactor temperature is -% constant. The parameter should be the string ``'on'`` to enable the -% energy equation, or ``'off'`` to disable it. -% -% By default, Reactor objects are created with the energy equation -% enabled, so usually this method is only needed to disable the -% energy equation for isothermal simulations. :: -% -% >> setEnergy(r, 'on'); -% >> setEnergy(r, 'off'); -% -% :param r: -% Instance of class :mat:func:`Reactor` -% :param flag: -% String, either ``'on'`` or ``'off'`` to enable and disable -% solving the energy equation, respectively -% - -iflag = -1; -if strcmp(flag, {'on'}) - iflag = 1; -elseif strcmp(flag, {'off'}) - iflag = 0; -end -if iflag >= 0 - reactormethods(9, r.index, iflag); -else - error('Input to setEnergy not understood.'); -end diff --git a/interfaces/matlab/toolbox/@Reactor/setInitialVolume.m b/interfaces/matlab/toolbox/@Reactor/setInitialVolume.m deleted file mode 100644 index d3df862586..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/setInitialVolume.m +++ /dev/null @@ -1,10 +0,0 @@ -function setInitialVolume(r, v0) -% SETINITIALVOLUME Set the initial reactor volume. -% setInitialVolume(r, v0) -% :param r: -% Instance of class :mat:func:`Reactor` -% :param v0: -% Initial volume. Units: m**3 -% - -reactormethods(4, reactor_hndl(r), v0); diff --git a/interfaces/matlab/toolbox/@Reactor/setKineticsMgr.m b/interfaces/matlab/toolbox/@Reactor/setKineticsMgr.m deleted file mode 100644 index d74a814a04..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/setKineticsMgr.m +++ /dev/null @@ -1,18 +0,0 @@ -function setKineticsMgr(r, k) -% SETKINETICSMGR Set the kinetics manager. -% setKineticsMgr(r, k) -% This method is used internally during Reactor initialization, but -% is usually not called by users. -% -% :param r: -% Instance of class :mat:func:`Reactor` -% :param k: -% Instance of class :mat:func:`Kinetics`, or another object -% containing an instance of that class. -% - -if ~isa(k, 'Kinetics') - error('Wrong object type.'); -end - -reactormethods(7, reactor_hndl(r), kinetics_hndl(k)); diff --git a/interfaces/matlab/toolbox/@Reactor/setMassFlowRate.m b/interfaces/matlab/toolbox/@Reactor/setMassFlowRate.m deleted file mode 100644 index 83bd52c167..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/setMassFlowRate.m +++ /dev/null @@ -1,10 +0,0 @@ -function setMassFlowRate(r, mdot) -% SETMASSFLOWRATE Set the mass flow rate. -% setMassFlowRate(r, mdot) -% :param r: -% Instance of class :mat:func:`Reactor` -% :param mdot: -% Mass flow rate. Units: kg/s -% - -reactormethods(10, reactor_hndl(r), mdot); diff --git a/interfaces/matlab/toolbox/@Reactor/setThermoMgr.m b/interfaces/matlab/toolbox/@Reactor/setThermoMgr.m deleted file mode 100644 index b6f7e4d777..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/setThermoMgr.m +++ /dev/null @@ -1,18 +0,0 @@ -function setThermoMgr(r, t) -% SETTHERMOMGR Set the thermodynamics manager. -% setThermoMgr(r, t) -% This method is used internally during Reactor initialization, but -% is usually not called by users. -% -% :param r: -% Instance of class :mat:func:`Reactor` -% :param t: -% Instance of class :mat:func:`ThermoPhase`, or another object -% containing an instance of that class. -% - -if ~isa(t,'ThermoPhase') - error('wrong object type'); -end - -reactormethods(6, reactor_hndl(r), thermo_hndl(t)); diff --git a/interfaces/matlab/toolbox/@Reactor/temperature.m b/interfaces/matlab/toolbox/@Reactor/temperature.m deleted file mode 100644 index 9071415f4a..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/temperature.m +++ /dev/null @@ -1,12 +0,0 @@ -function t = temperature(r) -% TEMPERATURE Get the temperature of the reactor. -% t = temperature(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The temperature of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% Units: K -% - -t = reactormethods(26, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@Reactor/volume.m b/interfaces/matlab/toolbox/@Reactor/volume.m deleted file mode 100644 index a7b5c308e3..0000000000 --- a/interfaces/matlab/toolbox/@Reactor/volume.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = volume(r) -% VOLUME Get the volume of the reactor. -% v = volume(r) -% :param r: -% Instance of class :mat:func:`Reactor` -% :return: -% The volume of the reactor contents at the -% end of the last call to :mat:func:`advance` or :mat:func:`step`. -% Units: m**3 -% - -v = reactormethods(24, reactor_hndl(r)); diff --git a/interfaces/matlab/toolbox/@ReactorNet/ReactorNet.m b/interfaces/matlab/toolbox/@ReactorNet/ReactorNet.m deleted file mode 100644 index 1f4ee65420..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/ReactorNet.m +++ /dev/null @@ -1,46 +0,0 @@ -function x = ReactorNet(reactors) -% REACTORNET ReactorNet class constructor. -% x = ReactorNet(reactors) -% A :mat:func:`ReactorNet` object is a container that holds one -% or more :mat:func:`Reactor` objects in a network. :mat:func:`ReactorNet` -% objects are used to simultaneously advance the state of one or -% more coupled reactors. -% -% Example:: -% -% >> r1 = Reactor(gas1) -% >> r2 = Reactor(gas2) -% >> <... install walls, inlets, outlets, etc...> -% -% >> reactor_network = ReactorNet({r1, r2}) -% >> advance(reactor_network, time) -% -% See also: :mat:func:`Reactor` -% -% :param reactors: -% A single instance of :mat:func:`Reactor` or a cell array -% of instances of :mat:func:`Reactor` -% :return: -% Instance of class :mat:func:`ReactorNet` -% - -if nargin ~= 1 - error('Wrong number of arguments to ReactorNet constructor.'); -end - -if isa(reactors, 'Reactor') - % Allow simpler syntax for creating a network with one reactor - reactors = {reactors}; -end - -x.index = reactornetmethods(0, 0); -if x.index < 0 - error(geterr); -end -x = class(x, 'ReactorNet'); - -% add reactors -nr = length(reactors); -for i = 1:nr - addReactor(x, reactors{i}); -end diff --git a/interfaces/matlab/toolbox/@ReactorNet/addReactor.m b/interfaces/matlab/toolbox/@ReactorNet/addReactor.m deleted file mode 100644 index 1ab2078adb..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/addReactor.m +++ /dev/null @@ -1,10 +0,0 @@ -function addReactor(net, reactor) -% ADDREACTOR Add a reactor to a network. -% addReactor(net, reactor) -% :param net: -% Instance of class :mat:func:`ReactorNet` -% :param reactor: -% Instance of class :mat:func:`Reactor` -% - -reactornetmethods(4, reactornet_hndl(net), reactor_hndl(reactor)); diff --git a/interfaces/matlab/toolbox/@ReactorNet/advance.m b/interfaces/matlab/toolbox/@ReactorNet/advance.m deleted file mode 100644 index cf51b334ed..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/advance.m +++ /dev/null @@ -1,31 +0,0 @@ -function advance(n, tout) -% ADVANCE Advance the state of the reactor network in time. -% advance(n, tout) -% Method :mat:func:`advance` integrates the system of ordinary differential -% equations that determine the rate of change of the volume, the -% mass of each species, and the total energy for each reactor. The -% integration is carried out from the current time to time -% ``tout``. (Note ``tout`` is an absolute time, not a time interval.) -% The integrator may take many internal time steps before reaching -% tout. -% -% .. code-block:: matlab -% -% for i in 1:10 -% tout = 0.1*i -% advance(n, tout) -% ... -% -% ... -% end -% -% See also: :mat:func:`step` -% -% :param n: -% Instance of class :mat:func:`ReactorNet` -% :param tout: -% End time of the integration. The solver may take many internal -% time steps to reach ``tout``. -% - -reactornetmethods(8, reactornet_hndl(n), tout); diff --git a/interfaces/matlab/toolbox/@ReactorNet/atol.m b/interfaces/matlab/toolbox/@ReactorNet/atol.m deleted file mode 100644 index e995cd30bb..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/atol.m +++ /dev/null @@ -1,11 +0,0 @@ -function t = atol(r) -% ATOL Get the absolute error tolerance. -% t = atol(r) -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :return: -% Absolute error tolerance. -% - -t = reactornetmethods(24, reactornet_hndl(r)); - diff --git a/interfaces/matlab/toolbox/@ReactorNet/clear.m b/interfaces/matlab/toolbox/@ReactorNet/clear.m deleted file mode 100644 index a043a97731..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(n) -% CLEAR Delete the C++ ReactorNet object. -% clear(n) -% :param n: -% Instance of class :mat:func:`ReactorNet` -% - -reactornetmethods(1, n.index); diff --git a/interfaces/matlab/toolbox/@ReactorNet/private/reactornetmethods.m b/interfaces/matlab/toolbox/@ReactorNet/private/reactornetmethods.m deleted file mode 100644 index 241fb726dd..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/private/reactornetmethods.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = reactornetmethods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(65, n, job); -elseif nargin == 3 - v = ctmethods(65, n, job, a); -elseif nargin == 4 - v = ctmethods(65, n, job, a, b); -elseif nargin == 5 - v = ctmethods(65, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(65, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@ReactorNet/reactornet_hndl.m b/interfaces/matlab/toolbox/@ReactorNet/reactornet_hndl.m deleted file mode 100644 index 00206c0163..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/reactornet_hndl.m +++ /dev/null @@ -1,11 +0,0 @@ -function i = reactornet_hndl(r) -% REACTORNET_HNDL Get the integer used to access the kernel object. -% i = reactornet_hndl(r) -% :param r: -% Instance of class :mat:func:`ReactorNet` -% for which the handle is desired. -% :return: -% Integer used to access the kernel object. -% - -i = r.index; diff --git a/interfaces/matlab/toolbox/@ReactorNet/rtol.m b/interfaces/matlab/toolbox/@ReactorNet/rtol.m deleted file mode 100644 index 9478ddfe72..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/rtol.m +++ /dev/null @@ -1,10 +0,0 @@ -function t = rtol(r) -% RTOL Get the relative error tolerance. -% t = rtol(r) -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :return: -% Relative error tolerance. -% - -t = reactornetmethods(23, reactornet_hndl(r)); diff --git a/interfaces/matlab/toolbox/@ReactorNet/setInitialTime.m b/interfaces/matlab/toolbox/@ReactorNet/setInitialTime.m deleted file mode 100644 index 414a5a3980..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/setInitialTime.m +++ /dev/null @@ -1,15 +0,0 @@ -function setInitialTime(r, t) -% SETINITIALTIME Set the initial time of the integration. -% setInitialTime(r, t) -% If the time integration has already begun, this restarts the -% integrator using the current solution as the initial condition, -% setting the time to ``t``. -% -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :param t: -% Time at which integration should be restarted, using the -% current state as the initial condition. Units: s -% - -reactornetmethods(5, reactornet_hndl(r), t); diff --git a/interfaces/matlab/toolbox/@ReactorNet/setMaxTimeStep.m b/interfaces/matlab/toolbox/@ReactorNet/setMaxTimeStep.m deleted file mode 100644 index 3f6d23dd41..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/setMaxTimeStep.m +++ /dev/null @@ -1,18 +0,0 @@ -function setMaxTimeStep(r, maxstep) -% SETMAXTIMESTEP Set the maximum time step. -% setMaxTimeStep(r, maxstep) -% The integrator chooses a step size based on the desired error -% tolerances and the rate at which the solution is changing. In -% some cases, the solution changes very slowly at first, then very -% rapidly (ignition problems). In such cases, the integrator may -% choose a timestep that is too large, which leads to numerical -% problems later. Use this method to set an upper bound on the -% timestep. -% -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :param maxstep: -% Maximum time step -% - -reactornetmethods(6, reactornet_hndl(r), maxstep); diff --git a/interfaces/matlab/toolbox/@ReactorNet/setTolerances.m b/interfaces/matlab/toolbox/@ReactorNet/setTolerances.m deleted file mode 100644 index d3e866d1c6..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/setTolerances.m +++ /dev/null @@ -1,12 +0,0 @@ -function setTolerances(r, rtol, atol) -% SETTOLERANCES Set the error tolerances. -% setTolerances(r, rtol, atol) -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :param rtol: -% Scalar relative error tolerance -% :param atol: -% Scalar absolute error tolerance -% - -reactornetmethods(7, reactornet_hndl(r), rtol, atol); diff --git a/interfaces/matlab/toolbox/@ReactorNet/step.m b/interfaces/matlab/toolbox/@ReactorNet/step.m deleted file mode 100644 index 8e53afbc65..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/step.m +++ /dev/null @@ -1,36 +0,0 @@ -function t = step(r) -% STEP Take one internal time step. -% t = step(r) -% The integrator used to integrate the ODEs (CVODE) takes -% variable-size steps, chosen so that a specified error -% tolerance is maintained. At times when the solution is rapidly -% changing, the time step becomes smaller to resolve the -% solution. -% -% Method :mat:func:`step` takes one internal time step and returns -% the network time after taking that step. This -% can be useful when it is desired to resolve a rapidly-changing -% solution. -% -% This method can be used as follows: -% -% .. code-block:: matlab -% -% t = 0.0 -% tout = 0.1 -% while t < tout -% t = step(r) -% ,,, -% -% ... -% end -% -% See also: :mat:func:`advance` -% -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :return: -% Network time after the internal time step. Units: s -% - -t = reactornetmethods(21, reactornet_hndl(r)); diff --git a/interfaces/matlab/toolbox/@ReactorNet/time.m b/interfaces/matlab/toolbox/@ReactorNet/time.m deleted file mode 100644 index 41e9896d93..0000000000 --- a/interfaces/matlab/toolbox/@ReactorNet/time.m +++ /dev/null @@ -1,10 +0,0 @@ -function t = time(r) -% TIME Get the current value of the time. -% t = time(r) -% :param r: -% Instance of class :mat:func:`ReactorNet` -% :return: -% Current time in the input ReactorNet. Units: s -% - -t = reactornetmethods(22, reactornet_hndl(r)); diff --git a/interfaces/matlab/toolbox/@ReactorSurface/ReactorSurface.m b/interfaces/matlab/toolbox/@ReactorSurface/ReactorSurface.m deleted file mode 100644 index 2e70683e9c..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/ReactorSurface.m +++ /dev/null @@ -1,55 +0,0 @@ -function x = ReactorSurface(kinetics, reactor, area) -% REACTORSURFACE ReactorSurface class constructor. -% x = ReactorSurface(kinetics, reactor, area) -% -% A surface on which heterogeneous reactions take place. The mechanism object -% (typically an instance of class :mat:func:`Interface`) must be constructed so -% that it is properly linked to the object representing the fluid in the -% reactor. The surface temperature on each side is taken to be equal to the -% temperature of the reactor. -% -% Note: all of the arguments are optional and can be activated after initial -% construction by using the various methods of the :mat:func:`ReactorSurface` -% class. -% -% :param kleft: -% Surface reaction mechanisms for the left-facing surface. This must be an -% instance of class :mat:func:`Kinetics`, or of a class derived from Kinetics, -% such as :mat:func:`Interface`. -% :param reactor: -% Instance of class :mat:func:`Reactor` to be used as the adjacent bulk -% phase. See :mat:func:`install` -% :param area: -% The area of the surface in m**2. See :mat:func:`area` and -% :mat:func:`setArea`. Defaults to 1.0 m**2 if not specified. -% :return: -% Instance of class :mat:func:`ReactorSurface` - -x.index = reactorsurfacemethods(0, 0); - -if x.index < 0 - error(geterr); -end -x.reactor = -1; -x = class(x, 'ReactorSurface'); - -if nargin >= 1 - setKinetics(x, kinetics); -end - -if nargin >= 2 - if isa(reactor, 'Reactor') - install(x, reactor); - else - warning(['"reactor" was not an instance of Reactor, ' ... - 'and was not installed.']) - end -end - -if nargin >= 3 - if isnumeric(area) - setArea(x, area); - else - warning('area was not a number and the area was not set') - end -end diff --git a/interfaces/matlab/toolbox/@ReactorSurface/area.m b/interfaces/matlab/toolbox/@ReactorSurface/area.m deleted file mode 100644 index 2d2ff14501..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/area.m +++ /dev/null @@ -1,10 +0,0 @@ -function a = area(s) -% AREA Get the area of the reactor surface. -% a = area(s) -% :param s: -% Instance of class :mat:func:`ReactorSurface` -% :return: -% Area of the reactor surface in m**2 -% - -a = reactorsurfacemethods(23, reactorsurface_hndl(s)); diff --git a/interfaces/matlab/toolbox/@ReactorSurface/clear.m b/interfaces/matlab/toolbox/@ReactorSurface/clear.m deleted file mode 100644 index 9ffaa2f097..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(s) -% CLEAR Delete the C++ ReactorSurface object. -% clear(s) -% :param s: -% Instance of class :mat:func:`ReactorSurface` -% - -reactorsurfacemethods(1, reactorsurface_hndl(s)); diff --git a/interfaces/matlab/toolbox/@ReactorSurface/install.m b/interfaces/matlab/toolbox/@ReactorSurface/install.m deleted file mode 100644 index 8e1d4a3bed..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/install.m +++ /dev/null @@ -1,11 +0,0 @@ -function install(s, reactor) -% INSTALL Install a ReactorSurface in a Reactor. -% install(s, reactor) -% :param s: -% Instance of class :mat:func:`ReactorSurface` -% :param reactor: -% Instance of class :mat:func:`Reactor` -% - -s.reactor = reactor; -reactorsurfacemethods(4, reactorsurface_hndl(s), reactor_hndl(reactor)); diff --git a/interfaces/matlab/toolbox/@ReactorSurface/private/reactorsurfacemethods.m b/interfaces/matlab/toolbox/@ReactorSurface/private/reactorsurfacemethods.m deleted file mode 100644 index 3050a6fff1..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/private/reactorsurfacemethods.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = reactorsurfacemethods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(75, n, job); -elseif nargin == 3 - v = ctmethods(75, n, job, a); -elseif nargin == 4 - v = ctmethods(75, n, job, a, b); -elseif nargin == 5 - v = ctmethods(75, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(75, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@ReactorSurface/reactorsurface_hndl.m b/interfaces/matlab/toolbox/@ReactorSurface/reactorsurface_hndl.m deleted file mode 100644 index e03264040b..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/reactorsurface_hndl.m +++ /dev/null @@ -1,11 +0,0 @@ -function i = reactorsurface_hndl(s) -% REACTORSURFACE_HNDL Get the integer used to access the Cantera C++ object. -% i = reactorsurf_hndl(s) -% :param s: -% Instance of class :mat:func:`ReactorSurface` for which the handle is -% desired. -% :return: -% Integer used to access the Cantera C++ object -% - -i = s.index; diff --git a/interfaces/matlab/toolbox/@ReactorSurface/setArea.m b/interfaces/matlab/toolbox/@ReactorSurface/setArea.m deleted file mode 100644 index 1943754cf2..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/setArea.m +++ /dev/null @@ -1,10 +0,0 @@ -function setArea(s, a) -% SETAREA Set the area of a reactor surface. -% setArea(s, a) -% :param s: -% Instance of class :mat:func:`ReactorSurface` -% :param a: -% Double area of the reactor surface. -% - -reactorsurfacemethods(5, reactorsurface_hndl(s), a); diff --git a/interfaces/matlab/toolbox/@ReactorSurface/setKinetics.m b/interfaces/matlab/toolbox/@ReactorSurface/setKinetics.m deleted file mode 100644 index b765f685e1..0000000000 --- a/interfaces/matlab/toolbox/@ReactorSurface/setKinetics.m +++ /dev/null @@ -1,17 +0,0 @@ -function setKinetics(s, kinetics) -% SETKINETICS Set the surface reaction mechanisms on a reactor surface. -% setKinetics(w, kinetics) -% :param s: -% Instance of class :mat:func:`ReactorSurface` -% :param kinetics: -% Instance of class :mat:func:`Kinetics` (or another object derived from -% Kinetics) to be used as the kinetic mechanism for this surface. Typically -% an instance of class :mat:func:`Interface`. -% - -ikin = 0; -if isa(kinetics, 'Kinetics') - ikin = kinetics_hndl(kinetics); -end - -reactorsurfacemethods(12, reactorsurface_hndl(s), ikin); diff --git a/interfaces/matlab/toolbox/@Solution/Solution.m b/interfaces/matlab/toolbox/@Solution/Solution.m deleted file mode 100644 index 45bbcb5e0a..0000000000 --- a/interfaces/matlab/toolbox/@Solution/Solution.m +++ /dev/null @@ -1,60 +0,0 @@ -function s = Solution(src, id, trans) -% SOLUTION Solution class constructor. -% s = Solution(src, id, trans) -% Class :mat:func:`Solution` represents solutions of multiple species. A -% solution is defined as a mixture of two or more constituents -% (species) that are completely mixed on molecular length -% scales. The macroscopic intensive thermodynamic state of a -% solution is specified by two thermodynamic properties (for -% example, the temperature and pressure), and the relative amounts -% of each species, which may be given as mole fractions or mass -% fractions. :: -% -% >> s = Solution('input.yaml'[, phase_name[, transport_model]]) -% -% constructs a :mat:func:`Solution` object from a specification contained in -% file ``input.yaml``. Optionally, the name of the phase to be imported -% can be specified with ``phase_name``. If a :mat:func:`Transport` model is -% included in ``input.yaml``, it will be included in the :mat:func:`Solution` -% instance with the default transport modeling as set -% in the input file. To specify the transport modeling, set the input -% argument ``trans`` to one of ``'default'``, ``'none'``, or specific transport model -% such as ``'mixture-averaged'`` or ``'multicomponent'``. -% In this case, the phase name must be specified as well. Alternatively, -% change the ``transport`` field in the YAML file before loading the phase. The -% transport modeling cannot be changed once the phase is loaded. -% -% Class :mat:func:`Solution` derives from three more basic classes, and most of -% its methods are inherited from these classes. These are: -% -% * class :mat:func:`ThermoPhase` - composition information and thermodynamic properties -% * class :mat:func:`Kinetics` - homogeneous kinetics -% * class :mat:func:`Transport` - transport properties -% -% See also: :mat:func:`ThermoPhase`, :mat:func:`Kinetics`, :mat:func:`Transport` -% -% :param src: -% Input string of YAML file name. -% :param id: -% Optional unless ``trans`` is specified. Name of the phase to -% import as specified in the YAML file. -% :param trans: -% String, transport modeling. Possible values are ``'default'``, ``'none'``, -% or a specific transport model name. If not specified, ``'default'`` is used. -% :return: -% Instance of class :mat:func:`Solution` -% -if nargin == 1 - id = '-'; -end -t = ThermoPhase(src, id); -k = Kinetics(t, src, id); -s.kin = k; -s.th = t; -if nargin == 3 - tr = Transport(t, trans, 0); -else - tr = Transport(t, 'default', 0); -end -s.tr = tr; -s = class(s, 'Solution', t, k, tr); diff --git a/interfaces/matlab/toolbox/@Solution/clear.m b/interfaces/matlab/toolbox/@Solution/clear.m deleted file mode 100644 index 65c4e8aeeb..0000000000 --- a/interfaces/matlab/toolbox/@Solution/clear.m +++ /dev/null @@ -1,11 +0,0 @@ -function clear(s) -% CLEAR Delete the kernel objects associated with a Solution. -% clear(s) -% :param s: -% Instance of class :mat:func:`Solution` -% - -clear(s.th); -clear(s.kin); -disp('Solution.clear: skipping clearing the transport object... check this!') -%clear(s.tr); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m b/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m deleted file mode 100644 index 9779790f50..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m +++ /dev/null @@ -1,25 +0,0 @@ -function t = ThermoPhase(src, id) -% THERMOPHASE ThermoPhase class constructor. -% t = ThermoPhase(src, id) -% :param src: -% Input string of YAML file name. -% :param id: -% ID of the phase to import as specified in the input file. (optional) -% :return: -% Instance of class :mat:func:`ThermoPhase` -% - -if nargin > 2 - error('ThermoPhase expects 1 or 2 input arguments.'); -end - -if nargin == 1 - id = '-'; -end - -t.owner = 1; -t.tp_id = thermo_get(0, 0, src, id); -if t.tp_id < 0 - error(geterr); -end -t = class(t, 'ThermoPhase'); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/atomicMasses.m b/interfaces/matlab/toolbox/@ThermoPhase/atomicMasses.m deleted file mode 100644 index 10d7a0dc09..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/atomicMasses.m +++ /dev/null @@ -1,11 +0,0 @@ -function x = atomicMasses(tp) -% ATOMICMASSES Get the atomic masses of the elements. -% x = atomicMasses(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase). -% :return: -% Vector of element atomic masses. Units: kg/kmol -% - -x = phase_get(tp.tp_id, 30); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/charges.m b/interfaces/matlab/toolbox/@ThermoPhase/charges.m deleted file mode 100644 index d2ee065522..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/charges.m +++ /dev/null @@ -1,12 +0,0 @@ -function ch = charges(tp) -% CHARGES Get the array of species charges -% x = speciesCharges(tp) -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of species charges. Units: elem. charge -% - -ch = phase_get(tp.tp_id, 23); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/chemPotentials.m b/interfaces/matlab/toolbox/@ThermoPhase/chemPotentials.m deleted file mode 100644 index 2893a05d58..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/chemPotentials.m +++ /dev/null @@ -1,20 +0,0 @@ -function mu = chemPotentials(tp) -% CHEMPOTENTIALS Get the chemical potentials of the species. -% mu = chemPotentials(tp) -% The expressions used to compute the chemical potential -% depend on the model implemented by the underlying kernel -% thermo manager. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase). -% :return: -% Vector of species chemical potentials. Units: J/kmol -% -% This method returns an array containing the species -% chemical potentials [J/kmol]. The expressions used to -% compute these depend on the model implemented by the -% underlying kernel thermo manager.""" - -mu = thermo_get(tp.tp_id, 34); - diff --git a/interfaces/matlab/toolbox/@ThermoPhase/clear.m b/interfaces/matlab/toolbox/@ThermoPhase/clear.m deleted file mode 100644 index 239646f31f..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/clear.m +++ /dev/null @@ -1,10 +0,0 @@ -function clear(tp) -% CLEAR Delete the kernel object. -% clear(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% - -thermo_set(tp.tp_id, 10, 0); - diff --git a/interfaces/matlab/toolbox/@ThermoPhase/cp_R.m b/interfaces/matlab/toolbox/@ThermoPhase/cp_R.m deleted file mode 100644 index 9b51b5eddc..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/cp_R.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = cp_R(tp) -% CP_R Get the non-dimensional specific heats at constant pressure. -% v = cp_R(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of specific heats of the species at -% constant pressure, non-dimensional basis -% - -v = thermo_get(tp.tp_id, 38); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/cp_mass.m b/interfaces/matlab/toolbox/@ThermoPhase/cp_mass.m deleted file mode 100644 index 9443870cae..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/cp_mass.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = cp_mass(tp) -% CP_MASS Get the mass-basis specific heat at constant pressure. -% v = cp_mass(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass basis specific heat of the mixture at -% constant pressure. Units: J/kg-K -% - -v = thermo_get(tp.tp_id, 13); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/cp_mole.m b/interfaces/matlab/toolbox/@ThermoPhase/cp_mole.m deleted file mode 100644 index bc0efe5144..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/cp_mole.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = cp_mole(tp) -% CP_MOLE Get the molar-basis specific heat at constant pressure. -% v = cp_mole(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar basis specific heat of the mixture at -% constant pressure. Units: J/kmol-K -% - -v = thermo_get(tp.tp_id, 6); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/critDensity.m b/interfaces/matlab/toolbox/@ThermoPhase/critDensity.m deleted file mode 100644 index 3c91208e1e..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/critDensity.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = critDensity(tp) -% CRITDENSITY Get the critical density. -% v = critDensity(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Critical density. Units: kg/m**3 -% - -v = thermo_get(tp.tp_id, 21); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/critPressure.m b/interfaces/matlab/toolbox/@ThermoPhase/critPressure.m deleted file mode 100644 index 1e07894c7b..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/critPressure.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = critPressure(tp) -% CRITPRESSURE Get the critical pressure. -% v = critPressure(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Critical pressure. Units: Pa -% - -v = thermo_get(tp.tp_id, 20); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/critTemperature.m b/interfaces/matlab/toolbox/@ThermoPhase/critTemperature.m deleted file mode 100644 index 17be99a7bb..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/critTemperature.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = critTemperature(tp) -% CRITTEMPERATURE Get the critical temperature. -% v = critTemperature(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Critical temperature. Units: K -% - -v = thermo_get(tp.tp_id, 19); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/cv_mass.m b/interfaces/matlab/toolbox/@ThermoPhase/cv_mass.m deleted file mode 100644 index 978b3f9f63..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/cv_mass.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = cv_mass(tp) -% CV_MASS Get the mass-basis specific heat at constant volume. -% v = cv_mass(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass basis specific heat of the mixture at -% constant volume. Units: J/kg-K -% - -v = thermo_get(tp.tp_id, 14); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/cv_mole.m b/interfaces/matlab/toolbox/@ThermoPhase/cv_mole.m deleted file mode 100644 index 9663e7a53e..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/cv_mole.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = cv_mole(tp) -% CV_MOLE Get the molar-basis specific heat at constant volume. -% v = cv_mole(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar basis specific heat of the mixture at -% constant volume. Units: J/kmol-K -% - -v = thermo_get(tp.tp_id, 7); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/density.m b/interfaces/matlab/toolbox/@ThermoPhase/density.m deleted file mode 100644 index f7ed17117e..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/density.m +++ /dev/null @@ -1,11 +0,0 @@ -function rho = density(tp) -% DENSITY Get the density. -% rho = density(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass density. Units: kg/m**3 -% - -rho = phase_get(tp.tp_id, 2); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/display.m b/interfaces/matlab/toolbox/@ThermoPhase/display.m deleted file mode 100644 index 414fc6bc67..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/display.m +++ /dev/null @@ -1,5 +0,0 @@ -function display(self, threshold) -if nargin < 2 || ~isnumeric(threshold) - threshold = 1e-14; -end -phase_get(thermo_hndl(self), 15, 1, threshold); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/electricPotential.m b/interfaces/matlab/toolbox/@ThermoPhase/electricPotential.m deleted file mode 100644 index ec5788de1c..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/electricPotential.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = electricPotential(tp) -% ELECTRICPOTENTIAL Get the electric potential. -% v = electricPotential(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% The electric potential of the phase. Units: V -% - -v = thermo_get(tp.tp_id, 25); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/elementIndex.m b/interfaces/matlab/toolbox/@ThermoPhase/elementIndex.m deleted file mode 100644 index 60416550bb..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/elementIndex.m +++ /dev/null @@ -1,39 +0,0 @@ -function k = elementIndex(tp, name) -% ELEMENTINDEX Get the index of an element given its name. -% k = elementIndex(tp,name) -% The index is an integer assigned to each element in sequence as it -% is read in from the input file. -% -% If ``name`` is a single string, the return value will be a integer -% containing the corresponding index. If it is an cell array of -% strings, the output will be an array of the same shape -% containing the indices. -% -% NOTE: In keeping with the conventions used by Matlab, this method -% returns 1 for the first element. In contrast, the corresponding -% method elementIndex in the Cantera C++ and Python interfaces -% returns 0 for the first element, 1 for the second one, etc. :: -% -% >> ic = elementIndex(gas, 'C'); -% >> ih = elementIndex(gas, 'H'); -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param name: -% String or cell array of strings of elements to look up -% :return: -% Integer or vector of integers of element indices -% - -if iscell(name) - [m, n] = size(name); - k = zeros(m, n); - for i = 1:m - for j = 1:n - k(i,j) = phase_get(tp.tp_id, 13, name{i,j}); - end - end -else - k = phase_get(tp.tp_id, 13, name); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/elementName.m b/interfaces/matlab/toolbox/@ThermoPhase/elementName.m deleted file mode 100644 index b207f45b91..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/elementName.m +++ /dev/null @@ -1,22 +0,0 @@ -function nm = elementName(tp, m) -% ELEMENTNAME Get the name of an element given its index. -% nm = elementName(tp, m) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param m: -% Scalar or vector of integers of element indices -% :return: -% If m is a scalar integer, the return value will be a string -% containing the name of the m^th species. If it is an array of -% integers, the output will be a cell array of -% the same shape containing the name strings. -% - -[mm, nn] = size(m); -nm = cell(mm,nn); -for i = 1:mm - for j = 1:nn - nm{i,j} = phase_get(tp.tp_id, 41, m(i,j)); - end -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/elementalMassFraction.m b/interfaces/matlab/toolbox/@ThermoPhase/elementalMassFraction.m deleted file mode 100644 index a2ecbabb29..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/elementalMassFraction.m +++ /dev/null @@ -1,51 +0,0 @@ -function elMassFrac = elementalMassFraction(tp, element) -% ELEMENTALMASSFRACTION Determine the elemental mass fraction in gas object. -% elMassFrac = elementalMassFraction(tp, element) -% :param tp: -% Object representing the gas, instance of class :mat:func:`Solution`, -% and an ideal gas. The state of this object should be set to an -% estimate of the gas state before calling elementalMassFraction. -% :param element: -% String representing the element name. -% :return: -% Elemental mass fraction within a gas object. -% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Check input parameters -% - -if nargin ~= 2 - error('elementalMassFraction expects two input arguments.'); -end -if ~isIdealGas(tp) - error('Gas object must represent an ideal gas mixture.'); -end -if ~ischar(element) - error('Element name must be of format character.'); -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Calculate the elemental mass fraction in a gas object. Equation used is -% elMassFrac = sum of nAtoms(k,m)*Mel(m)*Y(k)/mw(k) where nAtoms(k,m) is -% the number of atoms of element, m, in species, k; Mel(m) is the atomic -% weight of the element, m; Y(k) is the mass fraction of species,k, in the -% gas object; and mw(k) is the molecular weight of species, k. -% - -n = nSpecies(tp); -massFrac = massFractions(tp); -spec = speciesNames(tp); -eli = elementIndex(tp, element); -M = atomicMasses(tp); -Mel = M(eli); -MW = molecularWeights(tp); -% Initialize the element mass fraction as zero. -elMassFrac = 0.0; -% Use loop to perform summation of elemental mass fraction over all species. -for i = 1:n - natoms(i) = nAtoms(tp,spec{i},element); - mw(i) = MW(i); - Y(i) = massFraction(tp,spec{i}); - elMassFrac = elMassFrac + (natoms(i)*Mel*Y(i))/mw(i); -end -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/enthalpies_RT.m b/interfaces/matlab/toolbox/@ThermoPhase/enthalpies_RT.m deleted file mode 100644 index 49e40cee7d..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/enthalpies_RT.m +++ /dev/null @@ -1,14 +0,0 @@ -function v = enthalpies_RT(tp) -% ENTHALPIES_RT Get the non-dimensional enthalpies. -% v = enthalpies_RT(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of standard-state species enthalpies -% divided by RT, where R is the universal gas -% constant and T is the temperature. For gaseous species, these -% values are ideal gas enthalpies. -% - -v = thermo_get(tp.tp_id, 32); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mass.m b/interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mass.m deleted file mode 100644 index a626913753..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mass.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = enthalpy_mass(tp) -% ENTHALPY_MASS Get the mass specific enthalpy. -% v = enthalpy_mass(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass specific enthalpy of the mixture. Units: J/kg -% - -v = thermo_get(tp.tp_id, 9); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mole.m b/interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mole.m deleted file mode 100644 index 168db98668..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/enthalpy_mole.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = enthalpy_mole(tp) -% ENTHALPY_MOLE Get the mole specific enthalpy. -% v = enthalpy_mole(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar specific enthalpy of the mixture. Units: J/kmol -% - -v = thermo_get(tp.tp_id, 2); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/entropies_R.m b/interfaces/matlab/toolbox/@ThermoPhase/entropies_R.m deleted file mode 100644 index 7207f49345..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/entropies_R.m +++ /dev/null @@ -1,11 +0,0 @@ -function s = entropies_R(tp) -% ENTROPIES_R Get the non-dimensional entropy. -% s = entropies_R(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of species non-dimensional entropies. -% - -s = thermo_get(tp.tp_id, 36); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/entropy_mass.m b/interfaces/matlab/toolbox/@ThermoPhase/entropy_mass.m deleted file mode 100644 index 3b343f7baa..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/entropy_mass.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = entropy_mass(tp) -% ENTROPY_MASS Get the mass specific entropy. -% v = entropy_mass(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass specific entropy of the mixture. Units: J/kg-K -% - -v = thermo_get(tp.tp_id, 11); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/entropy_mole.m b/interfaces/matlab/toolbox/@ThermoPhase/entropy_mole.m deleted file mode 100644 index 11323f0f51..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/entropy_mole.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = entropy_mole(tp) -% ENTROPY_MOLE Get the mole specific entropy. -% v = entropy_mole(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar specific entropy of the mixture. Units: J/kmol-K -% - -v = thermo_get(tp.tp_id, 4); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/eosType.m b/interfaces/matlab/toolbox/@ThermoPhase/eosType.m deleted file mode 100644 index d576d4c8c1..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/eosType.m +++ /dev/null @@ -1,11 +0,0 @@ -function e = eosType(tp) -% EOSTYPE Get the type of the equation of state. -% e = eosType(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% An string identifying the equation of state. -% - -e = phase_get(tp.tp_id, 43); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/equilibrate.m b/interfaces/matlab/toolbox/@ThermoPhase/equilibrate.m deleted file mode 100644 index 2b94c88aac..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/equilibrate.m +++ /dev/null @@ -1,57 +0,0 @@ -function tp = equilibrate(tp, xy, solver, rtol, maxsteps, maxiter, loglevel) -% EQUILIBRATE Set the phase to a state of chemical equilibrium. -% tp = equilibrate(tp, xy, solver, rtol, maxsteps, maxiter, loglevel) -% :param XY: -% A two-letter string, which must be one of the set -% ``['TP','TV','HP','SP','SV','UV','UP']``, -% indicating which pair of properties should be held constant. -% Not all of the properties to be held constant are available with -% all of the solvers. -% :param solver: -% Specifies the equilibrium solver to use. If solver = 0, a fast -% solver using the element potential method will be used. If -% solver = 1, a slower but more robust Gibbs minimization solver -% will be used. If solver >= 2, a version of the VCS algorithm will -% be used. If solver < 0 or is unspecified, the fast solver -% will be tried first, then if it fails the Gibbs minimization solver -% will be tried. -% :param rtol: -% The relative error tolerance. -% :param maxsteps: -% Maximum number of steps in composition to take to find a -% converged solution. -% :param maxiter: -% For the Gibbs minimization solver only, this specifies the number -% of 'outer' iterations on T or P when some property pair other than -% TP is specified. -% :param loglevel: -% Set to a value > 0 to write diagnostic output. Larger values -% generate more detailed information. -% - -% use the ChemEquil solver by default -if nargin < 3 - solver = -1; -end -if nargin < 4 - rtol = 1.0e-9; -end -if nargin < 5 - maxsteps = 1000; -end -if nargin < 6 - maxiter = 100; -end -if nargin < 7 - loglevel = 0; -end - -iok = thermo_set(tp.tp_id, 50, xy, solver, rtol, maxsteps, maxiter, loglevel); -if iok < 0 - e = geterr; - if e == 0 - e = 'unknown error'; - end - error(e); -end - diff --git a/interfaces/matlab/toolbox/@ThermoPhase/gibbs_RT.m b/interfaces/matlab/toolbox/@ThermoPhase/gibbs_RT.m deleted file mode 100644 index 46685eb321..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/gibbs_RT.m +++ /dev/null @@ -1,11 +0,0 @@ -function g_RT = gibbs_RT(tp) -% GIBBS_RT Get the non-dimensional Gibbs function. -% g_RT = gibbs_RT(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of non-dimensional Gibbs functions of the species. -% - -g_RT = enthalpies_RT(tp) - entropies_R(tp); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/gibbs_mass.m b/interfaces/matlab/toolbox/@ThermoPhase/gibbs_mass.m deleted file mode 100644 index 14f167b188..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/gibbs_mass.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = gibbs_mass(tp) -% GIBBS_MASS Get the mass specific Gibbs function. -% v = gibbs_mass(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass specific Gibbs function of the mixture. Units: J/kg -% - -v = thermo_get(tp.tp_id, 12); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/gibbs_mole.m b/interfaces/matlab/toolbox/@ThermoPhase/gibbs_mole.m deleted file mode 100644 index 093b431faf..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/gibbs_mole.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = gibbs_mole(tp) -% GIBBS_MOLE Get the mole specific Gibbs function. -% v = gibbs_mole(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar specific Gibbs function of the mixture. Units: J/kmol -% - -v = thermo_get(tp.tp_id, 5); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mass.m b/interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mass.m deleted file mode 100644 index a5fea20276..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mass.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = intEnergy_mass(tp) -% INTENERGY_MASS Get the mass specific internal energy. -% v = intEnergy_mass(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Mass specific internal energy of the mixture. Units: J/kg -% - -v = thermo_get(tp.tp_id, 10); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mole.m b/interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mole.m deleted file mode 100644 index 8df1556adf..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/intEnergy_mole.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = intEnergy_mole(tp) -% INTENERGY_MOLE Get the mole specific internal energy. -% v = intEnergy_mole(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar specific internal energy of the mixture. Units: J/kmol -% - -v = thermo_get(tp.tp_id, 3); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m b/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m deleted file mode 100644 index c9da1721ab..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m +++ /dev/null @@ -1,16 +0,0 @@ -function v = isIdealGas(tp) -% ISIDEALGAS Get a flag indicating whether the phase is an ideal gas. -% v = isIdealGas(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% True (1) if the phase is an ideal gas or ideal gas -% mixture, and false (0) otherwise. -% - -if strcmp(eosType(tp), 'ideal-gas') - v = 1; -else - v = 0; -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/isothermalCompressibility.m b/interfaces/matlab/toolbox/@ThermoPhase/isothermalCompressibility.m deleted file mode 100644 index 467c807429..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/isothermalCompressibility.m +++ /dev/null @@ -1,12 +0,0 @@ -function b = isothermalCompressibility(tp) -% ISOTHERMALCOMPRESSIBILITY Get the isothermal compressibility. -% b = isothermalCompressibility(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Isothermal Compressibility. Units: 1/Pa -% - -b = thermo_get(tp.tp_id, 26); - diff --git a/interfaces/matlab/toolbox/@ThermoPhase/massFraction.m b/interfaces/matlab/toolbox/@ThermoPhase/massFraction.m deleted file mode 100644 index 82fd33deaf..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/massFraction.m +++ /dev/null @@ -1,31 +0,0 @@ -function y = massFraction(tp, species) -% MASSFRACTION Get the mass fraction of a species. -% y = massFraction(tp, species) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param species: -% String or cell array of strings of species whose mass -% fraction is desired -% :return: -% Scalar or vector double mass fractions -% - -y = 0.0; -yarray = massFractions(tp); -if isa(species, 'char') - k = speciesIndex(tp, species); - if k > 0 - y = yarray(k); - end - -elseif isa(species, 'cell') - n = length(species); - y = zeros(1, n); - for j = 1:n - k = speciesIndex(tp, species{j}); - if k > 0 - y(j) = yarray(k); - end - end -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/massFractions.m b/interfaces/matlab/toolbox/@ThermoPhase/massFractions.m deleted file mode 100644 index d76c564ae4..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/massFractions.m +++ /dev/null @@ -1,20 +0,0 @@ -function y = massFractions(tp) -% MASSFRACTIONS Get the mass fractions of all species. -% y = massFractions(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of species mass fractions for input phase. If -% no output argument is specified, a bar plot is produced. -% - -y = phase_get(tp.tp_id, 21); -if nargout == 0 - figure - set(gcf, 'Name', 'Mass Fractions') - bar(y) - xlabel('Species Number') - ylabel('Mass Fraction') - title('Species Mass Fractions') -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/maxTemp.m b/interfaces/matlab/toolbox/@ThermoPhase/maxTemp.m deleted file mode 100644 index 3e0ccb0928..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/maxTemp.m +++ /dev/null @@ -1,18 +0,0 @@ -function v = maxTemp(tp) -% MAXTEMP Get the maximum temperature of the parameter fits. -% v = maxTemp(tp) -% The parameterizations used to represent the temperature-dependent -% species thermodynamic properties are generally only valid in some -% finite temperature range, which may be different for each species -% in the phase. -% -% See also: :mat:func:`minTemp` -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of maximum temperatures of all species -% - -v = thermo_get(tp.tp_id, 17); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/meanMolecularWeight.m b/interfaces/matlab/toolbox/@ThermoPhase/meanMolecularWeight.m deleted file mode 100644 index 84a3e2cdb5..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/meanMolecularWeight.m +++ /dev/null @@ -1,14 +0,0 @@ -function mmw = meanMolecularWeight(tp) -% MEANMOLECULARWEIGHT Get the mean molecular weight. -% wtm = meanMolecularWeight(tp) -% The mean molecular weight is the mole-fraction-weighted sum of the -% molar masses of the individual species in the phase. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Scalar double mean molecular weight. Units: kg/kmol -% - -mmw = phase_get(tp.tp_id,4); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/minTemp.m b/interfaces/matlab/toolbox/@ThermoPhase/minTemp.m deleted file mode 100644 index 56c69e25db..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/minTemp.m +++ /dev/null @@ -1,18 +0,0 @@ -function v = minTemp(tp) -% MINTEMP Get the minimum temperature of the parameter fits. -% v = minTemp(tp) -% The parameterizations used to represent the temperature-dependent -% species thermodynamic properties are generally only valid in some -% finite temperature range, which may be different for each species -% in the phase. -% -% See also: :mat:func:`maxTemp` -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of minimum temperatures of all species -% - -v = thermo_get(tp.tp_id, 16); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/molarDensity.m b/interfaces/matlab/toolbox/@ThermoPhase/molarDensity.m deleted file mode 100644 index eee8c462e8..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/molarDensity.m +++ /dev/null @@ -1,11 +0,0 @@ -function n = molarDensity(tp) -% MOLARDENSITY Get the molar density. -% n = molarDensity(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Molar density. Units: kmol/m^3 -% - -n = phase_get(tp.tp_id, 3); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/moleFraction.m b/interfaces/matlab/toolbox/@ThermoPhase/moleFraction.m deleted file mode 100644 index 1adaaa5a84..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/moleFraction.m +++ /dev/null @@ -1,31 +0,0 @@ -function x = moleFraction(tp, species) -% MOLEFRACTION Get the mole fraction of a species. -% x = moleFraction(tp, species) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param species: -% String or cell array of strings of species whose mole -% fraction is desired -% :return: -% Scalar or vector double mole fractions -% - -x = 0.0; -xarray = moleFractions(tp); -if isa(species, 'char') - k = speciesIndex(tp, species); - if k > 0 - x = xarray(k); - end - -elseif isa(species, 'cell') - n = length(species); - x = zeros(1, n); - for j = 1:n - k = speciesIndex(tp, species{j}); - if k > 0 - x(j) = xarray(k); - end - end -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/moleFractions.m b/interfaces/matlab/toolbox/@ThermoPhase/moleFractions.m deleted file mode 100644 index 2d1a4ba7fc..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/moleFractions.m +++ /dev/null @@ -1,20 +0,0 @@ -function x = moleFractions(tp) -% MOLEFRACTIONS Get the mole fractions of all species. -% x = moleFractions(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of species mole fractions for input phase. If -% no output argument is specified, a bar plot is produced. -% - -x = phase_get(tp.tp_id, 20); -if nargout == 0 - figure - set(gcf, 'Name', 'Mole Fractions') - bar(x) - xlabel('Species Number') - ylabel('Mole Fraction') - title('Species Mole Fractions') -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/molecularWeights.m b/interfaces/matlab/toolbox/@ThermoPhase/molecularWeights.m deleted file mode 100644 index 49a2e6e063..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/molecularWeights.m +++ /dev/null @@ -1,12 +0,0 @@ -function mw = molecularWeights(tp) -% MOLECULARWEIGHTS Get the molecular weights of the species. -% x = molecularWeights(tp) -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Vector of species molecular weights. Units: kg/kmol -% - -mw = phase_get(tp.tp_id, 22); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/nAtoms.m b/interfaces/matlab/toolbox/@ThermoPhase/nAtoms.m deleted file mode 100644 index 6ef1b2bc54..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/nAtoms.m +++ /dev/null @@ -1,25 +0,0 @@ -function n = nAtoms(tp,k,m) -% NATOMS Get the number of atoms of an element in a species. -% n = nAtoms(tp,k,m) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param k: -% String species name or integer species number -% :param m: -% String element name or integer element number -% :return: -% Number of atoms of element ``m`` in species ``k``. -% - -if nargin == 3 - if ischar(m) - m = elementIndex(tp, m); - end - if ischar(k) - k = speciesIndex(tp, k); - end - n = phase_get(tp.tp_id,14, k, m); -else - error('nAtoms expects three input arguments.') -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/nElements.m b/interfaces/matlab/toolbox/@ThermoPhase/nElements.m deleted file mode 100644 index 949f3b5bb4..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/nElements.m +++ /dev/null @@ -1,11 +0,0 @@ -function n = nElements(tp) -% NELEMENTS Get the number of elements. -% n = nElements(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Number of elements in the phase. -% - -n = phase_get(tp.tp_id, 10); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/nSpecies.m b/interfaces/matlab/toolbox/@ThermoPhase/nSpecies.m deleted file mode 100644 index 1ba41e1aac..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/nSpecies.m +++ /dev/null @@ -1,11 +0,0 @@ -function n = nSpecies(tp) -% NSPECIES Get the number of species. -% n = nSpecies(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Number of species in the phase. -% - -n = phase_get(tp.tp_id, 11); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/name.m b/interfaces/matlab/toolbox/@ThermoPhase/name.m deleted file mode 100644 index 297d168f74..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/name.m +++ /dev/null @@ -1,11 +0,0 @@ -function nm = name(tp) -% NAME Get the name of the phase. -% nm = name(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% String name of the input phase -% - -nm = phase_get(thermo_hndl(tp), 42); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/pressure.m b/interfaces/matlab/toolbox/@ThermoPhase/pressure.m deleted file mode 100644 index bdf7279791..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/pressure.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = pressure(tp) -% PRESSURE Get the pressure. -% v = pressure(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Pressure. Units: Pa -% - -v = thermo_get(tp.tp_id, 8); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/private/phase_get.m b/interfaces/matlab/toolbox/@ThermoPhase/private/phase_get.m deleted file mode 100644 index 28acd9c2f4..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/private/phase_get.m +++ /dev/null @@ -1,8 +0,0 @@ -function i = phase_get(n, job, a, b) -if nargin == 2 - i = ctmethods(30, n, job); -elseif nargin == 3 - i = ctmethods(30, n, job, a); -else - i = ctmethods(30, n, job, a, b); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/private/phase_set.m b/interfaces/matlab/toolbox/@ThermoPhase/private/phase_set.m deleted file mode 100644 index 186590936f..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/private/phase_set.m +++ /dev/null @@ -1,8 +0,0 @@ -function phase_set(n, job, a, b) -if nargin == 2 - ctmethods(30, n, -job); -elseif nargin == 3 - ctmethods(30, n, -job, a); -else - ctmethods(30, n,-job, a, b); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/private/thermo_get.m b/interfaces/matlab/toolbox/@ThermoPhase/private/thermo_get.m deleted file mode 100644 index 383d4fc0b0..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/private/thermo_get.m +++ /dev/null @@ -1,8 +0,0 @@ -function i = thermo_get(n, job, a, b) -if nargin == 2 - i = ctmethods(20, n, job); -elseif nargin == 3 - i = ctmethods(20, n, job, a); -else - i = ctmethods(20, n, job, a, b); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/private/thermo_set.m b/interfaces/matlab/toolbox/@ThermoPhase/private/thermo_set.m deleted file mode 100644 index b4ca7e2d86..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/private/thermo_set.m +++ /dev/null @@ -1,16 +0,0 @@ -function i = thermo_set(n, job, a, b, c, d, e, f) -if nargin == 2 - i = ctmethods(20, n, -job); -elseif nargin == 3 - i = ctmethods(20, n, -job,a); -elseif nargin == 4 - i = ctmethods(20, n, -job, a, b); -elseif nargin == 5 - i = ctmethods(20, n, -job, a, b, c); -elseif nargin == 6 - i = ctmethods(20, n, -job, a, b, c, d); -elseif nargin == 7 - i = ctmethods(20, n, -job, a, b, c, d, e); -elseif nargin == 8 - i = ctmethods(20, n, -job, a, b, c, d, e, f); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/refPressure.m b/interfaces/matlab/toolbox/@ThermoPhase/refPressure.m deleted file mode 100644 index ff8cb3bc52..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/refPressure.m +++ /dev/null @@ -1,12 +0,0 @@ -function v = refPressure(tp) -% REFPRESSURE Get the reference pressure. -% v = refPressure(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% Reference pressure in Pa. All standard-state -% thermodynamic properties are for this pressure. -% - -v = thermo_get(tp.tp_id, 15); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/satPressure.m b/interfaces/matlab/toolbox/@ThermoPhase/satPressure.m deleted file mode 100644 index 55a2f1936f..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/satPressure.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = satPressure(tp, T) -% SATPRESSURE Get the saturation pressure for a given temperature. -% v = satPressure(tp, T) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param T: -% Temperature Units: K -% :return: -% Saturation pressure for temperature T. Units: Pa -% - -v = thermo_get(tp.tp_id, 24, T); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/satTemperature.m b/interfaces/matlab/toolbox/@ThermoPhase/satTemperature.m deleted file mode 100644 index d8fdc897cb..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/satTemperature.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = satTemperature(tp, p) -% SATTEMPERATURE Get the saturation temperature for a given pressure. -% v = satTemperature(tp, p) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param p: -% Pressure. Units: Pa -% :return: -% Saturation temperature for pressure p. Units: K -% - -v = thermo_get(tp.tp_id, 23, p); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/set.m b/interfaces/matlab/toolbox/@ThermoPhase/set.m deleted file mode 100644 index 446316bab7..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/set.m +++ /dev/null @@ -1,206 +0,0 @@ -function set(tp, varargin) -% SET Set properties of a phase. -% set(tp,varargin) -% The properties that may be set are -% -% * Temperature (T) -% * Density (Rho) -% * Volume (V) -% * Pressure (P) -% * Enthalpy (H) -% * Entropy (S) -% * Mole Fractions (X) -% * Mass Fractions (Y) -% * Vapor Fraction (Vapor) -% * Liquid Fraction (Liquid) -% -% Either the full property name or the symbol may be -% specified. For the extensive properties (V,H,U,S), the values -% must be given per unit mass. H, U, and S must be set in -% conjunction with pressure (for H,S) or volume (for U,S). Either -% (specific) volume or density may be specified. Mole and mass -% fractions must be input as vectors (either row or column) with -% length equal to the number of species. Two properties may be -% specified in a single call to :mat:func:`set`, plus one of -% mass fractions or mole fractions. -% -% Examples:: -% -% >> set(gas,'Temperature',600.0); -% >> set(gas,'T',600.0); -% >> set(gas,'T',600.0,'P',2*oneatm,'Y',massfracs); -% >> set(gas,'H',0.5*enthalpy_mass(gas),'P',pressure(gas)); -% >> set(gas,'S',entropy_mass(gas),'P',0.5*pressure(gas)); -% >> set(gas,'X',ones(nSpecies(gas),1)); -% >> set(gas,'T',500.0,'Vapor',0.8) -% -% Alternatively, individual methods to set properties may be -% called (setTemperature, setMoleFractions, etc.) -% -% See also: :mat:func:`setDensity`, :mat:func:`setMassFractions`, -% :mat:func:`setMoleFractions`, :mat:func:`setPressure`, :mat:func:`setState_HP`, -% :mat:func:`setState_Psat`, :mat:func:`setState_SP`, :mat:func:`setState_SV`, -% :mat:func:`setState_Tsat`, :mat:func:`setState_UV`, :mat:func:`setTemperature` -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :param varargin: -% Comma separated list of ``property, value`` pairs to be set -% - -property_argin = varargin; -tval = -999; -pval = -999; -hval = -999; -uval = -999; -sval = -999; -vval = -999; -qval = -999; - -np = 0; -nt = 0; -nv = 0; -nx = 0; -ny = 0; -ns = 0; -nh = 0; -nu = 0; -nq = 0; - -while length(property_argin) >= 2, - prop = property_argin{1}; - val = property_argin{2}; - if issparse(val) - val = full(val); - end - property_argin = property_argin(3:end); - switch prop - case 'Temperature' - nt = nt + 1; - tval = val; - case 'T' - nt = nt + 1; - tval = val; - case 'Density' - nv = nv + 1; - vval = 1.0/val; - case 'Rho' - nv = nv + 1; - vval = 1.0/val; - case 'V' - nv = nv + 1; - vval = val; - case 'MoleFractions' - nx = nx + 1; - setMoleFractions(tp, val); - case 'X' - nx = nx + 1; - setMoleFractions(tp, val); - case 'MassFractions' - ny = ny + 1; - setMassFractions(tp, val); - case 'Y' - ny = ny + 1; - setMassFractions(tp, val); - case 'Pressure' - pval = val; - np = np + 1; - case 'P' - pval = val; - np = np + 1; - case 'Enthalpy' - hval = val; - nh = nh + 1; - case 'H' - hval = val; - nh = nh + 1; - case 'IntEnergy' - uval = val; - nu = nu + 1; - case 'U' - uval = val; - nu = nu + 1; - case 'Entropy' - sval = val; - ns = ns + 1; - case 'S' - sval = val; - ns = ns + 1; - case 'Sat' - qval = val; - nq = nq + 1; - case 'Vapor' - qval = val; - nq = nq + 1; - case 'Liquid' - qval = 1.0 - val; - nq = nq + 1; - otherwise - error(['Unknown property ' char(prop)]) - end -end - -if nx + ny > 1 - error('Composition specified multiple times.'); -end - -ntot = nt + np + nv + ns + nh + nu + nq; - -if ntot == 1 - % - % set T, v, or P individually - % - if nt == 1 - setTemperature(tp, tval); % density held fixed - elseif nv == 1 - setDensity(tp, 1.0/vval); % temperature held fixed - elseif np == 1 - setPressure(tp, pval); % temperature held fixed - else - error('Pressure, Volume, or Density must also be specified.'); - end -elseif ntot == 2 - % - % set property pairs - % - if nt == 1 && nv == 1 - setTemperature(tp, tval); - setDensity(tp, 1.0/vval); - elseif nt == 1 && np == 1 - setTemperature(tp, tval); - setPressure(tp, pval); - elseif np == 1 && nv == 1 - setState_DP(tp, [1.0/vval, pval]) - elseif nt == 1 && nq == 1 - setState_Tsat(tp, [tval,qval]); - elseif np == 1 && nq == 1 - setState_Psat(tp, [pval,qval]); - elseif np == 1 && nh == 1 - setState_HP(tp, [hval,pval]); - elseif nu == 1 && nv == 1 - setState_UV(tp, [uval,vval]); - elseif ns == 1 && np == 1 - setState_SP(tp, [sval,pval]); - elseif ns == 1 && nv == 1 - setState_SV(tp, [sval,vval]); - elseif ns == 1 && nt == 1 - setState_ST(tp, [sval,tval]); - elseif nt == 1 && nv == 1 - setState_TV(tp, [tval,vval]); - elseif np == 1 && nv == 1 - setState_PV(tp, [pval,vval]); - elseif nu == 1 && np == 1 - setState_UP(tp, [uval,pval]); - elseif nv == 1 && nh == 1 - setState_VH(tp, [vval,hval]); - elseif nt == 1 && nh == 1 - setState_TH(tp, [tval,hval]); - elseif ns == 1 && nh == 1 - setState_SH(tp, [sval,hval]); - else - error('Unimplemented property pair.'); - end -elseif ntot > 2 - error('Too many properties specified.'); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setDensity.m b/interfaces/matlab/toolbox/@ThermoPhase/setDensity.m deleted file mode 100644 index 53834c6e77..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setDensity.m +++ /dev/null @@ -1,15 +0,0 @@ -function setDensity(tp, rho) -% SETDENSITY Set the density. -% setDensity(tp,rho) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param rho: -% Density. Units: kg/m**3 -% - -if rho <= 0.0 - error('The density must be positive.'); -end - -phase_set(tp.tp_id, 2, rho); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setElectricPotential.m b/interfaces/matlab/toolbox/@ThermoPhase/setElectricPotential.m deleted file mode 100644 index f0e8a202bc..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setElectricPotential.m +++ /dev/null @@ -1,11 +0,0 @@ -function setElectricPotential(tp,phi) -% SETELECTRICPOTENTIAL Set the electric potential. -% setElectricPotential(tp,phi) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param phi: -% Electric potential. Units: V -% - -thermo_set(tp.tp_id, 2, phi); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setMassFractions.m b/interfaces/matlab/toolbox/@ThermoPhase/setMassFractions.m deleted file mode 100644 index ee08b9e293..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setMassFractions.m +++ /dev/null @@ -1,43 +0,0 @@ -function setMassFractions(tp, y, norm) -% SETMASSFRACTIONS Set the species mass fractions. -% setMassFractions(tp, y, norm) -% Note that calling :mat:func:`setMassFractions` leaves the temperature and -% density unchanged, and therefore the pressure changes if the new -% composition has a molar mass that is different than the old -% composition. If it is desired to change the composition and hold -% the pressure fixed, use method :mat:func:`set` and specify the mass -% fractions and the pressure, or call :mat:func:`setPressure` -% after calling :mat:func:`setMassFractions`. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param y: -% Vector of mass fractions whose length must be the same as -% the number of species. Alternatively, a string in the format -% ``'SPEC:Y,SPEC2:Y2'`` that specifies the mass fraction of -% specific species. -% :param norm: -% If ``'nonorm'`` is specified, ``y`` will be normalized. This only -% works if ``y`` is a vector, not a string. Since unnormalized mass -% fractions can lead to unphysical results, ``'nonorm'`` should be -% used only in rare cases, such as computing partial -% derivatives with respect to a species mass fraction. -% - -if isa(y, 'double') - if nargin == 3 - if strcmp(norm, 'nonorm') - phase_set(tp.tp_id, 23, y); - else - phase_set(tp.tp_id, 21, y); - end - else - phase_set(tp.tp_id, 21, y); - end - % - % string input - % -elseif isa(y, 'char') - phase_set(tp.tp_id, 31, y); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setMoleFractions.m b/interfaces/matlab/toolbox/@ThermoPhase/setMoleFractions.m deleted file mode 100644 index 8a1a4c4dc6..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setMoleFractions.m +++ /dev/null @@ -1,43 +0,0 @@ -function setMoleFractions(tp, x, norm) -% SETMOLEFRACTIONS Set the species mole fractions. -% setMoleFractions(tp,x,norm) -% Note that calling :mat:func:`setMoleFractions` leaves the temperature and -% density unchanged, and therefore the pressure changes if the new -% composition has a molar mass that is different than the old -% composition. If it is desired to change the composition and hold -% the pressure fixed, use method :mat:func:`set` and specify the mole -% fractions and the pressure, or call :mat:func:`setPressure` -% after calling :mat:func:`setmoleFractions`. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param y: -% Vector of mole fractions whose length must be the same as -% the number of species. Alternatively, a string in the format -% ``'SPEC:Y,SPEC2:Y2'`` that specifies the mole fraction of -% specific species. -% :param norm: -% If ``'nonorm'`` is specified, ``y`` will be normalized. This only -% works if ``y`` is a vector, not a string. Since unnormalized mole -% fractions can lead to unphysical results, ``'nonorm'`` should be -% used only in rare cases, such as computing partial -% derivatives with respect to a species mole fraction. -% - -if isa(x, 'double') - if nargin == 3 - if strcmp(norm, 'nonorm') - phase_set(tp.tp_id, 22, x); - else - phase_set(tp.tp_id, 20, x); - end - else - phase_set(tp.tp_id, 20, x); - end - % - % string input - % -elseif isa(x, 'char') - phase_set(tp.tp_id, 30, x); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setName.m b/interfaces/matlab/toolbox/@ThermoPhase/setName.m deleted file mode 100644 index b0987c2828..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setName.m +++ /dev/null @@ -1,15 +0,0 @@ -function setName(tp, name) -% SETNAME Set the name of the phase. -% setName(tp, name) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param name: -% String, name of the phase -% - -if isa(name,'char') - phase_set(thermo_hndl(tp), 32, name); -else - error('name must be a string.'); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setPressure.m b/interfaces/matlab/toolbox/@ThermoPhase/setPressure.m deleted file mode 100644 index 16cea39593..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setPressure.m +++ /dev/null @@ -1,18 +0,0 @@ -function setPressure(tp, p) -% SETPRESSURE Set the pressure. -% setPressure(tp,p) -% The pressure is set by changing the density holding the -% temperature and chemical composition fixed. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param p: -% Pressure. Units: Pa -% - -if p <= 0.0 - error('The pressure must be positive.') -end - -thermo_set(tp.tp_id, 1, p); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_DP.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_DP.m deleted file mode 100644 index 13f4ed1ff6..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_DP.m +++ /dev/null @@ -1,16 +0,0 @@ -function setState_DP(tp, dp) -% SETSTATE_DP Set the density and pressure. -% setState_DP(tp, [density,p]) -% The density is set first, then the pressure is set by -% changing the temperature holding the density and -% chemical composition fixed. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param dp: -% Vector of length 2 containing the desired values for the density (kg/m^3) -% and pressure (Pa) -% - -thermo_set(tp.tp_id, 26, dp); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_HP.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_HP.m deleted file mode 100644 index 8419350b4a..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_HP.m +++ /dev/null @@ -1,16 +0,0 @@ -function setState_HP(tp, hp) -% SETSTATE_HP Set the specific enthalpy and pressure. -% setState_HP(tp,hp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param hp: -% Vector of length 2 containing the desired values for the specific -% enthalpy (J/kg) and pressure (Pa). -% - -if hp(2) <= 0.0 - error('The pressure must be positive.'); -end - -thermo_set(tp.tp_id, 20, hp); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m deleted file mode 100644 index 21dbcd0618..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_PV(tp, pv) -% SETSTATE_PV Set the pressure and specific volume. -% setState_PV(tp,pv) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param pv: -% Vector of length 2 containing the desired values for the -% pressure (Pa) and specific volume (m^3/kg). -% - -thermo_set(tp.tp_id, 29, pv); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_Psat.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_Psat.m deleted file mode 100644 index 0e0dc9e41e..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_Psat.m +++ /dev/null @@ -1,16 +0,0 @@ -function setState_Psat(tp, px) -% SETSTATE_PSAT Set the fluid state using the given pressure and quality. -% setState_Psat(tp,px) -% The fluid state will be set to a saturated liquid-vapor state using the -% input pressure and vapor fraction (quality) as the independent, -% intensive variables. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param px: -% Vector of length 2 containing the desired values for the pressure (Pa) -% and the vapor fraction -% - -thermo_set(tp.tp_id, 24, px); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m deleted file mode 100644 index e632d15824..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_SH(tp, sh) -% SETSTATE_SH Set the specific entropy and specific enthalpy. -% setState_SH(tp,sh) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param sh: -% Vector of length 2 containing the desired values for the specific -% entropy (J/kg/K) and specific enthalpy (J/kg). -% - -thermo_set(tp.tp_id, 33, sh); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_SP.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_SP.m deleted file mode 100644 index 621ffe2aa1..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_SP.m +++ /dev/null @@ -1,18 +0,0 @@ -function setState_SP(tp, sp) -% SETSTATE_SP Set the specific entropy and pressure. -% setState_SP(tp,sp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param sp: -% Vector of length 2 containing the desired values for the specific -% entropy (J/kg-K) and pressure (Pa). -% - -if sp(1) <= 0.0 - error('The specific entropy must be positive.'); -end -if sp(2) <= 0.0 - error('The pressure must be positive.'); -end -thermo_set(tp.tp_id, 23, sp); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m deleted file mode 100644 index 45258dde3a..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_ST(tp, st) -% SETSTATE_ST Set the specific entropy and temperature. -% setState_ST(tp,st) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param st: -% Vector of length 2 containing the desired values for the specific -% entropy (J/kg-K) and temperature (K). -% - -thermo_set(tp.tp_id, 27, st); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_SV.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_SV.m deleted file mode 100644 index 9ef51acbea..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_SV.m +++ /dev/null @@ -1,18 +0,0 @@ -function setState_SV(tp, sv) -% SETSTATE_SV Set the specific entropy and specific volume. -% setState_SV(tp,sv) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param sv: -% Vector of length 2 containing the desired values for the specific -% entropy (J/kg-K) and specific volume (m**3/kg). -% - -if sv(1) <= 0.0 - error('The specific entropy must be positive.'); -end -if sv(2) <= 0.0 - error('The specific volume must be positive.'); -end -thermo_set(tp.tp_id, 22, sv); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m deleted file mode 100644 index 30d76d9474..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_TH(tp, th) -% SETSTATE_TH Set the temperature and specific enthalpy. -% setState_TH(tp,th) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param th: -% Vector of length 2 containing the desired values for the -% temperature (K) and specific enthalpy (J/kg). -% - -thermo_set(tp.tp_id, 32, th); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m deleted file mode 100644 index 088609e454..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_TV(tp, tv) -% SETSTATE_TV Set the temperature and specific volume. -% setState_TV(tp,tv) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param tv: -% Vector of length 2 containing the desired values for the -% temperature (K) and specific volume (m^3/kg). -% - -thermo_set(tp.tp_id, 28, tv); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_Tsat.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_Tsat.m deleted file mode 100644 index 1605629655..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_Tsat.m +++ /dev/null @@ -1,16 +0,0 @@ -function setState_Tsat(tp, tx) -% SETSTATE_TSAT Set the fluid state using the given temperature and quality. -% setState_Tsat(tp,tx) -% The fluid state will be set to a saturated liquid-vapor state using the -% input temperature and vapor fraction (quality) as the independent, -% intensive variables. -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param tx: -% Vector of length 2 containing the desired values for the temperature (K) -% and the vapor fraction (quality) -% - -thermo_set(tp.tp_id, 25, tx); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m deleted file mode 100644 index 4a1e51e934..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_UP(tp, up) -% SETSTATE_UP Set the specific internal energy and pressure. -% setState_UP(tp,up) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param up: -% Vector of length 2 containing the desired values for the specific -% internal energy (J/kg) and pressure (Pa). -% - -thermo_set(tp.tp_id, 30, up); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_UV.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_UV.m deleted file mode 100644 index c1f3e7874f..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_UV.m +++ /dev/null @@ -1,16 +0,0 @@ -function setState_UV(tp, uv) -% SETSTATE_UV Set the specific internal energy and specific volume. -% setState_UV(tp,uv) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param uv: -% Vector of length 2 containing -% the desired values for the specific internal energy (J/kg) and -% specific volume (m**3/kg). -% - -if uv(2) <= 0.0 - error('The specific volume must be positive.'); -end -thermo_set(tp.tp_id, 21, uv); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m deleted file mode 100644 index 0532b76fca..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m +++ /dev/null @@ -1,12 +0,0 @@ -function setState_VH(tp, vh) -% SETSTATE_VH Set the specific volume and specific enthalpy. -% setState_VH(tp,vh) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param vh: -% Vector of length 2 containing the desired values for the specific -% volume (m^3/kg) and specific enthalpy (J/kg). -% - -thermo_set(tp.tp_id, 31, vh); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_satLiquid.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_satLiquid.m deleted file mode 100644 index 5c617f137a..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_satLiquid.m +++ /dev/null @@ -1,9 +0,0 @@ -function setState_satLiquid(tp) -% SETSTATE_SATLIQUID Set the fluid to the saturated liquid state at the current temperature. -% setState_satLiquid(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% - -set(tp, 'T', temperature(tp), 'Liquid', 1.0) diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_satVapor.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_satVapor.m deleted file mode 100644 index 6805e1e17f..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState_satVapor.m +++ /dev/null @@ -1,9 +0,0 @@ -function setState_satVapor(tp) -% SETSTATE_SATVAPOR Set the fluid to the saturated vapor state at the current temperature. -% setState_satVapor(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% - -set(tp, 'T', temperature(tp), 'Vapor', 1.0) diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setTemperature.m b/interfaces/matlab/toolbox/@ThermoPhase/setTemperature.m deleted file mode 100644 index 1c8da7d0c1..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setTemperature.m +++ /dev/null @@ -1,14 +0,0 @@ -function setTemperature(tp,t) -% SETTEMPERATURE Set the temperature. -% setTemperature(tp,t) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param t: -% Temperature. Units: K -% - -if (t <= 0) - error('The temperature must be positive.'); -end -phase_set(tp.tp_id, 1, t); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/soundspeed.m b/interfaces/matlab/toolbox/@ThermoPhase/soundspeed.m deleted file mode 100644 index 084501d7a1..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/soundspeed.m +++ /dev/null @@ -1,43 +0,0 @@ -function c = soundspeed(tp) -% SOUNDSPEED Get the speed of sound. -% c = soundspeed(tp) -% If the phase is an ideal gas, the speed of sound -% is calculated by: -% -% .. math:: c = \sqrt{\gamma * R * T} -% -% where :math:`\gamma` is the ratio of specific heats, :math:`R` is -% the specific gas constant, and :math:`T` is the temperature. If the -% phase is not an ideal gas, the speed of sound is calculated by -% -% .. math:: c = \sqrt{\left(\frac{\partial p}{\partial \rho}\right)_s} -% -% where :math:`p` is the pressure and :math:`\rho` is the density, -% and the subscript :math:`s` indicates constant entropy. This is -% approximated by slightly increasing the density at constant entropy -% and computing the change in pressure. -% -% .. math:: c = \sqrt{\frac{p_1 - p_0}{\rho_1-\rho_0}} -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :return: -% The speed of sound. Units: m/s -% - -if isIdealGas(tp) - gamma = cp_mass(tp)/cv_mass(tp); - wtm = meanMolecularWeight(tp); - r = gasconstant/wtm; - c = sqrt(gamma*r*temperature(tp)); -else - rho0 = density(tp); - p0 = pressure(tp); - s0 = entropy_mass(tp); - rho1 = 1.001*rho0; - set(tp, 'Density', rho1, 'Entropy', s0); - p1 = pressure(tp); - dpdrho_s = (p1 - p0)/(rho1 - rho0); - c = sqrt(dpdrho_s); -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/speciesIndex.m b/interfaces/matlab/toolbox/@ThermoPhase/speciesIndex.m deleted file mode 100644 index c76880c9e8..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/speciesIndex.m +++ /dev/null @@ -1,40 +0,0 @@ -function k = speciesIndex(tp, name) -% SPECIESINDEX Get the index of a species given the name. -% k = speciesIndex(tp,name) -% The index is an integer assigned to each species in sequence as it -% is read in from the input file. -% -% NOTE: In keeping with the conventions used by Matlab, this method -% returns 1 for the first species, 2 for the second, etc. In -% contrast, the corresponding method speciesIndex in the Cantera C++ -% and Python interfaces returns 0 for the first species, 1 for the -% second one, etc. :: -% -% >> ich4 = speciesIndex(gas, 'CH4'); -% >> iho2 = speciesIndex(gas, 'HO2'); -% -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param name: -% If name is a single string, the return value will be a integer -% containing the corresponding index. If it is an cell array of -% strings, the output will be an array of the same shape -% containing the indices. -% :return: -% Scalar or array of integers -% - -if iscell(name) - [m,n] = size(name); - k = zeros(m, n); - for i = 1:m - for j = 1:n - k(i,j) = phase_get(tp.tp_id, 12, name{i,j}); - end - end -elseif ischar(name) - k = phase_get(tp.tp_id, 12, name); -else - error('name must be either a string or cell array of strings') -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/speciesName.m b/interfaces/matlab/toolbox/@ThermoPhase/speciesName.m deleted file mode 100644 index 7d3eb8eb0f..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/speciesName.m +++ /dev/null @@ -1,19 +0,0 @@ -function nm = speciesName(tp, k) -% SPECIESNAME Get the name of a species given the index. -% nm = speciesName(tp, k) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :param k: -% Scalar or array of integer species numbers -% :return: -% Cell array of strings -% - -[m,n] = size(k); -nm = cell(m, n); -for i = 1:m - for j = 1:n - nm{i,j} = phase_get(tp.tp_id, 40, k(i,j)); - end -end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/speciesNames.m b/interfaces/matlab/toolbox/@ThermoPhase/speciesNames.m deleted file mode 100644 index 0ff87a48a8..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/speciesNames.m +++ /dev/null @@ -1,11 +0,0 @@ -function n = speciesNames(tp) -% SPECIESNAMES Get the species names. -% n = speciesNames(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :return: -% Cell array of strings of all of the species names -% - -n = speciesName(tp, 1:nSpecies(tp)); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/temperature.m b/interfaces/matlab/toolbox/@ThermoPhase/temperature.m deleted file mode 100644 index f4233e5f0a..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/temperature.m +++ /dev/null @@ -1,11 +0,0 @@ -function t = temperature(tp) -% TEMPERATURE Get the temperature. -% t = temperature(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :return: -% Temperature. Units: K -% - -t = phase_get(tp.tp_id, 1); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/thermalExpansionCoeff.m b/interfaces/matlab/toolbox/@ThermoPhase/thermalExpansionCoeff.m deleted file mode 100644 index cd285022b7..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/thermalExpansionCoeff.m +++ /dev/null @@ -1,11 +0,0 @@ -function a = thermalExpansionCoeff(tp) -% THERMALEXPANSIONCOEFF Get the thermal expansion coefficient. -% a = thermalExpansionCoeff(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :return: -% Thermal Expansion Coefficient. Units: 1/K -% - -a = thermo_get(tp.tp_id, 27); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/thermo_hndl.m b/interfaces/matlab/toolbox/@ThermoPhase/thermo_hndl.m deleted file mode 100644 index fcade2dced..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/thermo_hndl.m +++ /dev/null @@ -1,12 +0,0 @@ -function i = thermo_hndl(tp) -% THERMO_HNDL Get the integer used to access the kernel object. -% i = thermo_hndl(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object deriving from ThermoPhase) -% for which the handle is desired. -% :return: -% Integer used to access the kernel object. -% - -i = tp.tp_id; diff --git a/interfaces/matlab/toolbox/@ThermoPhase/vaporFraction.m b/interfaces/matlab/toolbox/@ThermoPhase/vaporFraction.m deleted file mode 100644 index 6167f28eb4..0000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/vaporFraction.m +++ /dev/null @@ -1,11 +0,0 @@ -function v = vaporFraction(tp) -% VAPORFRACTION Get the vapor fraction. -% v = vaporFraction(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% class derived from ThermoPhase) -% :return: -% Vapor fraction. -% - -v = thermo_get(tp.tp_id, 22); diff --git a/interfaces/matlab/toolbox/@Transport/Transport.m b/interfaces/matlab/toolbox/@Transport/Transport.m deleted file mode 100644 index 2c2f3d45e3..0000000000 --- a/interfaces/matlab/toolbox/@Transport/Transport.m +++ /dev/null @@ -1,43 +0,0 @@ -function tr = Transport(th, model, loglevel) -% TRANSPORT Transport class constructor. -% tr = Transport(r, th, model, loglevel) -% Create a new instance of class :mat:func:`Transport`. One to three arguments -% may be supplied. The first must be an instance of class -% :mat:func:`ThermoPhase`. The second (optional) argument is the type of -% model desired, specified by the string ``'default'`` or a specific transport model -% name such as ``'mixture-averaged'`` or ``'multicomponent'``. -% ``'default'`` uses the default transport specified in the -% phase definition. The third argument is the logging level desired. -% -% :param th: -% Instance of class :mat:func:`ThermoPhase` -% :param model: -% String indicating the transport model to use. Possible values -% are ``'default'``, ``'none'``, ``'mixture-averaged'``, and ``'multicomponent'``, -% among others. Optional. -% :param loglevel: -% Level of diagnostic logging. Default if not specified is 4. -% :return: -% Instance of class :mat:func:`Transport` -% - -tr.id = 0; -if nargin == 2 - model = 'default'; -end - -if nargin < 3 - loglevel = 4; -end - -if ~isa(th, 'ThermoPhase') - error('The first argument must be an instance of class ThermoPhase') -else - tr.th = th; - if strcmp(model, 'default') - tr.id = trans_get(thermo_hndl(th), -2, loglevel); - else - tr.id = trans_get(thermo_hndl(th), -1, model, loglevel); - end - tr = class(tr, 'Transport'); -end diff --git a/interfaces/matlab/toolbox/@Transport/binDiffCoeffs.m b/interfaces/matlab/toolbox/@Transport/binDiffCoeffs.m deleted file mode 100644 index 75c847fccf..0000000000 --- a/interfaces/matlab/toolbox/@Transport/binDiffCoeffs.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = binDiffCoeffs(a) -% BINDIFFCOEFFS Get the binary diffusion coefficents. -% v = binDiffCoeffs(a) -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which binary diffusion coefficients are desired. -% :return: -% A matrix of binary diffusion coefficients. -% The matrix is symmetric: d(i,j) = d(j,i). Units: m**2/s -% - -v = trans_get(a.id, 21, nSpecies(a.th)); diff --git a/interfaces/matlab/toolbox/@Transport/clear.m b/interfaces/matlab/toolbox/@Transport/clear.m deleted file mode 100644 index 32aee1c05a..0000000000 --- a/interfaces/matlab/toolbox/@Transport/clear.m +++ /dev/null @@ -1,9 +0,0 @@ -function clear(tr) -% CLEAR Delete the Transport instance. -% clear(tr) -% :param tr: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% - -trans_get(tr.id, 0) diff --git a/interfaces/matlab/toolbox/@Transport/electricalConductivity.m b/interfaces/matlab/toolbox/@Transport/electricalConductivity.m deleted file mode 100644 index b395fcfad6..0000000000 --- a/interfaces/matlab/toolbox/@Transport/electricalConductivity.m +++ /dev/null @@ -1,17 +0,0 @@ -function v = electricalConductivity(a) -% ELECTRICALCONDUCTIVITY Get the electrical conductivity. -% v = electricalConductivity(a) -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which the electrical conductivity is desired. -% :return: -% Electrical conductivity in S/m -% - -v = trans_get(a.id, 3); -if v == -1.0 - error(geterr); -elseif v < 0.0 - error('exception raised'); -end diff --git a/interfaces/matlab/toolbox/@Transport/mixDiffCoeffs.m b/interfaces/matlab/toolbox/@Transport/mixDiffCoeffs.m deleted file mode 100644 index d50b56ee39..0000000000 --- a/interfaces/matlab/toolbox/@Transport/mixDiffCoeffs.m +++ /dev/null @@ -1,26 +0,0 @@ -function v = mixDiffCoeffs(a) -% MIXDIFFCOEFFS Get the mixture-averaged diffusion coefficients. -% v = mixDiffCoeffs(a) -% Object ``a`` must belong to a class derived from -% Transport, and that was constructed using a model that implements -% mixture-averaged transport properties. If not, you will get the error message :: -% -% **** Method getMixDiffCoeffs not implemented. **** -% -% In this case, create a new gas mixture model that uses a mixture-averaged -% transport manager, for example:: -% -% >> gas = GRI30('mixture-averaged'); -% -% See also: :mat:func:`MultiDiffCoeffs` -% -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which mixture-averaged diffusion coefficients are desired. -% :return: -% Vector of length nSpecies with the mixture-averaged diffusion -% coefficients. Units: m**2/s -% - -v = trans_get(a.id, 11, nSpecies(a.th)); diff --git a/interfaces/matlab/toolbox/@Transport/multiDiffCoeffs.m b/interfaces/matlab/toolbox/@Transport/multiDiffCoeffs.m deleted file mode 100644 index 2fdf2abd06..0000000000 --- a/interfaces/matlab/toolbox/@Transport/multiDiffCoeffs.m +++ /dev/null @@ -1,29 +0,0 @@ -function v = multiDiffCoeffs(a) -% MULTIDIFFCOEFFS Get the multicomponent diffusion coefficients. -% v = multiDiffCoeffs(a) -% Object ``a`` must belong to a class derived from -% Transport, and that was constructed by specifying the ``'multicomponent'`` -% option. If ``'multicomponent'`` was not specified, you will get the -% error message :: -% -% **** Method getMultiDiffCoeffs not implemented. **** -% -% In this case, try method :mat:func:`mixDiffCoeffs`, or create a -% new gas mixture model that uses a mixture-averaged transport manager, -% for example:: -% -% >> gas = GRI30('multicompnent'); -% -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which multicomponent diffusion coefficients are desired. -% :return: -% Matrix of size [nSpecies, nSpecies] with the multicomponent -% diffusion coefficients D(i,j), the diffusion coefficient for -% species i due to concentration gradients in species j. -% Units: m^2/s -% - -v = trans_get(a.id, 22, nSpecies(a.th)); - diff --git a/interfaces/matlab/toolbox/@Transport/private/trans_get.m b/interfaces/matlab/toolbox/@Transport/private/trans_get.m deleted file mode 100644 index a7e06fff29..0000000000 --- a/interfaces/matlab/toolbox/@Transport/private/trans_get.m +++ /dev/null @@ -1,14 +0,0 @@ -function v = trans_get(n, job, a, b, c, d) -% TRANS_GET - get transport attributes -% -if nargin == 2 - v = ctmethods(50, n, job); -elseif nargin == 3 - v = ctmethods(50, n, job, a); -elseif nargin == 4 - v = ctmethods(50, n, job, a, b); -elseif nargin == 5 - v = ctmethods(50, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(50, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@Transport/setThermalConductivity.m b/interfaces/matlab/toolbox/@Transport/setThermalConductivity.m deleted file mode 100644 index 49b1e21b96..0000000000 --- a/interfaces/matlab/toolbox/@Transport/setThermalConductivity.m +++ /dev/null @@ -1,15 +0,0 @@ -function setThermalConductivity(tr, lam) -% SETTHERMALCONDUCTIVITY Set the thermal conductivity. -% setThermalConductivity(tr, lam) -% This method can only be used with transport models that -% support directly setting the value of the thermal -% conductivity. -% -% :param tr: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% :param lam: -% Thermal conductivity in W/(m-K) -% - -setParameters(tr, 1, 0, lam); diff --git a/interfaces/matlab/toolbox/@Transport/thermalConductivity.m b/interfaces/matlab/toolbox/@Transport/thermalConductivity.m deleted file mode 100644 index d22c54fc43..0000000000 --- a/interfaces/matlab/toolbox/@Transport/thermalConductivity.m +++ /dev/null @@ -1,17 +0,0 @@ -function v = thermalConductivity(a) -% THERMALCONDUCTIVITY Get the thermal conductivity. -% v = thermalConductivity(a) -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which the thermal conductivity is desired. -% :return: -% Thermal conductivity. Units: W/m-K -% - -v = trans_get(a.id, 2); -if v == -1.0 - error(geterr); -elseif v < 0.0 - error('exception raised'); -end diff --git a/interfaces/matlab/toolbox/@Transport/thermalDiffCoeffs.m b/interfaces/matlab/toolbox/@Transport/thermalDiffCoeffs.m deleted file mode 100644 index fc0f1fca56..0000000000 --- a/interfaces/matlab/toolbox/@Transport/thermalDiffCoeffs.m +++ /dev/null @@ -1,17 +0,0 @@ -function v = thermalDiffCoeffs(a) -% THERMALDIFFCOEFFS Get the thermal diffusion coefficients. -% v = thermalDiffCoeffs(a) -% Object ``a`` must belong to a class derived from -% Transport, and that was constructed by specifying the ``'multicomponent'`` -% option. If ``'multicomponent'`` was not specified, the returned values will -% all be zero. -% -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which the thermal diffusion coefficients are desired. -% :return: -% Vector of thermal diffusion coefficients of length nSpecies -% - -v = trans_get(a.id, 12, nSpecies(a.th)); diff --git a/interfaces/matlab/toolbox/@Transport/trans_hndl.m b/interfaces/matlab/toolbox/@Transport/trans_hndl.m deleted file mode 100644 index 3cb0b0efbe..0000000000 --- a/interfaces/matlab/toolbox/@Transport/trans_hndl.m +++ /dev/null @@ -1,12 +0,0 @@ -function n = trans_hndl(a) -% TRANS_HNDL Get the integer used to access the kernel object. -% n = trans_hndl(a) -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which the handle is desired. -% :return: -% Integer used to access the kernel object -% - -n = a.id; diff --git a/interfaces/matlab/toolbox/@Transport/viscosity.m b/interfaces/matlab/toolbox/@Transport/viscosity.m deleted file mode 100644 index 609eced8a4..0000000000 --- a/interfaces/matlab/toolbox/@Transport/viscosity.m +++ /dev/null @@ -1,17 +0,0 @@ -function v = viscosity(a) -% VISCOSITY Get the dynamic viscosity. -% v = viscosity(a) -% :param a: -% Instance of class :mat:func:`Transport` (or another -% object derived from Transport) -% for which the viscosity is desired. -% :return: -% Dynamic viscosity. Units: Pa*s -% - -v = trans_get(a.id, 1); -if v == -1.0 - error(geterr); -elseif v < 0.0 - error('exception raised'); -end diff --git a/interfaces/matlab/toolbox/@Wall/Wall.m b/interfaces/matlab/toolbox/@Wall/Wall.m deleted file mode 100644 index 01c0e96ce5..0000000000 --- a/interfaces/matlab/toolbox/@Wall/Wall.m +++ /dev/null @@ -1,119 +0,0 @@ -function x = Wall(left, right, area, k, u, q, v) -% WALL Wall class constructor. -% x = Wall(left, right, area, k, u, q, v) -% A Wall separates two reactors, or a reactor and a reservoir. A wall has a -% finite area, may conduct heat between the two reactors on either -% side, and may move like a piston. -% -% Walls are stateless objects in Cantera, meaning that no differential -% equation is integrated to determine any wall property. Since it is the wall -% (piston) velocity that enters the energy equation, this means that it is -% the velocity, not the acceleration or displacement, that is specified. -% The wall velocity is computed from -% -% .. math:: v = K(P_{\rm left} - P_{\rm right}) + v_0(t), -% -% where :math:`K` is a non-negative constant, and :math:`v_0(t)` is a -% specified function of time. The velocity is positive if the wall is -% moving to the right. -% -% The heat flux through the wall is computed from -% -% .. math:: q = U(T_{\rm left} - T_{\rm right}) + q_0(t), -% -% where :math:`U` is the overall heat transfer coefficient for -% conduction/convection. The function -% :math:`q_0(t)` is a specified function of time. The heat flux is positive -% when heat flows from the reactor on the left to the reactor on the right. -% -% Note: all of the arguments are optional and can be activated after initial -% construction by using the various methods of the :mat:func:`Wall` class. -% Any improperly specified arguments will generate warnings; these can be ignored -% if the intention was to not use a particular argument. Thus, the velocity of -% the wall can be set by using empty strings or 0.0 for each of the arguments before -% the velocity with no harm. -% -% :param left: -% Instance of class :mat:func:`Reactor` to be used as the bulk phase on -% the left side of the wall. See :mat:func:`install` -% :param right: -% Instance of class :mat:func:`Reactor` to be used as the bulk phase on -% the right side of the wall. See :mat:func:`install` -% :param area: -% The area of the wall in m**2. See :mat:func:`area` and :mat:func:`setArea`. -% Defaults to 1.0 m**2 if not specified. -% :param k: -% Expansion rate coefficient in m/(s-Pa). See :mat:func:`setExpansionRateCoeff` -% and :mat:func:`vdot`. Defaults to 0.0 if not specified. -% :param u: -% Heat transfer coefficient in W/(m**2-K). See :mat:func:`setHeatTransferCoeff` -% and :mat:func:`qdot`. Defaults to 0.0 if not specified. -% :param q: -% Heat flux in W/m**2. Must be an instance of :mat:func:`Func`. See -% :mat:func:`setHeatFlux` and :mat:func:`qdot`. Defaults to 0.0 if not specified. -% :param v: -% Velocity of the wall in m/s. Must be an instance of :mat:func:`Func`. See -% :mat:func:`setVelocity` and :mat:func:`vdot`. Defaults to 0.0 if not specified. -% :return: -% Instance of class :mat:func:`Wall` - -% At the moment, only one wall type is implemented -typ = 'Wall'; - -x.type = char(typ); -x.index = wallmethods(0, x.type); -if x.index < 0 - error(geterr); -end -x.left = -1; -x.right = -1; -x = class(x, 'Wall'); - -if nargin >= 2 - if isa(left, 'Reactor') && isa(right, 'Reactor') - install(x, left, right); - else - warning(['left and/or right were not instances of Reactor, ' ... - 'and were not installed.']) - end -end - -if nargin >= 3 - if isnumeric(area) - setArea(x, area); - else - warning('area was not a number and the area was not set') - end -end - -if nargin >= 4 - if isnumeric(k) - setExpansionRateCoeff(x, k); - else - warning('k was not a number and the expansion rate coefficient was not set') - end -end - -if nargin >= 5 - if isnumeric(u) - setHeatTransferCoeff(x, u); - else - warning('u was not a number and the expansion rate coefficient was not set') - end -end - -if nargin >= 6 - if isa(q, 'Func') - setHeatFlux(x, q); - else - warning('q was not an instance of Func and was not set') - end -end - -if nargin >= 7 - if isa(v, 'Func') - setVelocity(x, v) - else - warning('v was not an instance of Func and was not set') - end -end diff --git a/interfaces/matlab/toolbox/@Wall/area.m b/interfaces/matlab/toolbox/@Wall/area.m deleted file mode 100644 index cc536f43d4..0000000000 --- a/interfaces/matlab/toolbox/@Wall/area.m +++ /dev/null @@ -1,10 +0,0 @@ -function a = area(w) -% AREA Get the area of the wall. -% a = area(w) -% :param w: -% Instance of class :mat:func:`Wall` -% :return: -% Area of the wall in m**2 -% - -a = wallmethods(23, wall_hndl(w)); diff --git a/interfaces/matlab/toolbox/@Wall/clear.m b/interfaces/matlab/toolbox/@Wall/clear.m deleted file mode 100644 index 77bf176bc7..0000000000 --- a/interfaces/matlab/toolbox/@Wall/clear.m +++ /dev/null @@ -1,8 +0,0 @@ -function clear(w) -% CLEAR Delete the C++ Wall object. -% clear(w) -% :param w: -% Instance of class :mat:func:`Wall` -% - -wallmethods(1, w.index); diff --git a/interfaces/matlab/toolbox/@Wall/install.m b/interfaces/matlab/toolbox/@Wall/install.m deleted file mode 100644 index 1647e71633..0000000000 --- a/interfaces/matlab/toolbox/@Wall/install.m +++ /dev/null @@ -1,16 +0,0 @@ -function install(w, left, right) -% INSTALL Install a wall between two reactors. -% install(w, left, right) -% :param w: -% Instance of class :mat:func:`Wall` -% :param left: -% Instance of class :mat:func:`Reactor`or -% :mat:func:`Reservoir` -% :param right: -% Instance of class :mat:func:`Reactor` or -% :mat:func:`Reservoir` -% - -w.left = left; -w.right = right; -wallmethods(4, wall_hndl(w), reactor_hndl(left), reactor_hndl(right)); diff --git a/interfaces/matlab/toolbox/@Wall/private/wallmethods.m b/interfaces/matlab/toolbox/@Wall/private/wallmethods.m deleted file mode 100644 index fd059cffcb..0000000000 --- a/interfaces/matlab/toolbox/@Wall/private/wallmethods.m +++ /dev/null @@ -1,13 +0,0 @@ -function v = wallmethods(n, job, a, b, c, d) -% -if nargin == 2 - v = ctmethods(70, n, job); -elseif nargin == 3 - v = ctmethods(70, n, job, a); -elseif nargin == 4 - v = ctmethods(70, n, job, a, b); -elseif nargin == 5 - v = ctmethods(70, n, job, a, b, c); -elseif nargin == 6 - v = ctmethods(70, n, job, a, b, c, d); -end diff --git a/interfaces/matlab/toolbox/@Wall/qdot.m b/interfaces/matlab/toolbox/@Wall/qdot.m deleted file mode 100644 index ff7e6c13bb..0000000000 --- a/interfaces/matlab/toolbox/@Wall/qdot.m +++ /dev/null @@ -1,15 +0,0 @@ -function q = qdot(w, t) -% QDOT Get the total heat transfer through a wall given a time. -% q = qdot(w, t) -% A positive value corresponds to heat flowing from the left-hand -% reactor to the right-hand one. -% -% :param w: -% Instance of class :mat:func:`Wall` -% :param t: -% Time at which the heat transfer should be evaluated. -% :return: -% Total heat transfer. Units: W -% - -q = wallmethods(22, wall_hndl(w), t); diff --git a/interfaces/matlab/toolbox/@Wall/ready.m b/interfaces/matlab/toolbox/@Wall/ready.m deleted file mode 100644 index a1f3c47271..0000000000 --- a/interfaces/matlab/toolbox/@Wall/ready.m +++ /dev/null @@ -1,10 +0,0 @@ -function ok = ready(w) -% READY Check whether a wall is ready. -% ok = ready(w) -% :param w: -% Instance of class :mat:func:`Wall` -% :return: -% Status of the wall -% - -ok = wallmethods(11, wall_hndl(w)); diff --git a/interfaces/matlab/toolbox/@Wall/setArea.m b/interfaces/matlab/toolbox/@Wall/setArea.m deleted file mode 100644 index ec0b18fe9b..0000000000 --- a/interfaces/matlab/toolbox/@Wall/setArea.m +++ /dev/null @@ -1,10 +0,0 @@ -function setArea(w, a) -% SETAREA Set the area of a wall. -% setArea(w, a) -% :param w: -% Instance of class :mat:func:`Wall` -% :param a: -% Double area of the wall. -% - -wallmethods(5, wall_hndl(w), a); diff --git a/interfaces/matlab/toolbox/@Wall/setExpansionRateCoeff.m b/interfaces/matlab/toolbox/@Wall/setExpansionRateCoeff.m deleted file mode 100644 index 9d7692eae1..0000000000 --- a/interfaces/matlab/toolbox/@Wall/setExpansionRateCoeff.m +++ /dev/null @@ -1,20 +0,0 @@ -function setExpansionRateCoeff(w, k) -% SETEXPANSIONRATECOEFF Set the expansion rate coefficient. -% setExpansionRateCoeff(w, k) -% The expansion rate coefficient -% determines the velocity of the wall for a given pressure -% differential between the left and right reactors, according to the -% formula -% -% .. math:: v = K(P_{left}-P_{right}) -% -% where :math:`v` is velocity, :math:`K` is the expansion rate -% coefficient, and :math:`P` is the pressure. -% -% :param w: -% Instance of class :mat:func:`Wall` -% :param k: -% Double, wall expansion rate coefficient. Units: m/(s-Pa) -% - -wallmethods(9, wall_hndl(w), k); diff --git a/interfaces/matlab/toolbox/@Wall/setHeatFlux.m b/interfaces/matlab/toolbox/@Wall/setHeatFlux.m deleted file mode 100644 index 6fabd5b15d..0000000000 --- a/interfaces/matlab/toolbox/@Wall/setHeatFlux.m +++ /dev/null @@ -1,24 +0,0 @@ -function setHeatFlux(w, f) -% SETHEATFLUX Set the heat flux using :mat:func:`Func` -% setHeatFlux(w, f) -% Must be set by an instance of -% class :mat:func:`Func`, which allows the heat flux to be an -% arbitrary function of time. It is possible to specify -% a constant heat flux by using the polynomial functor with -% only the first term specified: -% -% .. code-block:: matlab -% -% w = Wall() -% f = Func('polynomial',0,10); % Or f = polynom(10); -% setHeatFlux(w, f); -% -% sets the heat flux through the wall to 10 W/m**2. -% -% :param w: -% Instance of class :mat:func:`Wall` -% :param f: -% Instance of class :mat:func:`Func`. Units: W/m**2 -% - -wallmethods(8, wall_hndl(w), func_hndl(f)); diff --git a/interfaces/matlab/toolbox/@Wall/setHeatTransferCoeff.m b/interfaces/matlab/toolbox/@Wall/setHeatTransferCoeff.m deleted file mode 100644 index 3b9f76fa88..0000000000 --- a/interfaces/matlab/toolbox/@Wall/setHeatTransferCoeff.m +++ /dev/null @@ -1,10 +0,0 @@ -function setHeatTransferCoeff(w, u) -% SETHEATTRANSFERCOEFF Set the heat transfer coefficient. -% setHeatTransferCoeff(w, u) -% :param w: -% Instance of class :mat:func:`Wall` -% :param u: -% Heat transfer coefficient of the wall. Units: W/(m**2-K) -% - -wallmethods(7, wall_hndl(w), u); diff --git a/interfaces/matlab/toolbox/@Wall/setThermalResistance.m b/interfaces/matlab/toolbox/@Wall/setThermalResistance.m deleted file mode 100644 index 525afab857..0000000000 --- a/interfaces/matlab/toolbox/@Wall/setThermalResistance.m +++ /dev/null @@ -1,10 +0,0 @@ -function setThermalResistance(w, r) -% SETTHERMALRESISTANCE Set the thermal resistance. -% setThermalResistance(w, r) -% :param w: -% Instance of class :mat:func:`Wall` -% :param r: -% Double, thermal resistance. Units: K*m**2/W -% - -wallmethods(6, wall_hndl(w), r) diff --git a/interfaces/matlab/toolbox/@Wall/setVelocity.m b/interfaces/matlab/toolbox/@Wall/setVelocity.m deleted file mode 100644 index bb64b62ed5..0000000000 --- a/interfaces/matlab/toolbox/@Wall/setVelocity.m +++ /dev/null @@ -1,23 +0,0 @@ -function setVelocity(w, f) -% SETVELOCITY Set the velocity of the wall using :mat:func:`Func`. -% setVelocity(w, f) -% Must be set by an instance of class :mat:func:`Func`, which allows -% the velocity to be an arbitrary function of time. It is possible -% to specify a constant velocity by using the polynomial functor with -% only the first term specified: -% -% .. code-block:: matlab -% -% w = Wall() -% f = Func('polynomial',0,10); % Or f = polynom(10); -% setVelocity(w, f); -% -% sets the velocity of the wall to 10 m/s. -% -% :param w: -% Instance of class :mat:func:`Wall` -% :param f: -% Instance of class :mat:func:`Func`. Units: m/s -% - -wallmethods(10, wall_hndl(w), func_hndl(f)); diff --git a/interfaces/matlab/toolbox/@Wall/vdot.m b/interfaces/matlab/toolbox/@Wall/vdot.m deleted file mode 100644 index b9cce2aee9..0000000000 --- a/interfaces/matlab/toolbox/@Wall/vdot.m +++ /dev/null @@ -1,15 +0,0 @@ -function v = vdot(w, t) -% VDOT Get the rate of volumetric change at a given time. -% v = vdot(w, t) -% A positive value corresponds to the left-hand reactor volume -% increasing, and the right-hand reactor volume decreasing. -% -% :param w: -% Instance of class :mat:func:`Wall` -% :param t: -% Time at which the volumetric change should be calculated. -% :return: -% Rate of volumetric change Units: m**3/s -% - -v = wallmethods(21, wall_hndl(w), t); diff --git a/interfaces/matlab/toolbox/@Wall/wall_hndl.m b/interfaces/matlab/toolbox/@Wall/wall_hndl.m deleted file mode 100644 index d5eecb267d..0000000000 --- a/interfaces/matlab/toolbox/@Wall/wall_hndl.m +++ /dev/null @@ -1,11 +0,0 @@ -function i = wall_hndl(w) -% WALL_HNDL Get the integer used to access the kernel object. -% i = wall_hndl(w) -% :param w: -% Instance of class :mat:func:`Wall` -% for which the handle is desired. -% :return: -% Integer used to access the kernel object -% - -i = w.index; diff --git a/interfaces/matlab/toolbox/Air.m b/interfaces/matlab/toolbox/Air.m deleted file mode 100644 index 3625a7be12..0000000000 --- a/interfaces/matlab/toolbox/Air.m +++ /dev/null @@ -1,12 +0,0 @@ -function gas = Air() -% AIR Create an object representing air. -% gas = Air() -% Air is modeled as an ideal gas mixture. The specification is taken -% from file ``air.yaml``. Several reactions among oxygen and nitrogen are -% defined. Mixture-averaged transport is specified by default. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -gas = Solution('air.yaml', 'air'); diff --git a/interfaces/matlab/toolbox/CarbonDioxide.m b/interfaces/matlab/toolbox/CarbonDioxide.m deleted file mode 100644 index 4bdd62ffb7..0000000000 --- a/interfaces/matlab/toolbox/CarbonDioxide.m +++ /dev/null @@ -1,20 +0,0 @@ -function c = CarbonDioxide() -% CARBONDIOXIDE Return an object representing carbon dioxide. -% c = CarbonDioxide -% The object returned by this method implements an accurate equation of -% state for carbon dioxide that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances.* Stanford: Stanford -% University, 1979. Print. -% -% For more details, see classes Cantera::PureFluid and tpx::CarbonDioxide in the -% Cantera C++ source code documentation. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -c = Solution('liquidvapor.yaml', 'carbon-dioxide'); diff --git a/interfaces/matlab/toolbox/ConstPressureReactor.m b/interfaces/matlab/toolbox/ConstPressureReactor.m deleted file mode 100644 index 45c80acd85..0000000000 --- a/interfaces/matlab/toolbox/ConstPressureReactor.m +++ /dev/null @@ -1,26 +0,0 @@ -function r = ConstPressureReactor(contents) -% CONSTPRESSUREREACTOR Create a constant pressure reactor object. -% r = ConstPressureReactor(contents) -% A :mat:func:`ConstPressureReactor` is an instance of class -% :mat:func:`Reactor` where the pressure is held constant. The volume -% is not a state variable, but instead takes on whatever value is -% consistent with holding the pressure constant. Examples: -% -% .. code-block:: matlab -% -% r1 = ConstPressureReactor % an empty reactor -% r2 = ConstPressureReactor(contents) % a reactor containing contents -% -% See also: :mat:func:`Reactor` -% -% :param contents: -% Cantera :mat:func:`Solution` to be set as the contents of the -% reactor -% :return: -% Instance of class :mat:func:`Reactor` -% - -if nargin == 0 - contents = 0; -end -r = Reactor(contents, 'ConstPressureReactor'); diff --git a/interfaces/matlab/toolbox/FlowReactor.m b/interfaces/matlab/toolbox/FlowReactor.m deleted file mode 100644 index c1b6a16e65..0000000000 --- a/interfaces/matlab/toolbox/FlowReactor.m +++ /dev/null @@ -1,24 +0,0 @@ -function r = FlowReactor(contents) -% FLOWREACTOR Create a flow reactor object. -% r = FlowReactor(contents) -% A reactor representing adiabatic plug flow in a constant-area -% duct. Examples: -% -% .. code-block:: matlab -% -% r1 = FlowReactor % an empty reactor -% r2 = FlowReactor(gas) % a reactor containing a gas -% -% See also: :mat:func:`Reactor` -% -% :param contents: -% Cantera :mat:func:`Solution` to be set as the contents of the -% reactor -% :return: -% Instance of class :mat:func:`Reactor` -% - -if nargin == 0 - contents = 0; -end -r = Reactor(contents, 'FlowReactor'); diff --git a/interfaces/matlab/toolbox/GRI30.m b/interfaces/matlab/toolbox/GRI30.m deleted file mode 100644 index 692628d1c1..0000000000 --- a/interfaces/matlab/toolbox/GRI30.m +++ /dev/null @@ -1,39 +0,0 @@ -function s = GRI30(tr) -% GRI30 Create an object with the GRI-Mech 3.0 reaction mechanism. -% s = GRI30(tr) -% Create a Solution instance representing -% reaction mechanism GRI-Mech 3.0. -% -% GRI-Mech 3.0 is a widely-used reaction mechanism for natural gas -% combustion. It contains 53 species composed of the elements H, -% C, O, N, and/or Ar, and 325 reactions, most of which are -% reversible. GRI-Mech 3.0, like most combustion mechanisms, is -% designed for use at pressures where the ideal gas law holds. -% GRI-Mech 3.0 is available from http://www.me.berkeley.edu/gri_mech/ -% -% Function :mat:func:`GRI30` creates the solution according to the -% specifications in file gri30.yaml. The ideal gas equation of -% state is used. Transport property evaluation is mixture-averaged by -% default. To change or disable transport properties, supply the name of -% the transport model to use. -% -% .. code-block:: matlab -% -% g1 = GRI30 % mixture-averaged transport properties -% g2 = GRI30('mixture-averaged') % mixture-averaged transport properties -% g3 = GRI30('multicomponent') % miulticomponent transport properties -% g4 = GRI30('none') % no transport properties -% -% :param tr: -% Transport modeling, ``'none'``, ``'mixture-averaged'``, or ``'multicomponent'`` -% :return: -% Instance of class :mat:func:`Solution` -% - -if nargin == 0 - s = Solution('gri30.yaml', 'gri30'); -elseif nargin == 1 - s = Solution('gri30.yaml', 'gri30', tr); -else - error('Wrong number of arguments.'); -end diff --git a/interfaces/matlab/toolbox/HFC134a.m b/interfaces/matlab/toolbox/HFC134a.m deleted file mode 100644 index 61aa00d3cb..0000000000 --- a/interfaces/matlab/toolbox/HFC134a.m +++ /dev/null @@ -1,21 +0,0 @@ -function h = HFC134a() -% HFC134A Return an object representing refrigerant HFC134a. -% h = HFC134a() -% The object returned by this method implements an accurate equation of -% state for refrigerant HFC134a (R134a) that can be used in the liquid, -% vapor, saturated liquid/vapor, and supercritical regions of the phase -% diagram. Implements the equation of state given in: -% R. Tillner-Roth and H. D. Baehr. "An International Standard Formulation for -% The Thermodynamic Properties of 1,1,1,2-Tetrafluoroethane (HFC-134a) for -% Temperatures From 170 K to 455 K and Pressures up to 70 MPa". J. Phys. -% Chem. Ref. Data, Vol. 23, No. 5, 1994. pp. 657--729. -% http://dx.doi.org/10.1063/1.555958 -% -% For more details, see classes Cantera::PureFluid and tpx::HFC134a in the -% Cantera C++ source code documentation. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -h = Solution('liquidvapor.yaml', 'HFC-134a'); diff --git a/interfaces/matlab/toolbox/Heptane.m b/interfaces/matlab/toolbox/Heptane.m deleted file mode 100644 index c6d01267fa..0000000000 --- a/interfaces/matlab/toolbox/Heptane.m +++ /dev/null @@ -1,20 +0,0 @@ -function h = Heptane() -% HEPTANE Return an object representing n-heptane. -% h = Heptane() -% The object returned by this method implements an accurate equation of -% state for n-heptane that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances.* Stanford: Stanford -% University, 1979. Print. -% -% For more details, see classes Cantera::PureFluid and tpx::Heptane in the -% Cantera C++ source code documentation. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -h = Solution('liquidvapor.yaml', 'heptane'); diff --git a/interfaces/matlab/toolbox/Hydrogen.m b/interfaces/matlab/toolbox/Hydrogen.m deleted file mode 100644 index 45360a9325..0000000000 --- a/interfaces/matlab/toolbox/Hydrogen.m +++ /dev/null @@ -1,20 +0,0 @@ -function h = Hydrogen() -% HYDROGEN Return an object representing hydrogen. -% h = Hydrogen() -% The object returned by this method implements an accurate equation of -% state for hydrogen that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances* Stanford: Stanford -% University, 1979. Print. -% -% For more details, see classes Cantera::PureFluid and tpx::hydrogen in the -% Cantera C++ source code documentation. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -h = Solution('liquidvapor.yaml', 'hydrogen'); diff --git a/interfaces/matlab/toolbox/IdealGasConstPressureReactor.m b/interfaces/matlab/toolbox/IdealGasConstPressureReactor.m deleted file mode 100644 index 89b13f3ef7..0000000000 --- a/interfaces/matlab/toolbox/IdealGasConstPressureReactor.m +++ /dev/null @@ -1,28 +0,0 @@ -function r = IdealGasConstPressureReactor(contents) -% IDEALGASCONSTPRESSUREREACTOR Create a constant pressure reactor with an ideal gas. -% r = IdealGasConstPressureReactor(contents) -% An IdealGasConstPressureReactor is an instance of class Reactor where the -% pressure is held constant. The volume is not a state variable, but -% instead takes on whatever value is consistent with holding the pressure -% constant. Additionally, its governing equations are specialized for the -% ideal gas equation of state (and do not work correctly with other -% thermodynamic models). Examples: -% -% .. code-block:: matlab -% -% r1 = IdealGasConstPressureReactor % an empty reactor -% r2 = IdealGasConstPressureReactor(gas) % a reactor containing a gas -% -% See also: :mat:func:`Reactor` -% -% :param contents: -% Cantera :mat:func:`Solution` to be set as the contents of the -% reactor -% :return: -% Instance of class :mat:func:`Reactor` -% - -if nargin == 0 - contents = 0; -end -r = Reactor(contents, 'IdealGasConstPressureReactor'); diff --git a/interfaces/matlab/toolbox/IdealGasReactor.m b/interfaces/matlab/toolbox/IdealGasReactor.m deleted file mode 100644 index 769daf68b0..0000000000 --- a/interfaces/matlab/toolbox/IdealGasReactor.m +++ /dev/null @@ -1,25 +0,0 @@ -function r = IdealGasReactor(contents) -% IDEALGASREACTOR Create a reactor with an ideal gas. -% r = IdealGasReactor(contents) -% An IdealGasReactor is an instance of class Reactor where the governing -% equations are specialized for the ideal gas equation of state (and do not -% work correctly with other thermodynamic models). Examples: -% -% .. code-block:: matlab -% -% r1 = IdealGasReactor % an empty reactor -% r2 = IdealGasReactor(gas) % a reactor containing a gas -% -% See also: :mat:func:`Reactor` -% -% :param contents: -% Cantera :mat:func:`Solution` to be set as the contents of the -% reactor -% :return: -% Instance of class :mat:func:`Reactor` -% - -if nargin == 0 - contents = 0; -end -r = Reactor(contents, 'IdealGasReactor'); diff --git a/interfaces/matlab/toolbox/MassFlowController.m b/interfaces/matlab/toolbox/MassFlowController.m deleted file mode 100644 index e006cf9629..0000000000 --- a/interfaces/matlab/toolbox/MassFlowController.m +++ /dev/null @@ -1,25 +0,0 @@ -function m = MassFlowController(upstream, downstream) -% MASSFLOWCONTROLLER Create a mass flow controller. -% m = MassFlowController(upstream, downstream) -% Creates an instance of class :mat:func:`FlowDevice` configured to -% simulate a mass flow controller that maintains a constant mass flow -% rate independent of upstream or downstream conditions. If two reactor -% objects are supplied as arguments, the controller is installed -% between the two reactors. Otherwise, the :mat:func:`install` method -% should be used to install the :mat:func:`MassFlowController` between -% reactors. -% -% see also: :mat:func:`FlowDevice`, :mat:func:`Valve` -% -% :param upstream: -% Upstream :mat:func:`Reactor` or :mat:func:`Reservoir` -% :param downstream: -% Downstream :mat:func:`Reactor` or :mat:func:`Reservoir` -% :return: -% Instance of class :mat:func:`FlowDevice` -% - -m = FlowDevice('MassFlowController'); -if nargin == 2 - install(m, upstream, downstream) -end diff --git a/interfaces/matlab/toolbox/Methane.m b/interfaces/matlab/toolbox/Methane.m deleted file mode 100644 index 432658f55f..0000000000 --- a/interfaces/matlab/toolbox/Methane.m +++ /dev/null @@ -1,17 +0,0 @@ -function m = Methane() -% METHANE Return an object representing methane. -% m = Methane() -% The object returned by this method implements an accurate equation of -% state for methane that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances* Stanford: Stanford -% University, 1979. Print. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -m = Solution('liquidvapor.yaml', 'methane'); diff --git a/interfaces/matlab/toolbox/Nitrogen.m b/interfaces/matlab/toolbox/Nitrogen.m deleted file mode 100644 index bbc1276d60..0000000000 --- a/interfaces/matlab/toolbox/Nitrogen.m +++ /dev/null @@ -1,17 +0,0 @@ -function n = Nitrogen() -% NITROGEN Return an object representing nitrogen. -% n = Nitrogen() -% The object returned by this method implements an accurate equation of -% state for nitrogen that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances* Stanford: Stanford -% University, 1979. Print. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -n = Solution('liquidvapor.yaml', 'nitrogen'); diff --git a/interfaces/matlab/toolbox/Oxygen.m b/interfaces/matlab/toolbox/Oxygen.m deleted file mode 100644 index 85c37973ba..0000000000 --- a/interfaces/matlab/toolbox/Oxygen.m +++ /dev/null @@ -1,17 +0,0 @@ -function o = Oxygen() -% OXYGEN Return an object representing oxygen. -% o = Oxygen() -% The object returned by this method implements an accurate equation of -% state for oxygen that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances* Stanford: Stanford -% University, 1979. Print. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -o = Solution('liquidvapor.yaml', 'oxygen'); diff --git a/interfaces/matlab/toolbox/Reservoir.m b/interfaces/matlab/toolbox/Reservoir.m deleted file mode 100644 index f27c4d5c1c..0000000000 --- a/interfaces/matlab/toolbox/Reservoir.m +++ /dev/null @@ -1,30 +0,0 @@ -function r = Reservoir(contents) -% RESERVOIR Create a Reservoir object. -% r = Reservoir(contents) -% A :mat:func:`Reservoir` is an instance of class :mat:func:`Reactor` -% configured so that its intensive state is constant in time. A -% reservoir may be thought of as infinite in extent, perfectly mixed, -% and non-reacting, so that fluid may be extracted or added without -% changing the composition or thermodynamic state. Note that even -% if the reaction mechanism associated with the fluid in the -% reactor defines reactions, they are disabled within -% reservoirs. Examples: -% -% .. code-block:: matlab -% -% r1 = Reservoir % an empty reservoir -% r2 = Reservoir(gas) % a reservoir containing a gas -% -% See also: :mat:func:`Reactor` -% -% :param contents: -% Cantera :mat:func:`Solution` to be set as the contents of the -% reactor -% :return: -% Instance of class :mat:func:`Reactor` -% - -if nargin == 0 - contents = 0; -end -r = Reactor(contents, 'Reservoir'); diff --git a/interfaces/matlab/toolbox/Valve.m b/interfaces/matlab/toolbox/Valve.m deleted file mode 100644 index 029dc43aec..0000000000 --- a/interfaces/matlab/toolbox/Valve.m +++ /dev/null @@ -1,36 +0,0 @@ -function v = Valve(upstream, downstream) -% VALVE Create a valve. -% v = Valve(upstream, downstream) -% Create an instance of class :mat:func:`FlowDevice` configured to -% simulate a valve that produces a flow rate proportional to the -% pressure difference between the upstream and downstream reactors. -% -% The mass flow rate [kg/s] is computed from the expression -% -% .. math:: \dot{m} = K(P_{upstream} - P_{downstream}) -% -% as long as this produces a positive value. If this expression is -% negative, zero is returned. Therefore, the :mat:func:`Valve` object -% acts as a check valve - flow is always from the upstream reactor to -% the downstream one. Note: as currently implemented, the Valve object -% does not model real valve characteristics - in particular, it -% does not model choked flow. The mass flow rate is always assumed -% to be linearly proportional to the pressure difference, no matter how -% large the pressure difference. THIS MAY CHANGE IN A FUTURE -% RELEASE. -% -% see also: :mat:func:`FlowDevice`, :mat:func:`MassFlowController` -% -% :param upstream: -% Upstream reactor or reservoir -% :param downstream: -% Downstream Reactor or reservoir -% -% :return: -% Instance of class :mat:func:`FlowDevice` -% - -v = FlowDevice('Valve'); -if nargin == 2 - install(v, upstream, downstream) -end diff --git a/interfaces/matlab/toolbox/Water.m b/interfaces/matlab/toolbox/Water.m deleted file mode 100644 index 8988af881c..0000000000 --- a/interfaces/matlab/toolbox/Water.m +++ /dev/null @@ -1,20 +0,0 @@ -function w = Water() -% WATER Return an object representing water. -% w = Water() -% The object returned by this method implements an accurate equation of -% state for water that can be used in the liquid, vapor, saturated -% liquid/vapor, and supercritical regions of the phase diagram. The -% equation of state is taken from -% -% Reynolds, W. C. *Thermodynamic Properties in SI: graphs, tables, and -% computational equations for forty substances.* Stanford: Stanford -% University, 1979. Print. -% -% For more details, see classes Cantera::PureFluid and tpx::water in the -% Cantera C++ source code documentation. -% -% :return: -% Instance of class :mat:func:`Solution` -% - -w = Solution('liquidvapor.yaml', 'water'); diff --git a/interfaces/matlab/toolbox/adddir.m b/interfaces/matlab/toolbox/adddir.m deleted file mode 100644 index 5daee2d576..0000000000 --- a/interfaces/matlab/toolbox/adddir.m +++ /dev/null @@ -1,11 +0,0 @@ -function adddir(d) -% ADDDIR Add a directory to the search path. -% adddir(d) -% Adds directory ``d`` to the set of directories where Cantera looks for -% input and data files. -% -% :param d: -% Path to add to the MATLAB search path. -% - -ctmethods(0, 3, d); diff --git a/interfaces/matlab/toolbox/canteraGitCommit.m b/interfaces/matlab/toolbox/canteraGitCommit.m deleted file mode 100644 index 4e1527d3b2..0000000000 --- a/interfaces/matlab/toolbox/canteraGitCommit.m +++ /dev/null @@ -1,9 +0,0 @@ -function v = canteraGitCommit() -% CANTERAGITCOMMIT Get Cantera Git commit hash -% canteraGitCommit() -% -% :return: -% A string containing the Git commit hash for the current version of Cantera -% - -v = ctmethods(0, 7); diff --git a/interfaces/matlab/toolbox/canteraVersion.m b/interfaces/matlab/toolbox/canteraVersion.m deleted file mode 100644 index 873b08d11d..0000000000 --- a/interfaces/matlab/toolbox/canteraVersion.m +++ /dev/null @@ -1,10 +0,0 @@ -function v = canteraVersion() -% CANTERAVERSION Get Cantera version information -% canteraVersion() -% -% :return: -% A string containing the Cantera version -% - -v = ctmethods(0, 6); - diff --git a/interfaces/matlab/toolbox/cleanup.m b/interfaces/matlab/toolbox/cleanup.m deleted file mode 100644 index 917233f248..0000000000 --- a/interfaces/matlab/toolbox/cleanup.m +++ /dev/null @@ -1,6 +0,0 @@ -function cleanup() -% CLEANUP Delete all stored Cantera objects and reclaim memory. -% cleanup() -% - -ctmethods(0, 4); diff --git a/interfaces/matlab/toolbox/faradayconstant.m b/interfaces/matlab/toolbox/faradayconstant.m deleted file mode 100644 index 9a8b2c1a16..0000000000 --- a/interfaces/matlab/toolbox/faradayconstant.m +++ /dev/null @@ -1,8 +0,0 @@ -function r = faradayconstant -% FARADAYCONSTANT Get the Faraday constant in C/kmol of electron. -% r = faradayconstant -% :return: -% The Faraday constant in C/kmol-e. -% - -r = 96485336.4595687; diff --git a/interfaces/matlab/toolbox/gasconstant.m b/interfaces/matlab/toolbox/gasconstant.m deleted file mode 100644 index 9b98c185bc..0000000000 --- a/interfaces/matlab/toolbox/gasconstant.m +++ /dev/null @@ -1,8 +0,0 @@ -function r = gasconstant -% GASCONSTANT Get the universal gas constant in J/kmol-K. -% r = gasconstant -% :return: -% The universal gas constant in J/kmol-K. -% - -r = 8314.4621; diff --git a/interfaces/matlab/toolbox/gaussian.m b/interfaces/matlab/toolbox/gaussian.m deleted file mode 100644 index 2d1395edeb..0000000000 --- a/interfaces/matlab/toolbox/gaussian.m +++ /dev/null @@ -1,14 +0,0 @@ -function g = gaussian(peak, center, width) -% GAUSSIAN Create a Gaussian :mat:func:`Func` instance. -% g = gaussian(peak, center, width) -% :param peak: -% The peak value -% :param center: -% Value of x at which the peak is located -% :param width: -% Full width at half-maximum. The value of the -% function at center +/- (width)/2 is one-half -% the peak value. -% - -g = Func('gaussian', 0, [peak, center, width]); diff --git a/interfaces/matlab/toolbox/getDataDirectories.m b/interfaces/matlab/toolbox/getDataDirectories.m deleted file mode 100644 index 836bd55a12..0000000000 --- a/interfaces/matlab/toolbox/getDataDirectories.m +++ /dev/null @@ -1,10 +0,0 @@ -function d = getDataDirectories() -% GETDATADIRECTORIES Get a cell array of the directories searched for data files. -% getdatadirectories() -% Get a cell array of the directories Cantera searches for data files -% -% :return: -% Cell array with strings representing the data file search directories -% - -d = strsplit(ctmethods(0, 5, ';'), ';'); diff --git a/interfaces/matlab/toolbox/geterr.m b/interfaces/matlab/toolbox/geterr.m deleted file mode 100644 index aa12eaa356..0000000000 --- a/interfaces/matlab/toolbox/geterr.m +++ /dev/null @@ -1,10 +0,0 @@ -function e = geterr -% GETERR Get the error message from a Cantera error. -% e = geterr -% - -try - e = ctmethods(0,2); % getCanteraError; -catch ME - e = getReport(ME); -end diff --git a/interfaces/matlab/toolbox/importEdge.m b/interfaces/matlab/toolbox/importEdge.m deleted file mode 100644 index f65c539f70..0000000000 --- a/interfaces/matlab/toolbox/importEdge.m +++ /dev/null @@ -1,34 +0,0 @@ -function s = importEdge(file, name, phase1, phase2, phase3, phase4) -% IMPORTEDGE Import edges between phases. -% s = importEdge(file, name, phase1, phase2, phase3, phase4) -% Supports up to four neighbor phases. See -% `edge `__ -% and `Declaring adjacent phases `__. -% -% :param file: -% File containing phases -% :param name: -% Name of phase -% :param phase1: -% First neighbor phase -% :param phase2: -% Second neighbor phase -% :param phase3: -% Third neighbor phase -% :param phase4: -% Fourth neighbor phase -% :return: -% Instance of class :mat:func:`Interface` -% - -if nargin == 3 - s = Interface(file, name, phase1); -elseif nargin == 4 - s = Interface(file, name, phase1, phase2); -elseif nargin == 5 - s = Interface(file, name, phase1, phase2, phase3); -elseif nargin == 6 - s = Interface(file, name, phase1, phase2, phase3, phase4); -else - error('importEdge only supports 4 neighbor phases.'); -end diff --git a/interfaces/matlab/toolbox/importInterface.m b/interfaces/matlab/toolbox/importInterface.m deleted file mode 100644 index 33ebd80269..0000000000 --- a/interfaces/matlab/toolbox/importInterface.m +++ /dev/null @@ -1,26 +0,0 @@ -function s = importInterface(file, name, phase1, phase2) -% IMPORTINTERFACE Import an interface between phases. -% s = importInterface(file, name, phase1, phase2) -% -% See `ideal-surface `__ -% and `Declaring adjacent phases `__. -% -% :param file: -% YAML file containing the interface -% :param name: -% Name of the interface to import -% :param phase1: -% First phase in the interface -% :param phase2: -% Second phase in the interface -% :return: -% Instance of class :mat:func:`Interface` -% - -if nargin == 3 - s = Interface(file, name, phase1); -elseif nargin == 4 - s = Interface(file, name, phase1, phase2); -else - error('importInterface only supports 2 bulk phases'); -end diff --git a/interfaces/matlab/toolbox/oneatm.m b/interfaces/matlab/toolbox/oneatm.m deleted file mode 100644 index be9aef9381..0000000000 --- a/interfaces/matlab/toolbox/oneatm.m +++ /dev/null @@ -1,8 +0,0 @@ -function p = oneatm -% ONEATM Get one atmosphere in Pa. -% p = oneatm -% :return: -% One atmosphere in Pascals. -% - -p = 101325.0; diff --git a/interfaces/matlab/toolbox/polynom.m b/interfaces/matlab/toolbox/polynom.m deleted file mode 100644 index e7b40b47e5..0000000000 --- a/interfaces/matlab/toolbox/polynom.m +++ /dev/null @@ -1,25 +0,0 @@ -function poly = polynom(coeffs) -% POLYNOM Create a polynomial :mat:func:`Func` instance. -% poly = polynom(coeffs) -% The polynomial coefficients are specified by a vector -% ``[a0 a1 .... aN]``. Examples: -% -% .. code-block:: matlab -% -% polynom([-2 6 3]) %3x^2 + 6.0x - 2 -% polynom([1.0 -2.5 0 0 2]) %2x^4 - 2.5x + 1 -% -% :param coeffs: -% Vector of polynomial coefficients -% :return: -% Instance of class :mat:func:`Func` -% - -[n m] = size(coeffs); -if n == 1 - poly = Func('polynomial',m - 1,coeffs); -elseif m == 1 - poly = Func('polynomial',n - 1,coeffs); -else - error('wrong shape for coefficient array'); -end diff --git a/interfaces/matlab/toolbox/useLegacyRateConstants.m b/interfaces/matlab/toolbox/useLegacyRateConstants.m deleted file mode 100644 index 2bb5075492..0000000000 --- a/interfaces/matlab/toolbox/useLegacyRateConstants.m +++ /dev/null @@ -1,14 +0,0 @@ -function v = useLegacyRateConstants(legacy) -% USELEGACYRATECONSTANTS Set definition used for rate constant calculation -% useLegacyRateConstants(0) -% -% If set to 0 (false - default value), rate constants of three-body reactions are -% consistent with conventional definitions (for example Eq. 9.75 in Kee, Coltrin -% and Glarborg, 'Chemically Reacting Flow', Wiley Interscience, 2003). If set to -% 1 (true), output for rate constants of three-body reactions is multiplied by -% third-body concentrations, consistent with Cantera's behavior prior to version 3.0. -% -% See also: :mat:func:`fwdRateConstants`, :mat:func:`revRateConstants`. -% - -ctmethods(0, 8, legacy); diff --git a/src/matlab/SConscript b/src/matlab/SConscript deleted file mode 100644 index 59ec3d43f6..0000000000 --- a/src/matlab/SConscript +++ /dev/null @@ -1,116 +0,0 @@ -import os -import sys -from os.path import join as pjoin -from buildutils import * -from pathlib import Path - -Import('env', 'build', 'install') - -localenv = env.Clone() -linkflags = [] - -matlab_include = pjoin(localenv['matlab_path'], 'extern', 'include') - -if localenv['OS'] == 'Windows': - linklibs = list(env['cantera_shared_libs']) - linklibs += ['libmx', 'libmex', 'libmat'] - if localenv['OS_BITS'] == 32: - matlab_libs = pjoin(localenv['matlab_path'], 'extern', - 'lib' ,'win32', 'microsoft') - mexSuffix = '.mexw32' - else: - matlab_libs = pjoin(localenv['matlab_path'], 'extern', - 'lib' ,'win64', 'microsoft') - mexSuffix = '.mexw64' - - if localenv['CC'] == 'cl': - linkflags.append('/export:mexFunction') - machtype = 'X64' if localenv['OS_BITS'] == 64 else 'X86' - linkflags.append('/MACHINE:' + machtype) - elif localenv['CC'] == 'gcc': - linkflags.append('-Wl,--export-all-symbols') - -elif localenv['OS'] == 'Darwin': - linklibs = list(env['cantera_libs']) - linklibs += ['mx', 'mex', 'mat'] + env['LIBM'] - linkflags.extend(['-Wl,-exported_symbol,_mexFunction']) - - matlab_path = Path(localenv["matlab_path"]) - if (matlab_path / "bin" / "maca64").is_dir(): - matlab_libs = (matlab_path / "bin" / "maca64").as_posix() - mexSuffix = ".mexmaca64" - elif (matlab_path / "bin" / "maci64").is_dir(): - matlab_libs = (matlab_path / "bin" / "maci64").as_posix() - mexSuffix = ".mexmaci64" - else: - logger.error("Couldn't determine target architecture for Matlab toolbox") - sys.exit(1) - -elif os.name == 'posix': - linklibs = list(env['cantera_libs']) - linklibs += ['mx', 'mex', 'mat'] + env['LIBM'] - - if localenv['OS_BITS'] == 64: - matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'glnxa64') - mexSuffix = '.mexa64' - else: - matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'glnx86') - mexSuffix = '.mexglx' - - linkflags.extend(['-Wl,--no-undefined', - '-Wl,--version-script,src/matlab/mexFunction.map', - '-static-libstdc++']) - -localenv.Prepend(CPPPATH=['#include', '#src', matlab_include]) -localenv.Append(CPPDEFINES=['MATLAB_MEX_FILE'], - LIBPATH=[matlab_libs], - LINKFLAGS=linkflags) - -linklibs += localenv['sundials_libs'] -linklibs += localenv['blas_lapack_libs'] - -ctmethods = build(localenv.SharedLibrary('#interfaces/matlab/toolbox/ctmethods', - multi_glob(localenv, '.', 'cpp'), - LIBPREFIX='', - SHLIBPREFIX='', - SHLIBSUFFIX=mexSuffix, - LIBS=linklibs)) - -if localenv['OS'] in ('Windows'): - localenv.Depends(ctmethods, localenv['cantera_shlib']) -else: - localenv.Depends(ctmethods, localenv['cantera_staticlib']) - -env['matlab_extension'] = ctmethods - -### Install the Matlab toolbox ### - -# 'ctpath.m' -globalenv = env - -def copy_var(target, source, env): - if env['python_prefix'] == 'USER': - env['python_module_loc_sc'] = '' - else: - env['python_module_loc_sc'] = globalenv['python_module_loc'] - -target = localenv.SubstFile('#interfaces/matlab/ctpath.m', - '#interfaces/matlab/ctpath.m.in') -localenv.AddPreAction(target, copy_var) -localenv.Depends(target, env['install_python_action']) -install('$inst_matlab_dir', target) - -# 'Contents.m' -contents = localenv.SubstFile('#interfaces/matlab/Contents.m', - '#interfaces/matlab/Contents.m.in') -install('$inst_matlab_dir', contents) - -install(localenv.RecursiveInstall, '$inst_matlab_dir', - '#interfaces/matlab/toolbox', - exclude=['dll$', 'exp$', 'lib$', 'ilk$', 'manifest$']) -install(localenv.RecursiveInstall, '$inst_sampledir/matlab', '#samples/matlab') - -if os.name == 'nt': - shlib = [f for f in localenv['cantera_shlib'] - if f.name.endswith('dll')] - install('$inst_matlab_dir', shlib) diff --git a/src/matlab/ctfunctions.cpp b/src/matlab/ctfunctions.cpp deleted file mode 100644 index 219c15c74e..0000000000 --- a/src/matlab/ctfunctions.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file ctfunctions.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include -#include - -#include "cantera/clib/ct.h" -#include "cantera/clib/ctreactor.h" -#include "cantera/clib/ctonedim.h" -#include "cantera/clib/ctmultiphase.h" -#include "cantera/clib/ctfunc.h" -#include "cantera/clib/ctrpath.h" -#include "ctmatutils.h" - -void reportError() -{ - int buflen = 0; - char* output_buf = 0; - buflen = ct_getCanteraError(buflen, output_buf) + 1; - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - ct_getCanteraError(buflen, output_buf); - mexErrMsgTxt(output_buf); -} - -void ctfunctions(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int job = getInt(prhs[1]); - int iok = 0, dbg, validate, legacy; - char* infile, *dbfile, *trfile, *idtag, *sep; - int buflen = 0; - char* output_buf = 0; - - switch (job) { - // get Cantera error - case 2: - buflen = ct_getCanteraError(buflen, output_buf) + 1; - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = ct_getCanteraError(buflen, output_buf); - plhs[0] = mxCreateString(output_buf); - iok = 0; - return; - - // add directory - case 3: - infile = getString(prhs[2]); - iok = ct_addCanteraDirectory(strlen(infile), infile); - break; - - // clear storage - case 4: - iok = ct_clearOneDim(); - iok = ct_clearMix(); - iok = ct_clearFunc(); - iok = ct_clearStorage(); - iok = ct_clearReactors(); - iok = ct_clearReactionPath(); - break; - - // get string of data directories - case 5: - sep = getString(prhs[2]); - buflen = ct_getDataDirectories(0, 0, sep); - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = ct_getDataDirectories(buflen, output_buf, sep); - plhs[0] = mxCreateString(output_buf); - iok = 0; - return; - - // get cantera version string - case 6: - buflen = ct_getCanteraVersion(0, 0); - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = ct_getCanteraVersion(buflen, output_buf); - plhs[0] = mxCreateString(output_buf); - return; - - // get cantera git commit - case 7: - buflen = ct_getGitCommit(0, 0); - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = ct_getGitCommit(buflen, output_buf); - plhs[0] = mxCreateString(output_buf); - return; - - // set definition used for rate constant calculation - case 8: - legacy = getInt(prhs[2]); - iok = ct_use_legacy_rate_constants(legacy); - return; - - default: - mexErrMsgTxt("ctfunctions: unknown job"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } -} diff --git a/src/matlab/ctmatutils.h b/src/matlab/ctmatutils.h deleted file mode 100644 index 3d96418a03..0000000000 --- a/src/matlab/ctmatutils.h +++ /dev/null @@ -1,58 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CT_MATUTILS_H -#define CT_MATUTILS_H - -const double Undef = -999.123; - -#include - -// Workaround for VS2010 and Matlab 2010a. -// mex.h must be included after or another include from -// the standard library which includes . -#if (_MSC_VER >= 1600) -#define __STDC_UTF_16__ -#endif -#include "mex.h" - -void reportError(); - -void checkNArgs(const int n, const int nrhs); - -template -inline int getInt(A* mxhndl) -{ - return int(mxGetScalar(mxhndl)); -} - -template -inline double getDouble(A* mxhndl) -{ - return double(mxGetScalar(mxhndl)); -} - -inline char* getString(const mxArray* p) -{ - char* input_buf = 0; - int status; - size_t m = mxGetM(p); - size_t n = mxGetN(p); - mwSize buflen = (mwSize)(m*n + 1); - std::string msg; - - if (m == 1) { - input_buf = (char*)mxCalloc(buflen, sizeof(char)); - status = mxGetString(p, input_buf, buflen); - if (status != 0) { - msg = std::string(input_buf) - + "\nNot enough space. String is truncated."; - mexWarnMsgTxt(msg.c_str()); - } - } else { - mexErrMsgTxt("string must be a row vector"); - } - return input_buf; -} - -#endif diff --git a/src/matlab/ctmethods.cpp b/src/matlab/ctmethods.cpp deleted file mode 100644 index 1eb54b8c07..0000000000 --- a/src/matlab/ctmethods.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @file ctmethods.cpp - * - * The interface between the MATLAB environment and the C++ Cantera - * kernel is through a single MEX file. This is top-level driver for - * the MEX file. - * - * This file handles the methods of all Cantera MATLAB classes. The - * class is indicated by the first parameter in the call from MATLAB. - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include - -#include "cantera/clib/ct.h" -#include "ctmatutils.h" -#include "mllogger.h" - -const int NO_CLASS = 0; -const int THERMO_CLASS = 20; -const int PHASE_CLASS = 30; -const int KINETICS_CLASS = 40; -const int TRANSPORT_CLASS = 50; -const int REACTOR_CLASS = 60; -const int REACTORNET_CLASS = 65; -const int WALL_CLASS = 70; -const int REACTORSURFACE_CLASS = 75; -const int FLOWDEVICE_CLASS = 80; -const int ONEDIM_CLASS = 90; -const int SURF_CLASS = 100; -const int FUNC_CLASS = 110; -const int MIXTURE_CLASS = 120; - -void ctfunctions(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void thermomethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void phasemethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void mixturemethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void surfmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void kineticsmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void transportmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void reactormethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void reactornetmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void wallmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void reactorsurfacemethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void flowdevicemethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void onedimmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -void funcmethods(int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]); - -static Cantera::ML_Logger* _logger = 0; - -void initLogger() -{ - if (!_logger) { - _logger = new Cantera::ML_Logger; - // Call the DLL program to set the logger - ct_setLogWriter(_logger); - } -} - -extern "C" { - - void mexFunction(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) - { - // create a log writer for error messages if this is the - // first MATLAB function call - initLogger(); - - // flag specifying the class - int iclass = getInt(prhs[0]); - - // Hand off to the appropriate routine, based on the - // value of the first parameter - switch (iclass) { - case NO_CLASS: - ctfunctions(nlhs, plhs, nrhs, prhs); - break; - case THERMO_CLASS: - thermomethods(nlhs, plhs, nrhs, prhs); - break; - case PHASE_CLASS: - phasemethods(nlhs, plhs, nrhs, prhs); - break; - case MIXTURE_CLASS: - mixturemethods(nlhs, plhs, nrhs, prhs); - break; - case KINETICS_CLASS: - kineticsmethods(nlhs, plhs, nrhs, prhs); - break; - case TRANSPORT_CLASS: - transportmethods(nlhs, plhs, nrhs, prhs); - break; - case REACTOR_CLASS: - reactormethods(nlhs, plhs, nrhs, prhs); - break; - case REACTORNET_CLASS: - reactornetmethods(nlhs, plhs, nrhs, prhs); - break; - case WALL_CLASS: - wallmethods(nlhs, plhs, nrhs, prhs); - break; - case REACTORSURFACE_CLASS: - reactorsurfacemethods(nlhs, plhs, nrhs, prhs); - break; - case FLOWDEVICE_CLASS: - flowdevicemethods(nlhs, plhs, nrhs, prhs); - break; - case ONEDIM_CLASS: - onedimmethods(nlhs, plhs, nrhs, prhs); - break; - case SURF_CLASS: - surfmethods(nlhs, plhs, nrhs, prhs); - break; - case FUNC_CLASS: - funcmethods(nlhs, plhs, nrhs, prhs); - break; - default: - mexPrintf("iclass = %d",iclass); - } - } -} diff --git a/src/matlab/flowdevicemethods.cpp b/src/matlab/flowdevicemethods.cpp deleted file mode 100644 index 0463f87885..0000000000 --- a/src/matlab/flowdevicemethods.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "ctmatutils.h" -#include "cantera/clib/ctreactor.h" -#include "cantera/clib/ct.h" - -void flowdevicemethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int m, iok = 0, n; - int job = getInt(prhs[1]); - double r = Undef; - double v = Undef; - if (nrhs > 3) { - v = getDouble(prhs[3]); - } - - // constructor - if (job == 0) { - char* type = getString(prhs[2]); - - n = flowdev_new(type); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(n); - if (n < 0) { - reportError(); - } - return; - } - - // options that do not return a value - - int i = getInt(prhs[2]); - if (job < 20) { - switch (job) { - case 1: - iok = flowdev_del(i); - break; - case 2: - m = getInt(prhs[4]); - iok = flowdev_install(i, int(v), m); - break; - case 4: - iok = flowdev_setValveCoeff(i, v); - break; - case 7: - iok = flowdev_setPrimary(i, int(v)); - break; - case 8: - iok = flowdev_setPressureFunction(i, int(v)); - break; - case 9: - iok = flowdev_setTimeFunction(i, int(v)); - break; - case 10: - iok = flowdev_setMassFlowCoeff(i, v); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } - return; - } else if (job < 40) { - // options that return a value of type 'double' - switch (job) { - case 21: - r = flowdev_massFlowRate(i); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = r; - if (r == Undef) { - reportError(); - } - return; - } -} diff --git a/src/matlab/funcmethods.cpp b/src/matlab/funcmethods.cpp deleted file mode 100644 index 6dd90eeda3..0000000000 --- a/src/matlab/funcmethods.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "ctmatutils.h" -#include "cantera/clib/ctfunc.h" -#include "cantera/clib/ct.h" - -void funcmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int job = getInt(prhs[1]); - int nn; - double* ptr = 0; - - // constructor - if (job == 0) { - int type = getInt(prhs[2]); - int n = getInt(prhs[3]); - if (type < 20) { - ptr = mxGetPr(prhs[4]); - size_t msize = mxGetM(prhs[4]); - size_t nsize = mxGetN(prhs[4]); - size_t lenp = msize*nsize; - nn = func_new(type, n, lenp, ptr); - } else if (type < 45) { - int m = getInt(prhs[4]); - nn = func_new(type, n, m, ptr); - } else { - ptr = mxGetPr(prhs[4]); - nn = func_new(type, n, 0, ptr); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(nn); - if (nn < 0) { - reportError(); - } - return; - } else { - int nn = 0; - double t; - double v = 0.0; - int i = getInt(prhs[2]); - if (job == 1) { - nn = func_del(i); - if (nn < 0) { - reportError(); - } - v = double(nn); - } else if (job == 2) { - t = getDouble(prhs[3]); - v = func_value(i, t); - if (v == Undef) { - reportError(); - } - } else { - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = v; - return; - } -} - diff --git a/src/matlab/kineticsmethods.cpp b/src/matlab/kineticsmethods.cpp deleted file mode 100644 index c4d4abe386..0000000000 --- a/src/matlab/kineticsmethods.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "ctmatutils.h" -#include "cantera/clib/ct.h" -#include "cantera/base/global.h" - -void checkNArgs(const int n, const int nrhs) -{ - if (n != nrhs) { - mexErrMsgTxt("Wrong number of arguments."); - } -} - -void kineticsmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - double vv = 0.0; - int job = getInt(prhs[2]); - int kin, irxn; - - // construct a new instance - if (job == 0) { - checkNArgs(10, nrhs); - std::string fileName = getString(prhs[3]); - std::string phaseName = getString(prhs[4]); - if (phaseName == "-") { - phaseName = ""; - } - int iph = getInt(prhs[5]); - int in1 = getInt(prhs[6]); - int in2 = getInt(prhs[7]); - int in3 = getInt(prhs[8]); - int in4 = getInt(prhs[9]); - vv = static_cast(kin_newFromFile( - fileName.c_str(), phaseName.c_str(), iph, in1, in2, in3, in4)); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = vv; - return; - } else if (job > 0) { - // methods - int isp = 1; - if (job < 5 || job > 6) { - checkNArgs(4,nrhs); - } else { - checkNArgs(5,nrhs); - isp = getInt(prhs[4]); - } - kin = getInt(prhs[1]); - irxn = getInt(prhs[3]); - - // get scalar attributes - if (job < 10) { - switch (job) { - case 1: - vv = (double) kin_nReactions(kin); - break; - case 2: - vv = kin_multiplier(kin, irxn-1); - break; - case 3: - vv = (double) kin_nSpecies(kin); - break; - case 4: - vv = kin_isReversible(kin,irxn-1); - break; - case 5: - vv = kin_reactantStoichCoeff(kin, isp - 1, irxn-1); - break; - case 6: - vv = kin_productStoichCoeff(kin, isp - 1, irxn-1); - break; - default: - mexErrMsgTxt("unknown job"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = vv; - return; - } else if (job < 20) { - // get reaction array attributes - mwSize nr = (mwSize) kin_nReactions(kin); - plhs[0] = mxCreateNumericMatrix(nr,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - int ok = -10; - switch (job) { - case 11: - ok = kin_getFwdRatesOfProgress(kin,nr,h); - break; - case 12: - ok = kin_getRevRatesOfProgress(kin,nr,h); - break; - case 13: - ok = kin_getNetRatesOfProgress(kin,nr,h); - break; - case 14: - ok = kin_getEquilibriumConstants(kin,nr,h); - break; - case 15: - ok = kin_getFwdRateConstants(kin,nr,h); - break; - case 16: - ok = kin_getRevRateConstants(kin,1,nr,h); - break; - case 17: - ok = kin_getDelta(kin,getInt(prhs[3]),nr,h); - break; - default: - ; - } - if (ok < 0) { - mexErrMsgTxt("error computing rates of progress"); - } - } else if (job < 30) { - mwSize nsp = (mwSize) kin_nSpecies(kin); - plhs[0] = mxCreateNumericMatrix(nsp,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - int ok = -10; - switch (job) { - case 21: - ok = kin_getCreationRates(kin,nsp,h); - break; - case 22: - ok = kin_getDestructionRates(kin,nsp,h); - break; - case 23: - ok = kin_getNetProductionRates(kin,nsp,h); - break; - case 24: - ok = kin_getSourceTerms(kin, nsp, h); - break; - default: - ; - } - if (ok < 0) { - mexErrMsgTxt("error computing production rates"); - } - } else if (job < 40) { - char* buf; - int iok = -1, buflen; - switch (job) { - case 31: - buflen = kin_getReactionString(kin, irxn-1, 0, 0); - if (buflen > 0) { - buf = (char*) mxCalloc(buflen, sizeof(char)); - iok = kin_getReactionString(kin, irxn-1, buflen, buf); - } - break; - default: - ; - } - if (iok == 0) { - plhs[0] = mxCreateString(buf); - return; - } else { - reportError(); - } - } - } else { - // set attributes - int iok = -1; - job = -job; - kin = getInt(prhs[1]); - irxn = getInt(prhs[3]); - - if (job < 10) { - checkNArgs(5,nrhs); - double v = getDouble(prhs[4]); - switch (job) { - case 1: - iok = kin_setMultiplier(kin,irxn-1,v); - break; - case 3: - iok = kin_del(kin); - break; - case 5: - iok = kin_advanceCoverages(kin,v); - break; - default: - mexErrMsgTxt("unknown job"); - } - } - - if (iok < 0) { - reportError(); - } - } -} diff --git a/src/matlab/mexFunction.map b/src/matlab/mexFunction.map deleted file mode 100644 index b608d545c6..0000000000 --- a/src/matlab/mexFunction.map +++ /dev/null @@ -1,6 +0,0 @@ -MEX { - global: - mexFunction; - local: - *; -}; diff --git a/src/matlab/mixturemethods.cpp b/src/matlab/mixturemethods.cpp deleted file mode 100644 index 4bb33d76a2..0000000000 --- a/src/matlab/mixturemethods.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/** - * @file mixturemethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include -#include - -#include "cantera/clib/ctmultiphase.h" -#include "cantera/clib/ct.h" -#include "ctmatutils.h" - -void mixturemethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int m, iok = 0, n; - int job = getInt(prhs[1]); - int i = getInt(prhs[2]); - - double r = Undef; - double v = Undef; - if (nrhs > 3 && job != 8 && job != 9 && job != 22 && job != 23) { - v = getDouble(prhs[3]); - } - - // constructor - if (job == 0) { - n = mix_new(); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(n); - if (n < 0) { - reportError(); - } - return; - } - - // options that do not return a value - double moles, err; - char* nmstr, *XY, *nm; - int maxiter, maxsteps, loglevel; - if (job < 15) { - switch (job) { - case 1: - iok = mix_del(i); - break; - case 4: - checkNArgs(5, nrhs); - moles = getDouble(prhs[4]); - iok = mix_addPhase(i, int(v), moles); - break; - case 5: - iok = mix_setTemperature(i, v); - break; - case 6: - iok = mix_setPressure(i, v); - break; - case 7: - checkNArgs(5, nrhs); - moles = getDouble(prhs[4]); - iok = mix_setPhaseMoles(i, int(v)-1, moles); - break; - case 8: - checkNArgs(4, nrhs); - nmstr = getString(prhs[3]); - iok = mix_setMolesByName(i, nmstr); - break; - case 9: - iok = mix_updatePhases(i); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } - return; - } else if (job < 40) { - // options that return a value of type 'double' - switch (job) { - case 19: - r = (double) mix_nPhases(i); - break; - case 21: - r = (double) mix_nElements(i); - break; - case 22: - checkNArgs(4, nrhs); - nm = getString(prhs[3]); - r = (double) mix_elementIndex(i, nm)+1; - break; - case 23: - checkNArgs(5, nrhs); - m = getInt(prhs[3]); - n = getInt(prhs[4]); - r = (double) mix_speciesIndex(i, m-1, n-1)+1; - break; - case 24: - r = (double) mix_nSpecies(i); - break; - case 25: - r = mix_temperature(i); - break; - case 26: - r = mix_pressure(i); - break; - case 27: - m = getInt(prhs[4]); - r = mix_nAtoms(i,int(v), m); - break; - case 28: - r = mix_phaseMoles(i, int(v)-1); - break; - case 29: - r = mix_speciesMoles(i, int(v)-1); - break; - case 30: - r = mix_elementMoles(i, int(v)-1); - break; - case 31: - checkNArgs(8, nrhs); - XY = getString(prhs[3]); - err = getDouble(prhs[4]); - maxsteps = getInt(prhs[5]); - maxiter = getInt(prhs[6]); - loglevel = getInt(prhs[7]); - r = mix_equilibrate(i, XY, err, maxsteps, - maxiter, loglevel); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = r; - if (r == DERR || r == Undef || r == -1) { - reportError(); - } - return; - } else if (job < 60) { - // species properties - int iok = 0; - mwSize nsp = (mwSize) mix_nSpecies(i); - std::vector x(nsp); - switch (job) { - case 41: - iok = mix_getChemPotentials(i,nsp, &x[0]); - break; - default: - ; - } - plhs[0] = mxCreateNumericMatrix(nsp,1, mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - if (iok >= 0) { - for (mwSize i = 0; i < nsp; i++) { - h[i] = x[i]; - } - return; - } else { - for (mwSize i = 0; i < nsp; i++) { - h[i] = -999.99; - } - mexErrMsgTxt("unknown attribute"); - return; - } - } -} diff --git a/src/matlab/mllogger.h b/src/matlab/mllogger.h deleted file mode 100644 index 4191f59f8f..0000000000 --- a/src/matlab/mllogger.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file mlloger.h - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef MLLOGGER_H -#define MLLOGGER_H - -#include "ctmatutils.h" -#include "cantera/base/logger.h" - -namespace Cantera -{ - -class ML_Logger : public Logger -{ -public: - ML_Logger() {} - ~ML_Logger() override {} - - void write(const string& s) override { - mexPrintf("%s", s.c_str()); - } - - void writeendl() override { - mexPrintf("\n"); - } - - void error(const string& msg) override { - mexErrMsgTxt(msg.c_str()); - } -}; - -} - -#endif diff --git a/src/matlab/onedimmethods.cpp b/src/matlab/onedimmethods.cpp deleted file mode 100644 index 8dc6eae65c..0000000000 --- a/src/matlab/onedimmethods.cpp +++ /dev/null @@ -1,402 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include -#include -#include - -#include "ctmatutils.h" -#include "cantera/clib/ctonedim.h" - -void onedimmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - double vv = 0.0; - int job = getInt(prhs[2]); - size_t n, m; - double* dom_ids, *h; - int indx = 0; - char* nm; - int dom; - dom = getInt(prhs[1]); - int idom, icomp, localPoint; - if (job < 10) { - int ph, kin, tr, itype; - size_t sz, nd; - - switch (job) { - case 1: - // construct a new stagnation flow instance - checkNArgs(7, nrhs); - ph = getInt(prhs[3]); - kin = getInt(prhs[4]); - tr = getInt(prhs[5]); - itype = getInt(prhs[6]); - indx = stflow_new(ph, kin, tr, itype); - break; - case 2: - // construct a new Inlet1D instance - checkNArgs(3, nrhs); - indx = inlet_new(); - break; - case 3: - // construct a new Surf1D instance - checkNArgs(3, nrhs); - indx = surf_new(); - break; - case 4: - // construct a new Symm1D instance - checkNArgs(3, nrhs); - indx = symm_new(); - break; - case 5: - // construct a new Outlet1D instance - checkNArgs(3, nrhs); - indx = outlet_new(); - break; - case 6: - // construct a new ReactingSurf1D instance - checkNArgs(4, nrhs); - indx = reactingsurf_new(); - reactingsurf_setkineticsmgr(indx, getInt(prhs[3])); - break; - case 8: { - // construct a new Sim1D instance - checkNArgs(5, nrhs); - nd = getInt(prhs[3]); - dom_ids = mxGetPr(prhs[4]); - m = mxGetM(prhs[4]); - n = mxGetN(prhs[4]); - sz = (m == 1) ? n : m; - if (sz != nd) { - mexErrMsgTxt("wrong size for domain array"); - } - - std::vector ptrs(sz); - for (size_t k = 0; k < sz; k++) { - ptrs[k] = int(dom_ids[k]); - } - indx = sim1D_new(sz, &ptrs[0]); - break; - } - - // construct a new OutletRes1D instance - case -2: - checkNArgs(3,nrhs); - indx = outletres_new(); - break; - - default: - mexErrMsgTxt("onedimmethods: unknown object type"); - } - - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - h = mxGetPr(plhs[0]); - *h = double(indx); - if (indx < 0) { - reportError(); - } - return; - } else if (job == 12) { - checkNArgs(3, nrhs); - int buflen = domain_type3(dom, 0, 0); - char* output_buf = (char*)mxCalloc(buflen, sizeof(char)); - int iok = domain_type3(dom, buflen, output_buf); - if (iok < 0) { - reportError(); - } - plhs[0] = mxCreateString(output_buf); - return; - } else if (job < 40) { - // methods - int k; - - switch (job) { - case 10: - checkNArgs(3, nrhs); - vv = domain_del(dom); - break; - case 11: - checkNArgs(3, nrhs); - vv = (double) domain_nComponents(dom); - break; - case 13: - checkNArgs(3, nrhs); - vv = (double) domain_index(dom); - if (vv >= 0.0) { - vv += 1.0; - } - break; - case 14: - checkNArgs(3, nrhs); - vv = (double) domain_nPoints(dom); - break; - case 15: - checkNArgs(3, nrhs); - vv = bdry_temperature(dom); - break; - case 16: - checkNArgs(4, nrhs); - k = getInt(prhs[3]); - vv = bdry_massFraction(dom, k); - break; - case 17: - checkNArgs(3, nrhs); - vv = bdry_mdot(dom); - break; - case 18: - checkNArgs(4, nrhs); - nm = getString(prhs[3]); - vv = (double) domain_componentIndex(dom, nm); - if (vv >= 0.0) { - vv += 1.0; - } - break; - case 19: - checkNArgs(4, nrhs); - localPoint = getInt(prhs[3]) - 1; - vv = domain_grid(dom, localPoint); - break; - case 30: - checkNArgs(6, nrhs); - idom = getInt(prhs[3]) - 1; - icomp = getInt(prhs[4]) - 1; - localPoint = getInt(prhs[5]) - 1; - vv = sim1D_value(dom, idom, icomp, localPoint); - break; - case 31: - checkNArgs(6, nrhs); - idom = getInt(prhs[3]) - 1; - icomp = getInt(prhs[4]) - 1; - localPoint = getInt(prhs[5]) - 1; - vv = sim1D_workValue(dom, idom, icomp, localPoint); - break; - default: - mexErrMsgTxt("unknown job"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = vv; - if ((job != 30) && (vv == -1.0)) { - reportError(); - } - return; - } else if (job < 50) { - int iok = -1; - int buflen, icomp; - char* output_buf; - switch (job) { - case 40: - icomp = getInt(prhs[3]) - 1; - buflen = domain_componentName(dom, icomp, 0, 0); - if (buflen > 0) { - output_buf = (char*) mxCalloc(buflen, sizeof(char)); - iok = domain_componentName(dom, icomp, buflen, output_buf); - } - break; - default: - iok = -1; - } - if (iok >= 0) { - plhs[0] = mxCreateString(output_buf); - return; - } else { - mexErrMsgTxt("error or unknown method."); - return; - } - } else { - // set parameters - int iok = -1; - double lower, upper, rtol, atol, *grid, *pos, *values, - mdot, t, p, val, *temp, ratio, slope, curve, tstep, *dts, - rdt, prune; - size_t npts, np, nv; - int comp, localPoint, idom, - loglevel, refine_grid, n, flag, itime, ns, icount, - onoff, ss_age, ts_age; - char* xstr, *fname, *id, *desc, *name; - switch (job) { - case 51: - checkNArgs(6, nrhs); - n = getInt(prhs[3]) - 1; - lower = getDouble(prhs[4]); - upper = getDouble(prhs[5]); - iok = domain_setBounds(dom, n, lower, upper); - break; - case 53: - checkNArgs(4, nrhs); - grid = mxGetPr(prhs[3]); - npts = mxGetM(prhs[3]) * mxGetN(prhs[3]); - iok = domain_setupGrid(dom, npts, grid); - break; - case 54: - id = getString(prhs[3]); - iok = domain_setID(dom, id); - break; - case 55: - case 56: - checkNArgs(6, nrhs); - n = getInt(prhs[3]) - 1; - rtol = getDouble(prhs[4]); - atol = getDouble(prhs[5]); - if (job == 55) { - iok = domain_setSteadyTolerances(dom, n, rtol, atol); - } else { - iok = domain_setTransientTolerances(dom, n, rtol, atol); - } - break; - case 60: - checkNArgs(4, nrhs); - mdot = getDouble(prhs[3]); - iok = bdry_setMdot(dom, mdot); - break; - case 61: - checkNArgs(4, nrhs); - t = getDouble(prhs[3]); - iok = bdry_setTemperature(dom, t); - break; - case 62: - checkNArgs(4, nrhs); - xstr = getString(prhs[3]); - iok = bdry_setMoleFractions(dom, xstr); - break; - case 63: - checkNArgs(4, nrhs); - p = getDouble(prhs[3]); - iok = stflow_setPressure(dom, p); - break; - case 64: - checkNArgs(5, nrhs); - pos = mxGetPr(prhs[3]); - temp = mxGetPr(prhs[4]); - np = mxGetM(prhs[3])*mxGetN(prhs[3]); - nv = mxGetM(prhs[4])*mxGetN(prhs[4]); - iok = stflow_setFixedTempProfile(dom, np, pos, nv, temp); - break; - case 66: - checkNArgs(4, nrhs); - flag = getInt(prhs[3]); - iok = stflow_solveEnergyEqn(dom, flag); - break; - case 100: - checkNArgs(7, nrhs); - idom = getInt(prhs[3]) - 1; - comp = getInt(prhs[4]) - 1; - localPoint = getInt(prhs[5]) -1; - val = getDouble(prhs[6]); - iok = sim1D_setValue(dom, idom, comp, localPoint, val); - break; - case 101: - checkNArgs(7, nrhs); - idom = getInt(prhs[3]) - 1; - comp = getInt(prhs[4]) - 1; - pos = mxGetPr(prhs[5]); - values = mxGetPr(prhs[6]); - np = mxGetM(prhs[5])*mxGetN(prhs[5]); - nv = mxGetM(prhs[6])*mxGetN(prhs[6]); - iok = sim1D_setProfile(dom, idom, comp, np, pos, nv, values); - break; - case 102: - checkNArgs(6, nrhs); - idom = getInt(prhs[3]) - 1; - comp = getInt(prhs[4]) - 1; - val = getDouble(prhs[5]); - iok = sim1D_setFlatProfile(dom, idom, comp, val); - break; - case 103: - checkNArgs(4, nrhs); - fname = getString(prhs[3]); - iok = sim1D_show(dom, fname); - break; - case 104: - checkNArgs(5, nrhs); - loglevel = getInt(prhs[3]); - refine_grid = getInt(prhs[4]); - iok = sim1D_solve(dom, loglevel, refine_grid); - break; - case 105: - checkNArgs(4, nrhs); - loglevel = getInt(prhs[3]); - iok = sim1D_refine(dom, loglevel); - break; - case 106: - checkNArgs(8, nrhs); - idom = getInt(prhs[3]) - 1; - ratio = getDouble(prhs[4]); - slope = getDouble(prhs[5]); - curve = getDouble(prhs[6]); - prune = getDouble(prhs[7]); - iok = sim1D_setRefineCriteria(dom, idom, ratio, slope, curve, prune); - break; - case 107: - iok = 0; - checkNArgs(6, nrhs); - fname = getString(prhs[3]); - id = getString(prhs[4]); - desc = getString(prhs[5]); - iok = sim1D_save(dom, fname, id, desc); - break; - case 108: - checkNArgs(3, nrhs); - iok = sim1D_writeStats(dom, 1); - break; - case 109: - checkNArgs(4, nrhs); - name = getString(prhs[3]); - iok = sim1D_domainIndex(dom, name); - if (iok >= 0) { - iok++; - } - break; - case 110: - checkNArgs(3, nrhs); - iok = sim1D_del(dom); - break; - case 111: - iok = 0; - checkNArgs(5, nrhs); - fname = getString(prhs[3]); - id = getString(prhs[4]); - iok = sim1D_restore(dom, fname, id); - break; - case 112: { - tstep = getDouble(prhs[3]); - ns = getInt(prhs[4]); - dts = mxGetPr(prhs[5]); - std::vector nsteps(ns); - for (n = 0; n < ns; n++) { - nsteps[n] = int(dts[n]); - } - iok = sim1D_setTimeStep(dom, tstep, ns, &nsteps[0]); - break; - } - case 113: - checkNArgs(5, nrhs); - rdt = getDouble(prhs[3]); - icount = getInt(prhs[4]); - iok = sim1D_eval(dom, rdt, icount); - break; - case 114: - checkNArgs(5, nrhs); - ss_age = getInt(prhs[3]); - ts_age = getInt(prhs[4]); - iok = sim1D_setMaxJacAge(dom, ss_age, ts_age); - break; - case 120: - checkNArgs(4, nrhs); - onoff = getInt(prhs[3]); - iok = reactingsurf_enableCoverageEqs(dom, onoff); - break; - default: - mexPrintf(" job = %d ",job); - mexErrMsgTxt("unknown parameter"); - } - if (iok < 0) { - reportError(); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - return; - } -} diff --git a/src/matlab/phasemethods.cpp b/src/matlab/phasemethods.cpp deleted file mode 100644 index c1113d0c0a..0000000000 --- a/src/matlab/phasemethods.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/** - * @file phasemethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "ctmatutils.h" -#include "cantera/clib/ct.h" - -#include - -void phasemethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - double vv = 0.0; - int iok=0, k; - int ph = getInt(prhs[1]); - int job = getInt(prhs[2]); - - char* input_buf; - double* ptr = 0; - size_t nsp, n, m; - int mjob, show_thermo; - - // methods to set attributes - if (job < 0) { - mjob = -job; - if (mxIsChar(prhs[3]) != 1) { - ptr = mxGetPr(prhs[3]); - } - m = mxGetM(prhs[3]); - n = mxGetN(prhs[3]); - - nsp = thermo_nSpecies(ph); - - // set scalar attributes - if (mjob < 10) { - if (m != 1 || n != 1) { - mexErrMsgTxt("value must be scalar."); - } - - switch (mjob) { - case 1: - iok = thermo_setTemperature(ph,*ptr); - break; - case 2: - iok = thermo_setDensity(ph,*ptr); - break; - default: - mexErrMsgTxt("Unknown job number"); - } - } else if (mjob < 30) { - // set array attributes - if ((m == nsp && n == 1) || (m == 1 && n == nsp)) { - int norm = 1; - switch (mjob) { - case 20: - iok = thermo_setMoleFractions(ph, nsp, ptr, norm); - break; - case 21: - iok = thermo_setMassFractions(ph, nsp, ptr, norm); - break; - case 22: - norm = 0; - iok = thermo_setMoleFractions(ph, nsp, ptr, norm); - break; - case 23: - norm = 0; - iok = thermo_setMassFractions(ph, nsp, ptr, norm); - break; - default: - mexErrMsgTxt("Unknown job number"); - } - } else { - mexErrMsgTxt("wrong array size"); - } - } else { - // set attributes from a string - int status; - mwSize buflen; - char* input_buf; - if (mxIsChar(prhs[3]) == 1) { - if (mxGetM(prhs[3]) != 1) { - mexErrMsgTxt("Input must be a row vector."); - } - buflen = (mwSize)(mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1; - input_buf = (char*)mxCalloc(buflen, sizeof(char)); - status = mxGetString(prhs[3], input_buf, buflen); - if (status != 0) { - mexWarnMsgTxt("Not enough space. " "String is truncated."); - } - - switch (mjob) { - case 30: - iok = thermo_setMoleFractionsByName(ph, input_buf); - break; - case 31: - iok = thermo_setMassFractionsByName(ph, input_buf); - break; - case 32: - iok = thermo_setName(ph, input_buf); - break; - default: - mexErrMsgTxt("Unknown job number"); - } - } else { - mexErrMsgTxt("expected a string."); - } - } - } else if (job < 20) { - double threshold; - switch (job) { - case 1: - // floating-point attributes - vv = thermo_temperature(ph); - if (vv == DERR) { - reportError(); - } - break; - case 2: - vv = thermo_density(ph); - if (vv == DERR) { - reportError(); - } - break; - case 3: - vv = thermo_molarDensity(ph); - if (vv == DERR) { - reportError(); - } - break; - case 4: - vv = thermo_meanMolecularWeight(ph); - if (vv == DERR) { - reportError(); - } - break; - case 10: - vv = static_cast(thermo_nElements(ph)); - if (vv == -1) { - reportError(); - } - break; - case 11: - vv = static_cast(thermo_nSpecies(ph)); - if (vv == -1) { - reportError(); - } - break; - case 12: - input_buf = getString(prhs[3]); - vv = static_cast(thermo_speciesIndex(ph, input_buf)) + 1; - break; - case 13: - input_buf = getString(prhs[3]); - vv = static_cast(thermo_elementIndex(ph, input_buf)) + 1; - break; - case 14: - k = getInt(prhs[3]); - m = getInt(prhs[4]); - vv = thermo_nAtoms(ph,k-1,m-1); - if (vv == ERR) { - reportError(); - } - break; - case 15: - show_thermo = getInt(prhs[3]); - threshold = getDouble(prhs[4]); - vv = thermo_print(ph,show_thermo,threshold); - if (vv == -1 || vv == ERR) { - reportError(); - } - break; - default: - mexErrMsgTxt("Unknown job number"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = vv; - return; - } else if (job < 30) { - iok = 0; - size_t nsp = thermo_nSpecies(ph); - std::vector x(nsp); - switch (job) { - case 20: - iok = thermo_getMoleFractions(ph,nsp, &x[0]); - break; - case 21: - iok = thermo_getMassFractions(ph,nsp, &x[0]); - break; - case 22: - iok = thermo_getMolecularWeights(ph,nsp, &x[0]); - break; - case 23: - iok = thermo_getCharges(ph, nsp, &x[0]); - break; - default: - mexErrMsgTxt("Unknown job number"); - } - plhs[0] = mxCreateNumericMatrix((mwSize) nsp, 1, mxDOUBLE_CLASS, mxREAL); - double* h = mxGetPr(plhs[0]); - if (iok >= 0) { - for (size_t i = 0; i < nsp; i++) { - h[i] = x[i]; - } - return; - } else { - for (size_t i = 0; i < nsp; i++) { - h[i] = -999.99; - } - mexErrMsgTxt("unknown attribute"); - return; - } - } else if (job < 40) { - iok = 0; - size_t nel = thermo_nElements(ph); - std::vector x(nel); - switch (job) { - case 30: - iok = thermo_getAtomicWeights(ph,nel, &x[0]); - break; - default: - ; - } - plhs[0] = mxCreateNumericMatrix((mwSize) nel, 1, mxDOUBLE_CLASS, mxREAL); - double* h = mxGetPr(plhs[0]); - if (iok >= 0) { - for (size_t i = 0; i < nel; i++) { - h[i] = x[i]; - } - return; - } else { - for (size_t i = 0; i < nel; i++) { - h[i] = -999.99; - } - mexErrMsgTxt("unknown attribute"); - return; - } - } else if (job < 50) { - iok = -1; - int ksp, mel; - int buflen; - char* output_buf; - switch (job) { - case 40: - ksp = getInt(prhs[3]); - buflen = thermo_getSpeciesName(ph, ksp-1, 0, 0); - if (buflen > 0) { - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = thermo_getSpeciesName(ph, ksp-1, buflen, output_buf); - } - break; - case 41: - mel = getInt(prhs[3]); - buflen = thermo_getElementName(ph, mel-1, 0, 0); - if (buflen > 0) { - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = thermo_getElementName(ph, mel-1, buflen, output_buf); - } - break; - case 42: - buflen = thermo_getName(ph, 0, 0); - if (buflen > 0) { - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = thermo_getName(ph, buflen, output_buf); - } - break; - case 43: - buflen = thermo_getEosType(ph, 0, 0); - if (buflen > 0) { - output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = thermo_getEosType(ph, buflen, output_buf); - } - break; - default: - iok = -1; - } - if (iok == 0) { - plhs[0] = mxCreateString(output_buf); - return; - } else { - reportError(); - return; - } - } else { - mexErrMsgTxt("unimplemented method."); - return; - } - if (iok < 0) { - reportError(); - } -} diff --git a/src/matlab/reactormethods.cpp b/src/matlab/reactormethods.cpp deleted file mode 100644 index 5c413cd680..0000000000 --- a/src/matlab/reactormethods.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @file reactormethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/clib/ctreactor.h" -#include "cantera/clib/ct.h" -#include "ctmatutils.h" - -void reactormethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int iok = 0, n; - int job = getInt(prhs[1]); - double r = Undef; - double v = Undef; - if (nrhs > 3) { - v = getDouble(prhs[3]); - } - - // constructor - if (job == 0) { - char* type = getString(prhs[2]); - - n = reactor_new(type); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(n); - if (n < 0) { - reportError(); - } - return; - } - - // options that do not return a value - - int i = getInt(prhs[2]); - if (job < 20) { - switch (job) { - case 1: - iok = reactor_del(i); - break; - case 4: - iok = reactor_setInitialVolume(i, v); - break; - case 6: - iok = reactor_setThermoMgr(i, int(v)); - break; - case 7: - iok = reactor_setKineticsMgr(i, int(v)); - break; - case 8: - iok = reactor_setChemistry(i, bool(v)); - break; - case 9: - iok = reactor_setEnergy(i, int(v)); - break; - case 10: - iok = flowReactor_setMassFlowRate(i, v); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } - return; - } else if (job < 40) { - // options that return a value of type 'double' - switch (job) { - case 23: - r = reactor_mass(i); - break; - case 24: - r = reactor_volume(i); - break; - case 25: - r = reactor_density(i); - break; - case 26: - r = reactor_temperature(i); - break; - case 27: - r = reactor_enthalpy_mass(i); - break; - case 28: - r = reactor_intEnergy_mass(i); - break; - case 29: - r = reactor_pressure(i); - break; - case 30: - r = reactor_massFraction(i, int(v)); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = r; - if (r == DERR) { - reportError(); - } - return; - } -} diff --git a/src/matlab/reactornetmethods.cpp b/src/matlab/reactornetmethods.cpp deleted file mode 100644 index 6a5b5ebeec..0000000000 --- a/src/matlab/reactornetmethods.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file reactornetmethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/clib/ctreactor.h" -#include "cantera/clib/ct.h" -#include "ctmatutils.h" - -void reactornetmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int iok = 0, n; - int job = getInt(prhs[1]); - int i = getInt(prhs[2]); - double r = Undef; - double v = Undef; - double v2 = -1.0; - if (nrhs > 3) { - v = getDouble(prhs[3]); - } - if (nrhs > 4) { - v2 = getDouble(prhs[4]); - } - - // constructor - if (job == 0) { - n = reactornet_new(); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(n); - if (n < 0) { - reportError(); - } - return; - } - - // options that do not return a value - if (job < 20) { - switch (job) { - case 1: - iok = reactornet_del(i); - break; - case 4: - iok = reactornet_addreactor(i, int(v)); - break; - case 5: - iok = reactornet_setInitialTime(i, v); - break; - case 6: - iok = reactornet_setMaxTimeStep(i, v); - break; - case 7: - iok = reactornet_setTolerances(i, v, v2); - break; - case 8: - iok = reactornet_advance(i, v); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } - return; - } else if (job < 40) { - // options that return a value of type 'double' - switch (job) { - case 21: - r = reactornet_step(i); - break; - case 22: - r = reactornet_time(i); - break; - case 23: - r = reactornet_rtol(i); - break; - case 24: - r = reactornet_atol(i); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = r; - if (r == DERR) { - reportError(); - } - return; - } -} diff --git a/src/matlab/reactorsurfacemethods.cpp b/src/matlab/reactorsurfacemethods.cpp deleted file mode 100644 index 24fe99935b..0000000000 --- a/src/matlab/reactorsurfacemethods.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file reactorsurfacemethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/clib/ctreactor.h" -#include "cantera/clib/ct.h" -#include "ctmatutils.h" - -void reactorsurfacemethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int iok = 0, n; - int job = getInt(prhs[1]); - int i = getInt(prhs[2]); - double r = Undef; - double v = Undef; - if (nrhs > 3) { - v = getDouble(prhs[3]); - } - - // constructor - if (job == 0) { - n = reactorsurface_new(i); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(n); - if (n < 0) { - reportError(); - } - return; - } - - // options that do not return a value - if (job < 20) { - switch (job) { - case 1: - iok = reactorsurface_del(i); - break; - case 4: - n = getInt(prhs[3]); - iok = reactorsurface_install(i, n); - break; - case 5: - iok = reactorsurface_setArea(i, v); - break; - case 12: - n = getInt(prhs[3]); - iok = reactorsurface_setkinetics(i, n); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } - return; - } else if (job < 40) { - // options that return a value of type 'double' - switch (job) { - case 23: - r = reactorsurface_area(i); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = r; - if (r == DERR) { - reportError(); - } - return; - } -} diff --git a/src/matlab/surfmethods.cpp b/src/matlab/surfmethods.cpp deleted file mode 100644 index 12784f974c..0000000000 --- a/src/matlab/surfmethods.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include -#include -#include - -#include "ctmatutils.h" -#include "cantera/clib/ctsurf.h" -#include "cantera/clib/ct.h" - -void surfmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - double vv; - int job = getInt(prhs[2]); - int iok = 0; - int norm = 0; - double* ptr; - char* str; - size_t nsp, n, m; - int surf = getInt(prhs[1]); - - // set parameters - if (job < 100) { - switch (job) { - case 1: - checkNArgs(4, nrhs); - vv = getDouble(prhs[3]); - iok = surf_setSiteDensity(surf, vv); - break; - case 3: - checkNArgs(5, nrhs); - ptr = mxGetPr(prhs[3]); - m = mxGetM(prhs[3]); - n = mxGetN(prhs[3]); - nsp = thermo_nSpecies(surf); - norm = getInt(prhs[4]); - if ((m == nsp && n == 1) || (m == 1 && n == nsp)) { - iok = surf_setCoverages(surf, ptr, norm); - } else { - mexErrMsgTxt("wrong array size for coverages"); - } - break; - case 5: - checkNArgs(4, nrhs); - str = getString(prhs[3]); - iok = surf_setCoveragesByName(surf, str); - break; - default: - mexErrMsgTxt("unknown job"); - } - if (iok < 0) { - reportError(); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - return; - } else if (job < 200) { - // return array parameters - nsp = thermo_nSpecies(surf); - std::vector x(nsp); - iok = -1; - switch (job) { - case 101: - checkNArgs(3,nrhs); - iok = surf_getCoverages(surf, &x[0]); - break; - case 103: - iok = surf_getConcentrations(surf, &x[0]); - break; - default: - ; - } - plhs[0] = mxCreateNumericMatrix((mwSize) nsp,1, - mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - if (iok >= 0) { - for (size_t i = 0; i < nsp; i++) { - h[i] = x[i]; - } - return; - } else { - for (size_t i = 0; i < nsp; i++) { - h[i] = -999.99; - } - reportError(); - return; - } - } else { - mexErrMsgTxt("unknown job"); - } -} diff --git a/src/matlab/thermomethods.cpp b/src/matlab/thermomethods.cpp deleted file mode 100644 index 153e76a2f3..0000000000 --- a/src/matlab/thermomethods.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/** - * @file thermomethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/clib/ct.h" -#include "ctmatutils.h" -#include - -static void thermoset(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int ierr = 0; - int th = getInt(prhs[1]); - int job = -getInt(prhs[2]); - double* ptr = 0; - if (mxIsDouble(prhs[3]) == 1) { - ptr = mxGetPr(prhs[3]); - } - size_t m = mxGetM(prhs[3]); - size_t n = mxGetN(prhs[3]); - - // scalar attributes - if (job < 20) { - if (m != 1 || n != 1) { - mexErrMsgTxt("value must be scalar."); - } - switch (job) { - case 10: - ierr = thermo_del(th); - break; - case 1: - ierr = thermo_setPressure(th,*ptr); - break; - case 2: - ierr = thermo_setElectricPotential(th, *ptr); - break; - default: - mexErrMsgTxt("unknown attribute."); - } - } else if (job < 40) { - // property pairs - if ((m == 2 && n == 1) || (m == 1 && n == 2)) { - switch (job) { - case 20: - ierr = thermo_set_HP(th,ptr); - break; - case 21: - ierr = thermo_set_UV(th,ptr); - break; - case 22: - ierr = thermo_set_SV(th,ptr); - break; - case 23: - ierr = thermo_set_SP(th,ptr); - break; - case 24: - ierr = thermo_setState_Psat(th,ptr[0],ptr[1]); - break; - case 25: - ierr = thermo_setState_Tsat(th,ptr[0],ptr[1]); - break; - case 26: - ierr = thermo_set_DP(th,ptr); - break; - case 27: - ierr = thermo_set_ST(th,ptr); - break; - case 28: - ierr = thermo_set_TV(th,ptr); - break; - case 29: - ierr = thermo_set_PV(th,ptr); - break; - case 30: - ierr = thermo_set_UP(th,ptr); - break; - case 31: - ierr = thermo_set_VH(th,ptr); - break; - case 32: - ierr = thermo_set_TH(th,ptr); - break; - case 33: - ierr = thermo_set_SH(th,ptr); - break; - default: - mexErrMsgTxt("unknown pair attribute."); - } - } else { - mexErrMsgTxt("wrong size"); - } - } else if (job == 50) { - // equilibrate - char* xy = getString(prhs[3]); - int solver = getInt(prhs[4]); - double rtol = getDouble(prhs[5]); - int maxsteps = getInt(prhs[6]); - int maxiter = getInt(prhs[7]); - int loglevel = getInt(prhs[8]); - ierr = thermo_equilibrate(th, xy, solver, rtol, maxsteps, maxiter, loglevel); - } - if (ierr < 0) { - reportError(); - } - - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = 1.0*ierr; - return; -} - -static void thermoget(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - double vv, psat, tsat, TK; - int n = getInt(prhs[1]); - int job = getInt(prhs[2]); - - if (job == 0) { - checkNArgs(5, nrhs); - std::string fileName = getString(prhs[3]); - std::string phaseName = getString(prhs[4]); - if (phaseName == "-") { - phaseName = ""; - } - vv = (double) thermo_newFromFile(fileName.c_str(), phaseName.c_str()); - if (vv == DERR) { - reportError(); - } - plhs[0] = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, mxREAL); - double* h = mxGetPr(plhs[0]); - *h = vv; - return; - } else if (job < 30) { - bool ok = true; - switch (job) { - case 2: - vv = thermo_enthalpy_mole(n); - break; - case 3: - vv = thermo_intEnergy_mole(n); - break; - case 4: - vv = thermo_entropy_mole(n); - break; - case 5: - vv = thermo_gibbs_mole(n); - break; - case 6: - vv = thermo_cp_mole(n); - break; - case 7: - vv = thermo_cv_mole(n); - break; - case 8: - vv = thermo_pressure(n); - break; - case 9: - vv = thermo_enthalpy_mass(n); - break; - case 10: - vv = thermo_intEnergy_mass(n); - break; - case 11: - vv = thermo_entropy_mass(n); - break; - case 12: - vv = thermo_gibbs_mass(n); - break; - case 13: - vv = thermo_cp_mass(n); - break; - case 14: - vv = thermo_cv_mass(n); - break; - case 15: - vv = thermo_refPressure(n); - break; - case 16: - vv = thermo_minTemp(n, -1); - break; - case 17: - vv = thermo_maxTemp(n, -1); - break; - case 19: - vv = thermo_critTemperature(n); - break; - case 20: - vv = thermo_critPressure(n); - break; - case 21: - vv = thermo_critDensity(n); - break; - case 22: - vv = thermo_vaporFraction(n); - break; - case 23: - psat = getDouble(prhs[3]); - vv = thermo_satTemperature(n, psat); - break; - case 24: - tsat = getDouble(prhs[3]); - vv = thermo_satPressure(n, tsat); - break; - case 25: - vv = thermo_electricPotential(n); - break; - case 26: - vv = thermo_isothermalCompressibility(n); - break; - case 27: - vv = thermo_thermalExpansionCoeff(n); - break; - default: - ok = false; - } - if (ok) { - if (vv == DERR) { - reportError(); - } - plhs[0] = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, mxREAL); - double* h = mxGetPr(plhs[0]); - *h = vv; - return; - } - } else if (job < 50) { - int iok = 0; - size_t nsp = thermo_nSpecies(n); - std::vector x(nsp); - switch (job) { - case 32: - iok = thermo_getEnthalpies_RT(n, nsp, &x[0]); - break; - case 34: - iok = thermo_chemPotentials(n, nsp, &x[0]); - break; - case 36: - iok = thermo_getEntropies_R(n, nsp, &x[0]); - break; - case 38: - iok = thermo_getCp_R(n, nsp, &x[0]); - break; - default: - ; - } - plhs[0] = mxCreateNumericMatrix((mwSize) nsp, 1, mxDOUBLE_CLASS, mxREAL); - double* h = mxGetPr(plhs[0]); - if (iok >= 0) { - for (size_t i = 0; i < nsp; i++) { - h[i] = x[i]; - } - return; - } else { - for (size_t i = 0; i < nsp; i++) { - h[i] = -999.99; - } - mexErrMsgTxt("unknown attribute"); - return; - } - } else { - mexErrMsgTxt("unknown attribute"); - } -} - - -void thermomethods(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) -{ - int job = getInt(prhs[2]); - if (job < 0) { - thermoset(nlhs, plhs, nrhs, prhs); - } else { - thermoget(nlhs, plhs, nrhs, prhs); - } -} diff --git a/src/matlab/transportmethods.cpp b/src/matlab/transportmethods.cpp deleted file mode 100644 index d282b46ec5..0000000000 --- a/src/matlab/transportmethods.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include - -#include "cantera/clib/ct.h" -#include "ctmatutils.h" - -void reportError(); - -void transportmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - double vv = 0.0; - int n = getInt(prhs[1]); - int job = getInt(prhs[2]); - double* h; - int iok = 0; - int nsp; - - if (job == -1) { - char* model = getString(prhs[3]); - int loglevel = getInt(prhs[4]); - int m = -2; - m = (int) trans_new(model, n, loglevel); - if (m < 0) { - reportError(); - } - - // Create matrix for the return argument. - plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL); - double* x = mxGetPr(plhs[0]); - *x = m; - return; - } else if (job == -2) { - int loglevel = getInt(prhs[3]); - int m = -2; - m = (int) trans_newDefault(n, loglevel); - if (m < 0) { - reportError(); - } - - // Create matrix for the return argument. - plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL); - double* x = mxGetPr(plhs[0]); - *x = m; - return; - } - - if (job < 10) { - switch (job) { - case 0: - trans_del(n); - vv = 0.0; - break; - case 1: - vv = trans_viscosity(n); - break; - case 2: - vv = trans_thermalConductivity(n); - break; - case 3: - vv = trans_electricalConductivity(n); - break; - default: - mexErrMsgTxt("unknown Transport method"); - } - if (vv < 0.0) { - reportError(); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - h = mxGetPr(plhs[0]); - *h = vv; - return; - } else if (job < 20) { - nsp = getInt(prhs[3]); - plhs[0] = mxCreateNumericMatrix(nsp,1,mxDOUBLE_CLASS,mxREAL); - h = mxGetPr(plhs[0]); - - switch (job) { - case 11: - iok = trans_getMixDiffCoeffs(n, nsp, h); - break; - case 12: - iok = trans_getThermalDiffCoeffs(n, nsp, h); - break; - default: - mexErrMsgTxt("unknown Transport method"); - } - } else if (job < 30) { - nsp = getInt(prhs[3]); - plhs[0] = mxCreateNumericMatrix(nsp,nsp,mxDOUBLE_CLASS,mxREAL); - h = mxGetPr(plhs[0]); - switch (job) { - case 21: - iok = trans_getBinDiffCoeffs(n, nsp, h); - break; - case 22: - iok = trans_getMultiDiffCoeffs(n, nsp, h); - break; - default: - mexErrMsgTxt("unknown Transport method"); - } - } else { - mexErrMsgTxt("unknown Transport method"); - } - if (iok < 0) { - reportError(); - } -} diff --git a/src/matlab/wallmethods.cpp b/src/matlab/wallmethods.cpp deleted file mode 100644 index 9acb5f9b00..0000000000 --- a/src/matlab/wallmethods.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file wallmethods.cpp - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/clib/ctreactor.h" -#include "cantera/clib/ct.h" -#include "ctmatutils.h" - -void wallmethods(int nlhs, mxArray* plhs[], - int nrhs, const mxArray* prhs[]) -{ - int m, iok = 0, n; - int job = getInt(prhs[1]); - double r = Undef; - double v = Undef; - if (nrhs > 3) { - v = getDouble(prhs[3]); - } - - // constructor - if (job == 0) { - char* type = getString(prhs[2]); - n = wall_new(type); - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(n); - if (n < 0) { - reportError(); - } - return; - } - - // options that do not return a value - - int i = getInt(prhs[2]); - if (job < 20) { - switch (job) { - case 1: - iok = wall_del(i); - break; - case 4: - m = getInt(prhs[4]); - iok = wall_install(i, int(v), m); - break; - case 5: - iok = wall_setArea(i, v); - break; - case 6: - iok = wall_setThermalResistance(i, v); - break; - case 7: - iok = wall_setHeatTransferCoeff(i, v); - break; - case 8: - iok = wall_setHeatFlux(i, int(v)); - break; - case 9: - iok = wall_setExpansionRateCoeff(i, v); - break; - case 10: - iok = wall_setVelocity(i, int(v)); - break; - case 11: - iok = wall_ready(i); - break; - case 13: - iok = wall_setEmissivity(i, v); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = double(iok); - if (iok < 0) { - reportError(); - } - return; - } else if (job < 40) { - // options that return a value of type 'double' - switch (job) { - case 21: - r = wall_vdot(i, v); - break; - case 22: - r = wall_Q(i, v); - break; - case 23: - r = wall_area(i); - break; - default: - mexErrMsgTxt("unknown job parameter"); - } - plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); - double* h = mxGetPr(plhs[0]); - *h = r; - if (r == DERR) { - reportError(); - } - return; - } -} diff --git a/test/matlab/TestImport.m b/test/matlab/TestImport.m deleted file mode 100644 index 147107f699..0000000000 --- a/test/matlab/TestImport.m +++ /dev/null @@ -1,12 +0,0 @@ -classdef TestImport < TestCase - methods - function self = TestImport(name) - self = self@TestCase(name); - end - - function testImportYaml(self) - gas = Solution('h2o2.yaml'); - assertEqual(temperature(gas), 300) - end - end -end diff --git a/test/matlab/TestThermo.m b/test/matlab/TestThermo.m deleted file mode 100644 index c6d332353e..0000000000 --- a/test/matlab/TestThermo.m +++ /dev/null @@ -1,72 +0,0 @@ -classdef TestThermo < TestCase - properties - gas - end - - methods - function self = TestThermo(name) - self = self@TestCase(name); - end - - function setUp(self) - global staticTestThermoGas - if isempty(staticTestThermoGas) - staticTestThermoGas = Solution('../data/steam-reforming.yaml', 'full'); - end - self.gas = staticTestThermoGas; - set(self.gas, 'T', 300, 'P', oneatm, 'Y', [0.5, 0, 0.5, 0, 0, 0, 0]); - end - -% function tearDown(self) -% end - - function testCounts(self) - assertEqual(nElements(self.gas), 4) - assertEqual(nSpecies(self.gas), 7) - end - - function testElements(self) - for i = 1:nElements(self.gas) - name = elementName(self.gas, i); - assertEqual(i, elementIndex(self.gas, name)) - end - end - - function testSpecies(self) - for i = 1:nSpecies(self.gas) - name = speciesName(self.gas, i); - assertEqual(i, speciesIndex(self.gas, name)) - end - end - - function test_nAtoms(self) - assertEqual(nAtoms(self.gas, 1, 3), 4) - assertEqual(nAtoms(self.gas, 1, 4), 0) - assertEqual(nAtoms(self.gas, 3, 2), 2) - assertExceptionThrown(@() nAtoms(self.gas, 2, 5), '') - assertExceptionThrown(@() nAtoms(self.gas, 8, 1), '') - end - - function testSetState(self) - u0 = intEnergy_mass(self.gas); - h0 = enthalpy_mass(self.gas); - s0 = entropy_mass(self.gas); - v0 = 1/density(self.gas); - T0 = temperature(self.gas); - P0 = pressure(self.gas); - - set(self.gas, 'T', 400, 'P', 5*oneatm); - assertAlmostEqual(temperature(self.gas), 400) - assertAlmostEqual(pressure(self.gas), 5*oneatm) - - set(self.gas, 'H', h0, 'P', P0); - assertAlmostEqual(temperature(self.gas), T0, 1e-8) - assertAlmostEqual(entropy_mass(self.gas), s0, 1e-8) - - set(self.gas, 'T', 400, 'P', 5*oneatm); - set(self.gas, 'U', u0, 'V', v0); - assertAlmostEqual(pressure(self.gas), P0, 1e-8) - assertAlmostEqual(enthalpy_mass(self.gas), h0, 1e-8) - end - end -end diff --git a/test/matlab/runCanteraTests.m b/test/matlab/runCanteraTests.m deleted file mode 100644 index a542b82927..0000000000 --- a/test/matlab/runCanteraTests.m +++ /dev/null @@ -1,19 +0,0 @@ -function runCanteraTests(varargin) -% Set Cantera paths -run ../../interfaces/matlab/testpath.m - -% Set test framework path -path('../../ext/matlab_xunit', path) - -% run the tests -if nargin == 0 - runtests -verbose -else - runtests('-verbose','-logfile',varargin{1}) -end - -% unload the MEX file -clear ctmethods - -% delete global objects created by some of the test -clear global static* From 387ce962e4d2ccca9c27aa94a1349c66b46e238c Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 18:24:06 -0600 Subject: [PATCH 2/9] [MATLAB-legacy] Remove ext/matlab_xunit --- ext/matlab_xunit/+xunit/+utils/Contents.m | 24 -- .../+xunit/+utils/arrayToString.m | 96 ----- .../+xunit/+utils/compareFloats.m | 128 ------- .../+xunit/+utils/comparisonMessage.m | 33 -- .../+xunit/+utils/containsRegexp.m | 17 - ext/matlab_xunit/+xunit/+utils/generateDoc.m | 14 - .../+xunit/+utils/isAlmostEqual.m | 46 --- .../+xunit/+utils/isSetUpString.m | 12 - .../+xunit/+utils/isTearDownString.m | 12 - .../+xunit/+utils/isTestCaseSubclass.m | 39 -- ext/matlab_xunit/+xunit/+utils/isTestString.m | 15 - .../+xunit/+utils/parseFloatAssertInputs.m | 56 --- .../+xunit/+utils/stringToCellArray.m | 14 - .../CommandWindowTestRunDisplay.m | 30 -- ext/matlab_xunit/Contents.m | 33 -- ext/matlab_xunit/FunctionHandleTestCase.m | 154 -------- ext/matlab_xunit/README.txt | 3 - ext/matlab_xunit/TestCase.m | 103 ------ ext/matlab_xunit/TestCaseInDir.m | 30 -- ext/matlab_xunit/TestCaseWithAddPath.m | 53 --- ext/matlab_xunit/TestComponent.m | 59 --- ext/matlab_xunit/TestComponentInDir.m | 58 --- ext/matlab_xunit/TestRunDisplay.m | 258 ------------- ext/matlab_xunit/TestRunLogger.m | 104 ------ ext/matlab_xunit/TestRunMonitor.m | 35 -- ext/matlab_xunit/TestSuite.m | 342 ------------------ ext/matlab_xunit/TestSuiteInDir.m | 50 --- ext/matlab_xunit/VerboseTestRunDisplay.m | 112 ------ ext/matlab_xunit/assertAlmostEqual.m | 52 --- ext/matlab_xunit/assertElementsAlmostEqual.m | 61 ---- ext/matlab_xunit/assertEqual.m | 43 --- ext/matlab_xunit/assertExceptionThrown.m | 53 --- ext/matlab_xunit/assertFalse.m | 31 -- ext/matlab_xunit/assertFilesEqual.m | 68 ---- ext/matlab_xunit/assertTrue.m | 33 -- ext/matlab_xunit/assertVectorsAlmostEqual.m | 59 --- ext/matlab_xunit/info.xml | 28 -- ext/matlab_xunit/initTestSuite.m | 58 --- ext/matlab_xunit/license.txt | 27 -- ext/matlab_xunit/runtests.m | 160 -------- 40 files changed, 2603 deletions(-) delete mode 100644 ext/matlab_xunit/+xunit/+utils/Contents.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/arrayToString.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/compareFloats.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/comparisonMessage.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/containsRegexp.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/generateDoc.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/isAlmostEqual.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/isSetUpString.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/isTearDownString.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/isTestCaseSubclass.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/isTestString.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/parseFloatAssertInputs.m delete mode 100644 ext/matlab_xunit/+xunit/+utils/stringToCellArray.m delete mode 100644 ext/matlab_xunit/CommandWindowTestRunDisplay.m delete mode 100644 ext/matlab_xunit/Contents.m delete mode 100644 ext/matlab_xunit/FunctionHandleTestCase.m delete mode 100644 ext/matlab_xunit/README.txt delete mode 100644 ext/matlab_xunit/TestCase.m delete mode 100644 ext/matlab_xunit/TestCaseInDir.m delete mode 100644 ext/matlab_xunit/TestCaseWithAddPath.m delete mode 100644 ext/matlab_xunit/TestComponent.m delete mode 100644 ext/matlab_xunit/TestComponentInDir.m delete mode 100644 ext/matlab_xunit/TestRunDisplay.m delete mode 100644 ext/matlab_xunit/TestRunLogger.m delete mode 100644 ext/matlab_xunit/TestRunMonitor.m delete mode 100644 ext/matlab_xunit/TestSuite.m delete mode 100644 ext/matlab_xunit/TestSuiteInDir.m delete mode 100644 ext/matlab_xunit/VerboseTestRunDisplay.m delete mode 100644 ext/matlab_xunit/assertAlmostEqual.m delete mode 100644 ext/matlab_xunit/assertElementsAlmostEqual.m delete mode 100644 ext/matlab_xunit/assertEqual.m delete mode 100644 ext/matlab_xunit/assertExceptionThrown.m delete mode 100644 ext/matlab_xunit/assertFalse.m delete mode 100644 ext/matlab_xunit/assertFilesEqual.m delete mode 100644 ext/matlab_xunit/assertTrue.m delete mode 100644 ext/matlab_xunit/assertVectorsAlmostEqual.m delete mode 100644 ext/matlab_xunit/info.xml delete mode 100644 ext/matlab_xunit/initTestSuite.m delete mode 100644 ext/matlab_xunit/license.txt delete mode 100644 ext/matlab_xunit/runtests.m diff --git a/ext/matlab_xunit/+xunit/+utils/Contents.m b/ext/matlab_xunit/+xunit/+utils/Contents.m deleted file mode 100644 index 7b0f017034..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/Contents.m +++ /dev/null @@ -1,24 +0,0 @@ -% UTILS Utility package for MATLAB xUnit Test Framework -% -% Array Comparison -% compareFloats - Compare floating-point arrays using tolerance -% -% Test Case Discovery Functions -% isTestCaseSubclass - True for name of TestCase subclass -% -% String Functions -% arrayToString - Convert array to string for display -% comparisonMessage - Assertion message string for comparing two arrays -% containsRegexp - True if string contains regular expression -% isSetUpString - True for string that looks like a setup function -% isTearDownString - True for string that looks like teardown function -% isTestString - True for string that looks like a test function -% stringToCellArray - Convert string to cell array of strings -% -% Miscellaneous Functions -% generateDoc - Publish test scripts in mtest/doc -% parseFloatAssertInputs - Common input-parsing logic for several functions - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - diff --git a/ext/matlab_xunit/+xunit/+utils/arrayToString.m b/ext/matlab_xunit/+xunit/+utils/arrayToString.m deleted file mode 100644 index 87bad514cd..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/arrayToString.m +++ /dev/null @@ -1,96 +0,0 @@ -function s = arrayToString(A) -%arrayToString Convert array to string for display. -% S = arrayToString(A) converts the array A into a string suitable for -% including in assertion messages. Small arrays are converted using disp(A). -% Large arrays are displayed similar to the way structure field values display -% using disp. - -% Steven L. Eddins -% Copyright 2009 The MathWorks, Inc. - -if isTooBigToDisp(A) - s = dispAsStructField(A); -else - s = dispAsArray(A); -end - -%=============================================================================== -function tf = isTooBigToDisp(A) -% Use a heuristic to determine if the array is to convert to a string using -% disp. The heuristic is based on the size of the array in bytes, as reported -% by the whos function. - -whos_output = whos('A'); -byte_threshold = 1000; -tf = whos_output.bytes > byte_threshold; - -%=============================================================================== -function s = dispAsArray(A) -% Convert A to a string using disp. Remove leading and trailing blank lines. - -s = evalc('disp(A)'); -if isempty(s) - % disp displays nothing for some kinds of empty arrays. - s = dispAsStructField(A); -else - s = postprocessDisp(s); -end - -%=============================================================================== -function s = dispAsStructField(A) -% Convert A to a string using structure field display. - -b.A = A; -s = evalc('disp(b)'); -s = postprocessStructDisp(s); - -%=============================================================================== -function out = postprocessDisp(in) -% Remove leading and trailing blank lines from input string. Don't include a -% newline at the end. - -lines = xunit.utils.stringToCellArray(in); - -% Remove leading blank lines. -lines = removeLeadingBlankLines(lines); - -% Remove trailing blank lines. -while ~isempty(lines) && isBlankLine(lines{end}) - lines(end) = []; -end - -% Convert cell of strings to single string with newlines. Don't put a newline -% at the end. -out = sprintf('%s\n', lines{1:end-1}); -out = [out, lines{end}]; - -%=============================================================================== -function out = postprocessStructDisp(in) -% Return the portion of the display string to the right of the colon in the -% output of the first structure field. Input is a string. - -lines = xunit.utils.stringToCellArray(in); - -% Remove leading blank lines -lines = removeLeadingBlankLines(lines); - -line = lines{1}; -idx = find(line == ':'); -out = line((idx+2):end); % struct fields display with blank space following colon - -%=============================================================================== -function out = removeLeadingBlankLines(in) -% Input and output are cell arrays of strings. - -out = in; -while ~isempty(out) && isBlankLine(out{1}) - out(1) = []; -end - -%=============================================================================== -function tf = isBlankLine(line) -% Input is a string. - -tf = all(isspace(line)); - - diff --git a/ext/matlab_xunit/+xunit/+utils/compareFloats.m b/ext/matlab_xunit/+xunit/+utils/compareFloats.m deleted file mode 100644 index f4ec111e27..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/compareFloats.m +++ /dev/null @@ -1,128 +0,0 @@ -function result = compareFloats(varargin) -%compareFloats Compare floating-point arrays using tolerance. -% result = compareFloats(A, B, compare_type, tol_type, tol, floor_tol) -% compares the floating-point arrays A and B using a tolerance. compare_type -% is either 'elementwise' or 'vector'. tol_type is either 'relative' or -% 'absolute'. tol and floor_tol are the scalar tolerance values. -% -% There are four different tolerance tests used, depending on the comparison -% type and the tolerance type: -% -% 1. Comparison type: 'elementwise' Tolerance type: 'relative' -% -% all( abs(A(:) - B(:)) <= tol * max(abs(A(:)), abs(B(:))) + floor_tol ) -% -% 2. Comparison type: 'elementwise' Tolerance type: 'absolute' -% -% all( abs(A(:) - B(:) <= tol ) -% -% 3. Comparison type: 'vector' Tolerance type: 'relative' -% -% norm(A(:) - B(:) <= tol * max(norm(A(:)), norm(B(:))) + floor_tol -% -% 4. Comparison type: 'vector' Tolerance type: 'absolute' -% -% norm(A(:) - B(:)) <= tol -% -% Note that floor_tol is not used when the tolerance type is 'absolute'. -% -% compare_type, tol_type, tol, and floor_tol are all optional inputs. The -% default value for compare_type is 'elementwise'. The default value for -% tol_type is 'relative'. If both A and B are double, then the default value -% for tol is sqrt(eps), and the default value for floor_tol is eps. If either -% A or B is single, then the default value for tol is sqrt(eps('single')), and -% the default value for floor_tol is eps('single'). -% -% If A or B is complex, then the tolerance test is applied independently to -% the real and imaginary parts. -% -% For elementwise comparisons, compareFloats returns true for two elements -% that are both NaN, or for two infinite elements that have the same sign. -% For vector comparisons, compareFloats returns false if any input elements -% are infinite or NaN. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -if nargin >= 3 - % compare_type specified. Grab it and then use parseFloatAssertInputs to - % process the remaining input arguments. - compare_type = varargin{3}; - varargin(3) = []; - if isempty(strcmp(compare_type, {'elementwise', 'vector'})) - error('compareFloats:unrecognizedCompareType', ... - 'COMPARE_TYPE must be ''elementwise'' or ''vector''.'); - end -else - compare_type = 'elementwise'; -end - -params = xunit.utils.parseFloatAssertInputs(varargin{:}); - -A = params.A(:); -B = params.B(:); - -switch compare_type - case 'elementwise' - magFcn = @abs; - - case 'vector' - magFcn = @norm; - - otherwise - error('compareFloats:unrecognizedCompareType', ... - 'COMPARE_TYPE must be ''elementwise'' or ''vector''.'); -end - -switch params.ToleranceType - case 'relative' - coreCompareFcn = @(A, B) magFcn(A - B) <= ... - params.Tolerance * max(magFcn(A), magFcn(B)) + ... - params.FloorTolerance; - - case 'absolute' - coreCompareFcn = @(A, B) magFcn(A - B) <= params.Tolerance; - - otherwise - error('compareFloats:unrecognizedToleranceType', ... - 'TOL_TYPE must be ''relative'' or ''absolute''.'); -end - -if strcmp(compare_type, 'elementwise') - compareFcn = @(A, B) ( coreCompareFcn(A, B) | bothNaN(A, B) | sameSignInfs(A, B) ) & ... - ~oppositeSignInfs(A, B) & ... - ~finiteAndInfinite(A, B); -else - compareFcn = @(A, B) coreCompareFcn(A, B) & ... - isfinite(magFcn(A)) & ... - isfinite(magFcn(B)); -end - -if isreal(A) && isreal(B) - result = compareFcn(A, B); -else - result = compareFcn(real(A), real(B)) & compareFcn(imag(A), imag(B)); -end - -result = all(result); - -%=============================================================================== -function out = bothNaN(A, B) - -out = isnan(A) & isnan(B); - -%=============================================================================== -function out = oppositeSignInfs(A, B) - -out = isinf(A) & isinf(B) & (sign(A) ~= sign(B)); - -%=============================================================================== -function out = sameSignInfs(A, B) - -out = isinf(A) & isinf(B) & (sign(A) == sign(B)); - -%=============================================================================== -function out = finiteAndInfinite(A, B) - -out = xor(isinf(A), isinf(B)); - diff --git a/ext/matlab_xunit/+xunit/+utils/comparisonMessage.m b/ext/matlab_xunit/+xunit/+utils/comparisonMessage.m deleted file mode 100644 index 68e9a5213c..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/comparisonMessage.m +++ /dev/null @@ -1,33 +0,0 @@ -function msg = comparisonMessage(user_message, assertion_message, A, B) -%comparisonMessage Generate assertion message when comparing two arrays. -% msg = comparisonMessage(user_message, assertion_message, A, B) returns a -% string appropriate to use in a call to throw inside an assertion function -% that compares two arrays A and B. -% -% The string returned has the following form: -% -% -% -% -% First input: -% -% -% Second input: -% -% -% user_message can be the empty string, '', in which case user_message is -% skipped. - -% Steven L. Eddins -% Copyright 2009 The MathWorks, Inc. - -msg = sprintf('%s\n\n%s\n%s\n\n%s\n%s', ... - assertion_message, ... - 'First input:', ... - xunit.utils.arrayToString(A), ... - 'Second input:', ... - xunit.utils.arrayToString(B)); - -if ~isempty(user_message) - msg = sprintf('%s\n%s', user_message, msg); -end diff --git a/ext/matlab_xunit/+xunit/+utils/containsRegexp.m b/ext/matlab_xunit/+xunit/+utils/containsRegexp.m deleted file mode 100644 index efbc51bcbb..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/containsRegexp.m +++ /dev/null @@ -1,17 +0,0 @@ -function tf = containsRegexp(str, exp) -%containsRegexp True if string contains regular expression -% TF = containsRegexp(str, exp) returns true if the string str contains the -% regular expression exp. If str is a cell array of strings, then -% containsRegexp tests each string in the cell array, returning the results in -% a logical array with the same size as str. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -% Convert to canonical input form: A cell array of strings. -if ~iscell(str) - str = {str}; -end - -matches = regexp(str, exp); -tf = ~cellfun('isempty', matches); diff --git a/ext/matlab_xunit/+xunit/+utils/generateDoc.m b/ext/matlab_xunit/+xunit/+utils/generateDoc.m deleted file mode 100644 index 6a9959aeff..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/generateDoc.m +++ /dev/null @@ -1,14 +0,0 @@ -function generateDoc -%generateDoc Publish the example scripts in the doc directory - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -doc_dir = fullfile(fileparts(which('runtests')), '..', 'doc'); -addpath(doc_dir); -cd(doc_dir) -mfiles = dir('*.m'); -for k = 1:numel(mfiles) - publish(mfiles(k).name); - cd(doc_dir) -end diff --git a/ext/matlab_xunit/+xunit/+utils/isAlmostEqual.m b/ext/matlab_xunit/+xunit/+utils/isAlmostEqual.m deleted file mode 100644 index 7ad43933d5..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/isAlmostEqual.m +++ /dev/null @@ -1,46 +0,0 @@ -function same = isAlmostEqual(A, B, reltol) -%isAlmostEqual Equality test using relative tolerance -% same = isAlmostEqual(A, B, reltol), for two floating-point arrays A and B, -% tests A and B for equality using the specified relative tolerance. -% isAlmostEqual returns true if the following relationship is satisfied for -% all values in A and B: -% -% abs(A - B) ./ max(abs(A), abs(B)) <= reltol -% -% same = isAlmostEqual(A, B) uses the following value for the relative -% tolerance: -% -% 100 * max(eps(class(A)), eps(class(B))) -% -% If either A or B is not a floating-point array, then isAlmostEqual returns -% the result of isequal(A, B). - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -if ~isfloat(A) || ~isfloat(B) - same = isequal(A, B); - return -end - -if nargin < 3 - reltol = 100 * max(eps(class(A)), eps(class(B))); -end - -if ~isequal(size(A), size(B)) - same = false; - return -end - -A = A(:); -B = B(:); - -delta = abs(A - B) ./ max(max(abs(A), abs(B)), 1); - -% Some floating-point values require special handling. -delta((A == 0) & (B == 0)) = 0; -delta(isnan(A) & isnan(B)) = 0; -delta((A == Inf) & (B == Inf)) = 0; -delta((A == -Inf) & (B == -Inf)) = 0; - -same = all(delta <= reltol); diff --git a/ext/matlab_xunit/+xunit/+utils/isSetUpString.m b/ext/matlab_xunit/+xunit/+utils/isSetUpString.m deleted file mode 100644 index e3204fbd92..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/isSetUpString.m +++ /dev/null @@ -1,12 +0,0 @@ -function tf = isSetUpString(str) -%isSetUpString True if string looks like the name of a setup function -% tf = isSetUpString(str) returns true if the string str looks like the name -% of a setup function. If str is a cell array of strings, then isSetUpString -% tests each string in the cell array, returning the results in a logical -% array with the same size as str. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -setup_exp = '^[sS]et[uU]p'; -tf = xunit.utils.containsRegexp(str, setup_exp); diff --git a/ext/matlab_xunit/+xunit/+utils/isTearDownString.m b/ext/matlab_xunit/+xunit/+utils/isTearDownString.m deleted file mode 100644 index 6077a81f96..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/isTearDownString.m +++ /dev/null @@ -1,12 +0,0 @@ -function tf = isTearDownString(str) -%isTearDownString True if string looks like the name of a teardown function -% tf = isTearDownString(str) returns true if the string str looks like the -% name of a teardown function. If str is a cell array of strings, then -% isTearDownString tests each string in the cell array, returning the results -% in a logical array with the same size as str. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -setup_exp = '^[tT]ear[dD]own'; -tf = xunit.utils.containsRegexp(str, setup_exp); diff --git a/ext/matlab_xunit/+xunit/+utils/isTestCaseSubclass.m b/ext/matlab_xunit/+xunit/+utils/isTestCaseSubclass.m deleted file mode 100644 index 4df0c7fd4f..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/isTestCaseSubclass.m +++ /dev/null @@ -1,39 +0,0 @@ -function tf = isTestCaseSubclass(name) -%isTestCaseSubclass True for name of a TestCase subclass -% tf = isTestCaseSubclass(name) returns true if the string name is the name of -% a TestCase subclass on the MATLAB path. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -tf = false; - -class_meta = meta.class.fromName(name); -if isempty(class_meta) - % Not the name of a class - return; -end - -if strcmp(class_meta.Name, 'TestCase') - tf = true; -else - tf = isMetaTestCaseSubclass(class_meta); -end - -function tf = isMetaTestCaseSubclass(class_meta) - -tf = false; - -if strcmp(class_meta.Name, 'TestCase') - tf = true; -else - % Invoke function recursively on parent classes. - super_classes = class_meta.SuperClasses; - for k = 1:numel(super_classes) - if isMetaTestCaseSubclass(super_classes{k}) - tf = true; - break; - end - end -end - diff --git a/ext/matlab_xunit/+xunit/+utils/isTestString.m b/ext/matlab_xunit/+xunit/+utils/isTestString.m deleted file mode 100644 index e7053d4af7..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/isTestString.m +++ /dev/null @@ -1,15 +0,0 @@ -function tf = isTestString(str) -%isTestString True if string looks like the name of a test -% tf = isTestString(str) returns true if the string str looks like the name of -% a test. If str is a cell array of strings, then isTestString tests each -% string in the cell array, returning the results in a logical array with the -% same size as str. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -test_at_beginning = '^[tT]est'; -test_at_end = '[tT]est$'; - -tf = xunit.utils.containsRegexp(str, test_at_beginning) | ... - xunit.utils.containsRegexp(str, test_at_end); diff --git a/ext/matlab_xunit/+xunit/+utils/parseFloatAssertInputs.m b/ext/matlab_xunit/+xunit/+utils/parseFloatAssertInputs.m deleted file mode 100644 index b36366e90a..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/parseFloatAssertInputs.m +++ /dev/null @@ -1,56 +0,0 @@ -function params = parseFloatAssertInputs(varargin) -%parseFloatAssertInputs Parse inputs for floating-point assertion functions. -% params = parseFloatAssertInputs(varargin) parses the input arguments for -% assertElementsAlmostEqual, assertVectorsAlmostEqual, and compareFcn. It -% returns a parameter struct containing the fields: -% -% A B Message ToleranceType Tolerance FloorTolerance - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -error(nargchk(2, 6, nargin, 'struct')); - -params = struct('A', {[]}, 'B', {[]}, 'ToleranceType', {[]}, ... - 'Tolerance', {[]}, 'FloorTolerance', {[]}, 'Message', {''}); - -% The first two input arguments are always A and B. -params.A = varargin{1}; -params.B = varargin{2}; -varargin(1:2) = []; - -% If the last argument is a message string, process it and remove it from the list. -if (numel(varargin) >= 1) && ischar(varargin{end}) && ... - ~any(strcmp(varargin{end}, {'relative', 'absolute'})) - params.Message = varargin{end}; - varargin(end) = []; -else - params.Message = ''; -end - -try - epsilon = max(eps(class(params.A)), eps(class(params.B))); -catch - epsilon = eps; -end - -if numel(varargin) < 3 - % floor_tol not specified; set default. - params.FloorTolerance = sqrt(epsilon); -else - params.FloorTolerance = varargin{3}; -end - -if numel(varargin) < 2 - % tol not specified; set default. - params.Tolerance = sqrt(epsilon); -else - params.Tolerance = varargin{2}; -end - -if numel(varargin) < 1 - % tol_type not specified; set default. - params.ToleranceType = 'relative'; -else - params.ToleranceType = varargin{1}; -end diff --git a/ext/matlab_xunit/+xunit/+utils/stringToCellArray.m b/ext/matlab_xunit/+xunit/+utils/stringToCellArray.m deleted file mode 100644 index e2025aa4d8..0000000000 --- a/ext/matlab_xunit/+xunit/+utils/stringToCellArray.m +++ /dev/null @@ -1,14 +0,0 @@ -function c = stringToCellArray(s) -%stringToCellArray Convert string with newlines to cell array of strings. -% C = stringToCellArray(S) converts the input string S to a cell array of -% strings, breaking up S at new lines. - -% Steven L. Eddins -% Copyright 2009 The MathWorks, Inc. - -if isempty(s) - c = cell(0, 1); -else - c = textscan(s, '%s', 'Delimiter', '\n', 'Whitespace', ''); - c = c{1}; -end diff --git a/ext/matlab_xunit/CommandWindowTestRunDisplay.m b/ext/matlab_xunit/CommandWindowTestRunDisplay.m deleted file mode 100644 index 01676317e1..0000000000 --- a/ext/matlab_xunit/CommandWindowTestRunDisplay.m +++ /dev/null @@ -1,30 +0,0 @@ -classdef CommandWindowTestRunDisplay < TestRunDisplay - %CommandWindowTestRunDisplay Print test suite execution results to Command Window. - % CommandWindowTestRunDisplay is a subclass of TestRunMonitor. If a - % CommandWindowTestRunDisplay object is passed to the run method of a - % TestComponent, such as a TestSuite or a TestCase, it will print information - % to the Command Window as the test run proceeds. - % - % CommandWindowTestRunDisplay methods: - % testComponentStarted - Update Command Window display - % testComponentFinished - Update Command Window display - % testCaseFailure - Log test failure information - % testCaseError - Log test error information - % - % CommandWindowTestRunDisplay properties: - % TestCaseCount - Number of test cases executed - % Faults - Struct array of test fault info - % - % See also TestRunLogger, TestRunMonitor, TestSuite - - % Steven L. Eddins - % Copyright 2008-2010 The MathWorks, Inc. - - methods - function self = CommandWindowTestRunDisplay - self = self@TestRunDisplay(1); - end - end - -end - diff --git a/ext/matlab_xunit/Contents.m b/ext/matlab_xunit/Contents.m deleted file mode 100644 index 79b2579eb1..0000000000 --- a/ext/matlab_xunit/Contents.m +++ /dev/null @@ -1,33 +0,0 @@ -% MATLAB xUnit Test Framework -% Version 3.1 (R2010b) 19-Nov-2010 -% -% Running Unit Tests -% runtests - Run unit tests -% -% Writing Unit Tests -% assertElementsAlmostEqual - Assert floating-point array elements almost equal -% assertEqual - Assert that inputs are equal -% assertFilesEqual - Assert that two files have the same content -% assertExceptionThrown - Assert that specified exception is thrown -% assertFalse - Assert that input condition is false -% assertTrue - Assert that input condition is true -% assertVectorsAlmostEqual - Assert floating-point vectors almost equal in norm sense -% initTestSuite - Utility script used for subfunction-based tests -% -% Framework Classes -% CommandWindowTestRunDisplay - Print test suite results to command window -% FunctionHandleTestCase - Test case based on a function handle -% TestCase - Class defining interface for test cases -% TestCaseInDir - Test case requiring temporary directory change -% TestCaseWithAddPath - Test case requiring temporary path modification -% TestComponent - Abstract base class for TestCase and TestSuite -% TestComponentInDir - Test component requiring temporary directory change -% TestLogger - Collect data (silently) from running test suite -% TestRunDisplay - Print test suite execution results -% TestRunMonitor - Abstract base class for monitoring test suite -% TestSuite - Collection of TestComponent objects -% TestSuiteInDir - Test suite requiring temporary directory change -% %VerboseTestRunDisplay - Print test suite execution results - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. \ No newline at end of file diff --git a/ext/matlab_xunit/FunctionHandleTestCase.m b/ext/matlab_xunit/FunctionHandleTestCase.m deleted file mode 100644 index 7f8028c216..0000000000 --- a/ext/matlab_xunit/FunctionHandleTestCase.m +++ /dev/null @@ -1,154 +0,0 @@ -classdef FunctionHandleTestCase < TestCase -%FunctionHandleTestCase Test case based on a function handle -% FunctionHandleTestCase is a TestCase subclass. It defines a test case object -% that executes by running a function handle instead of by running a method of -% the TestCase subclass. -% -% FunctionHandleTestCase methods: -% FunctionHandleTestCase - Constructor -% runTestCase - Run function handle test -% setUp - Run test-fixture setup function -% tearDown - Run test-fixture teardown function -% -% FunctionHandleTestCase properties: -% TestFcn - Function handle of test function -% SetupFcn - Function handle of setup function -% TeardownFcn - Function handle of teardown function -% TestData - Data needed by test function or teardown function -% -% See also TestCase, TestSuite - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - - properties (SetAccess = protected, GetAccess = protected, Hidden = true) - %TestFcn - Function handle of test function - % If SetupFcn has one or more output arguments, then TestFcn is - % called with this syntax: - % - % TestFcn(data) - % - % where data is the return value from SetupFcn. Otherwise, TestFcn is - % called with no input and no output arguments. - TestFcn; - - %SetupFcn - Function handle of setup function - % If SetupFcn has one or more output arguments, then SetupFcn is - % called with this syntax: - % - % data = SetupFcn() - % - % and data will be saved in the TestData property. Otherwise, SetupFcn - % is called with no input and no output arguments. - SetupFcn; - - %TeardownFcn - Function handle of teardown function - % If SetupFcn has one or more output arguments, then TeardownFcn is - % called with this syntax: - % - % TeardownFcn(data) - % - % were data is the return value from SetupFcn. Otherwise, TeardownFcn - % is called with no input and no output arguments. - TeardownFcn; - - %TestData - Data needed by test function or teardown function. - TestData; - end - - methods - function self = FunctionHandleTestCase(testFcn, setupFcn, teardownFcn) - %FunctionHandleTestCase Constructor - % FunctionHandleTestCase(testFcn, setupFcn, teardownFcn) creates a - % TestCase object that executes by running the function handle - % TestFcn. setupFcn is a function handle that will be executed - % before testFcn, and teardownFcn is a function handle that will - % be executed after TestFcn. Either setupFcn or teardownFcn can - % be empty. - % - % If setupFcn is function handle that has one output argument, - % then the three test functions will be called using these - % syntaxes: - % - % testData = setupFcn(); - % testFcn(testData); - % teardownFcn(testData); - % - % Otherwise, the three test functions are all called with no input - % arguments: - % - % setupFcn(); - % TestFcn(); - % teardownFcn(); - - % Call the base class constructor. Give it the name of the - % FunctionHandleTestCase method that executes TestFcn. - self = self@TestCase('runTestCase'); - - self.TestFcn = testFcn; - self.SetupFcn = setupFcn; - self.TeardownFcn = teardownFcn; - - % Determine the name and M-file location of the function handle. - functionHandleInfo = functions(testFcn); - self.Name = functionHandleInfo.function; - if strcmp(functionHandleInfo.type, 'anonymous') - % Anonymous function handles don't have an M-file location. - self.Location = ''; - else - self.Location = functionHandleInfo.file; - end - end - - function runTestCase(self) - %runTestCase Run function handle test - % test_case.run() calls the test function handle. If a nonempty - % SetupFcn was provided and it has at least one output argument, - % pass self.TestData to the test function. Otherwise, call the - % test function with no input arguments. - if ~isempty(self.SetupFcn) && nargout(self.SetupFcn) > 0 - self.TestFcn(self.TestData); - else - self.TestFcn(); - end - end - - function setUp(self) - %setUp Run test-fixture setup function - % If a nonempty SetupFcn was provided, run it. If the SetupFcn - % has at least one output argument, capture the first output - % argument in instance data (TestData). - if ~isempty(self.SetupFcn) - if nargout(self.SetupFcn) > 0 - if nargout(self.SetupFcn) > 1 - message = sprintf(['A test fixture setup function returns more than one output argument. ', ... - 'The test harness only calls the setup function with one output argument. ', ... - 'Return a struct or a cell array from your setup function if you need to bundle several parts together.', ... - '\nTest name: %s\nTest location: %s'], ... - self.Name, self.Location); - warning('xunit:FunctionHandleTestCase:TooManySetupOutputs', ... - '%s', message); - end - self.TestData = self.SetupFcn(); - else - self.SetupFcn(); - end - end - end - - function tearDown(self) - %tearDown Run test-fixture teardown function - % If a nonempty TeardownFcn was provided, run it. If there is - % TestData (the output of the SetupFcn), then pass it to - % TeardownFcn. Otherwise, call TeardownFcn with no input - % arguments. - if ~isempty(self.TeardownFcn) - if ~isempty(self.SetupFcn) && (nargout(self.SetupFcn) > 0) - self.TeardownFcn(self.TestData); - else - self.TeardownFcn(); - end - end - end - end -end \ No newline at end of file diff --git a/ext/matlab_xunit/README.txt b/ext/matlab_xunit/README.txt deleted file mode 100644 index 7e9fcfb81e..0000000000 --- a/ext/matlab_xunit/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -The full Matlab xUnit package (including documentation) is available from: - -http://www.mathworks.com/matlabcentral/fileexchange/22846-matlab-xunit-test-framework diff --git a/ext/matlab_xunit/TestCase.m b/ext/matlab_xunit/TestCase.m deleted file mode 100644 index 8b09ff8759..0000000000 --- a/ext/matlab_xunit/TestCase.m +++ /dev/null @@ -1,103 +0,0 @@ -%TestCase Class defining interface for test cases -% The TestCase class defines an individual test case. -% -% Normally a test writer will create their own test class that is a subclass -% of TestCase. Each instance of the TestCase subclass that gets created will -% be associated with a single test method. -% -% If a test fixture is needed, override the setUp() and tearDown() methods. -% -% TestSuite(subclass_name), where subclass_name is the name of a TestCase -% subclass, creates a test suite containing one TestCase instance per test -% method contained in the subclass. -% -% A simpler test-writing alternative to use subfunction-based M-file tests. -% See the MATLAB xUnit documentation. -% -% TestCase methods: -% TestCase - Constructor -% run - Execute the test case -% -% TestCase properties: -% Location - Location of M-file containing the test case -% Name - Name of test case -% -% See also TestComponent, TestSuite - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -classdef TestCase < TestComponent - - properties - MethodName - end - - methods - function self = TestCase(testMethod) - %TestCase Constructor - % TestCase(methodName) constructs a TestCase object using the - % specified testMethod (a string). - - self.MethodName = testMethod; - self.Name = testMethod; - self.Location = which(class(self)); - end - - function did_pass = run(self, monitor) - %run Execute the test case - % test_case.run(monitor) calls the TestCase object's setUp() - % method, then the test method, then the tearDown() method. - % observer is a TestRunObserver object. The testStarted(), - % testFailure(), testError(), and testFinished() methods of - % observer are called at the appropriate times. monitor is a - % TestRunMonitor object. Typically it is either a TestRunLogger - % subclass or a CommandWindowTestRunDisplay subclass. - % - % test_case.run() automatically uses a - % CommandWindowTestRunDisplay object in order to print test - % suite execution information to the Command Window. - - if nargin < 2 - monitor = CommandWindowTestRunDisplay(); - end - - did_pass = true; - monitor.testComponentStarted(self); - - try - self.setUp(); - f = str2func(self.MethodName); - - try - % Call the test method. - f(self); - catch failureException - monitor.testCaseFailure(self, failureException); - did_pass = false; - end - - self.tearDown(); - - catch errorException - monitor.testCaseError(self, errorException); - did_pass = false; - end - - monitor.testComponentFinished(self, did_pass); - end - - function num = numTestCases(self) - num = 1; - end - - function print(self, numLeadingBlanks) - if nargin < 2 - numLeadingBlanks = 0; - end - fprintf('%s%s\n', blanks(numLeadingBlanks), self.Name); - end - - end - -end diff --git a/ext/matlab_xunit/TestCaseInDir.m b/ext/matlab_xunit/TestCaseInDir.m deleted file mode 100644 index 8c80f2ae6c..0000000000 --- a/ext/matlab_xunit/TestCaseInDir.m +++ /dev/null @@ -1,30 +0,0 @@ -%TestCaseInDir Test case requiring temporary directory change -% The TestCaseInDir class defines a test case that has to be run by first -% changing to a specified directory. -% -% The setUp method adds the starting directory to the path and then uses cd to -% change into the specified directory. The tearDown method restores the -% original path and directory. -% -% TestCaseInDir is used by MATLAB xUnit's own test suite in order to test itself. -% -% TestCaseInDir methods: -% TestCaseInDir - Constructor -% -% See also TestCase, TestCaseWithAddPath, TestComponent - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -classdef TestCaseInDir < TestCase & TestComponentInDir - - methods - function self = TestCaseInDir(methodName, testDirectory) - %TestCaseInDir Constructor - % TestCaseInDir(testName, testDirectory) constructs a test case - % using the specified name and located in the specified directory. - self = self@TestCase(methodName); - self = self@TestComponentInDir(testDirectory); - end - end -end diff --git a/ext/matlab_xunit/TestCaseWithAddPath.m b/ext/matlab_xunit/TestCaseWithAddPath.m deleted file mode 100644 index 0f0e9f6610..0000000000 --- a/ext/matlab_xunit/TestCaseWithAddPath.m +++ /dev/null @@ -1,53 +0,0 @@ -%TestCaseInDir Test case requiring temporary path modification -% The TestCaseInDir class defines a test case that has to be run by first -% adding a specific directory to the path. -% -% The setUp method adds the directory to the path, and the tearDown method -% restores the original path. -% -% TestCaseWithAddPath is used by MATLAB xUnit's own test suite in order to test -% itself. -% -% TestCaseWithAddPath methods: -% TestCaseWithAddPath - Constructor -% setUp - Add test directory to MATLAB path -% tearDown - Restore original MATLAB path -% -% See also TestCase, TestCaseInDir - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -classdef TestCaseWithAddPath < TestCase - properties (SetAccess = private, GetAccess = private) - %TestDirectory - Directory to be added to the path - TestDirectory - - %OriginalPath - Path prior to adding the test directory - OriginalPath - end - - methods - function self = TestCaseWithAddPath(methodName, testDirectory) - %TestCaseInDir Constructor - % TestCaseInDir(testName, testDirectory) constructs a test case - % using the specified name and located in the specified directory. - self = self@TestCase(methodName); - self.TestDirectory = testDirectory; - end - - function setUp(self) - %setUp Add test directory to MATLAB path. - % test_case.setUp() saves the current path in the OriginalPath - % property and then adds the TestDirectory to the MATLAB path. - self.OriginalPath = path; - addpath(self.TestDirectory); - end - - function tearDown(self) - %tearDown Restore original MATLAB path - % test_case.tearDown() restores the saved MATLAB path. - path(self.OriginalPath); - end - end -end diff --git a/ext/matlab_xunit/TestComponent.m b/ext/matlab_xunit/TestComponent.m deleted file mode 100644 index e68b5b54ce..0000000000 --- a/ext/matlab_xunit/TestComponent.m +++ /dev/null @@ -1,59 +0,0 @@ -classdef TestComponent < handle -%TestComponent Abstract base class for TestCase and TestSuite -% -% TestComponent methods: -% run - Run all test cases in test component -% print - Display summary of test component to Command Window -% numTestCases - Number of test cases in test component -% setUp - Initialize test fixture -% tearDown - Clean up text fixture -% -% TestComponent properties: -% Name - Name of test component -% Location - Directory where test component is defined -% -% See TestCase, TestSuite - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - - properties - Name = ''; - Location = ''; - end - - properties (Access = 'protected') - PrintIndentationSize = 4 - end - - methods (Abstract) - print() - %print Display summary of test component to Command Window - % obj.print() displays information about the test component to the - % Command Window. - - run() - %run Execute test cases - % obj.run() executes all the test cases in the test component - - numTestCases() - %numTestCases Number of test cases in test component - end - - methods - function setUp(self) - %setUp Set up test fixture - % test_component.setUp() is called at the beginning of the run() - % method. Test writers can override setUp if necessary to - % initialize a test fixture. - end - - function tearDown(self) - %tearDown Tear down test fixture - % test_component.tearDown() is at the end of the method. Test - % writers can override tearDown if necessary to clean up a test - % fixture. - end - - end -end \ No newline at end of file diff --git a/ext/matlab_xunit/TestComponentInDir.m b/ext/matlab_xunit/TestComponentInDir.m deleted file mode 100644 index d1193c6c09..0000000000 --- a/ext/matlab_xunit/TestComponentInDir.m +++ /dev/null @@ -1,58 +0,0 @@ -%TestComponentInDir Test component requiring temporary directory change -% The TestComponentInDir class defines a test component that has to be run by -% first changing to a specified directory. -% -% The setUp method adds the starting directory to the path and then uses cd to -% change into the specified directory. The tearDown method restores the -% original path and directory. -% -% TestComponentInDir methods: -% TestComponentInDir - Constructor -% setUp - Add test directory to MATLAB path -% tearDown - Restore original MATLAB path -% -% See also TestComponent - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -classdef TestComponentInDir < TestComponent - properties (SetAccess = private, GetAccess = protected) - %TestDirectory - Directory to change to in the test fixture - TestDirectory - - %OriginalPath - Path prior to adding the starting directory - OriginalPath - - %OriginalDirectory - Starting directory - OriginalDirectory - end - - methods - function self = TestComponentInDir(testDirectory) - %TestCaseInDir Constructor - % TestCaseInDir(testName, testDirectory) constructs a test case - % using the specified name and located in the specified directory. - self.TestDirectory = testDirectory; - end - - function setUp(self) - %setUp Add test directory to MATLAB path - % test_case.setUp() saves the current directory in the - % OriginalDirectory property, saves the current path in the - % OriginalPath property, and then uses cd to change into the test - % directory. - self.OriginalDirectory = pwd; - self.OriginalPath = path; - addpath(pwd); - cd(self.TestDirectory); - end - - function tearDown(self) - %tearDown Restore original MATLAB path and directory - % test_case.tearDown() restores the original path and directory. - cd(self.OriginalDirectory); - path(self.OriginalPath); - end - end -end diff --git a/ext/matlab_xunit/TestRunDisplay.m b/ext/matlab_xunit/TestRunDisplay.m deleted file mode 100644 index 57ae200c75..0000000000 --- a/ext/matlab_xunit/TestRunDisplay.m +++ /dev/null @@ -1,258 +0,0 @@ -classdef TestRunDisplay < TestRunMonitor -%TestRunDisplay Print test suite execution results. -% TestRunDisplay is a subclass of TestRunMonitor. If a TestRunDisplay -% object is passed to the run method of a TestComponent, such as a -% TestSuite or a TestCase, it will print information to the Command -% Window (or specified file handle) as the test run proceeds. -% -% TestRunDisplay methods: -% testComponentStarted - Update Command Window display -% testComponentFinished - Update Command Window display -% testCaseFailure - Log test failure information -% testCaseError - Log test error information -% -% TestRunDisplay properties: -% TestCaseCount - Number of test cases executed -% Faults - Struct array of test fault info -% -% See also TestRunLogger, TestRunMonitor, TestSuite - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - - properties (SetAccess = private) - %TestCaseCount - Number of test cases executed - TestCaseCount - - %Faults - Struct array of test fault info - % Faults is a struct array with these fields: - % Type - either 'failure' or 'error' - % TestCase - the TestCase object that suffered the fault - % Exception - the MException thrown when the fault occurred - Faults = struct('Type', {}, 'TestCase', {}, 'Exception', {}); - - end - - properties (SetAccess = private, GetAccess = private) - %InitialTic - Out of tic at beginning of test run - InitialTic - - %InitialComponent First test component executed - % InitialComponent is set to the first test component executed in the - % test run. This component is saved so that the end of the test run - % can be identified. - InitialComponent = [] - - end - - properties (Access = protected) - %FileHandle - Handle used by fprintf for displaying results. - % Default value of 1 displays to Command Window. - FileHandle = 1 - end - - - methods - function self = TestRunDisplay(output) - if nargin > 0 - if ischar(output) - self.FileHandle = fopen(output, 'w'); - if self.FileHandle < 0 - error('xunit:TestRunDisplay:FileOpenError', ... - 'Could not open file "%s" for writing.', ... - filename); - end - else - self.FileHandle = output; - end - end - end - - function testComponentStarted(self, component) - %testComponentStarted Update Command Window display - % If the InitialComponent property is not yet set, - % obj.testComponentStarted(component) sets the property and calls - % obj.testRunStarted(component). - - if isempty(self.InitialComponent) - self.InitialComponent = component; - self.testRunStarted(component); - end - end - - function testComponentFinished(self, component, did_pass) - %testComponentFinished Update Command Window display - % If component is a TestCase object, then - % obj.testComponentFinished(component, did_pass) prints pass/fail - % information to the Command Window. - % - % If component is the InitialComponent, then - % obj.testRunFinished(did_pass) is called. - - if isa(component, 'TestCase') - self.TestCaseCount = self.TestCaseCount + 1; - if did_pass - fprintf(self.FileHandle, '.'); - else - fprintf(self.FileHandle, 'F'); - end - line_length = 20; - if mod(self.TestCaseCount, line_length) == 0 - fprintf(self.FileHandle, '\n'); - end - end - - if isequal(component, self.InitialComponent) - self.testRunFinished(did_pass); - end - end - - function testCaseFailure(self, test_case, failure_exception) - %testCaseFailure Log test failure information - % obj.testCaseFailure(test_case, failure_exception) logs the test - % case failure information. - - self.logFault('failure', test_case, ... - failure_exception); - end - - function testCaseError(self, test_case, error_exception) - %testCaseError Log test error information - % obj.testCaseError(test_case, error_exception) logs the test - % case error information. - - self.logFault('error', test_case, ... - error_exception); - end - - end - - methods (Access = protected) - function testRunStarted(self, component) - %testRunStarted Update Command Window display - % obj.testRunStarted(component) displays information about the test - % run to the Command Window. - - self.InitialTic = tic; - self.TestCaseCount = 0; - num_cases = component.numTestCases(); - if num_cases == 1 - str = 'case'; - else - str = 'cases'; - end - fprintf(self.FileHandle, 'Starting test run with %d test %s.\n', ... - num_cases, str); - end - - function testRunFinished(self, did_pass) - %testRunFinished Update Command Window display - % obj.testRunFinished(component) displays information about the test - % run results, including any test failures, to the Command Window. - - if did_pass - result = 'PASSED'; - else - result = 'FAILED'; - end - - fprintf(self.FileHandle, '\n%s in %.3f seconds.\n', result, toc(self.InitialTic)); - - self.displayFaults(); - end - - - - function logFault(self, type, test_case, exception) - %logFault Log test fault information - % obj.logFault(type, test_case, exception) logs test fault - % information. type is either 'failure' or 'error'. test_case is a - % TestCase object. exception is an MException object. - - self.Faults(end + 1).Type = type; - self.Faults(end).TestCase = test_case; - self.Faults(end).Exception = exception; - end - - function displayFaults(self) - %displayFaults Display test fault info to Command Window - % obj.displayFaults() displays a summary of each test failure and - % test error to the command window. - for k = 1:numel(self.Faults) - faultData = self.Faults(k); - if strcmp(faultData.Type, 'failure') - str = 'Failure'; - else - str = 'Error'; - end - fprintf(self.FileHandle, '\n===== Test Case %s =====\nLocation: %s\nName: %s\n\n', str, ... - faultData.TestCase.Location, faultData.TestCase.Name); - displayStack(filterStack(faultData.Exception.stack), ... - self.FileHandle); - fprintf(self.FileHandle, '\n%s\n', faultData.Exception.message); - - fprintf(self.FileHandle, '\n'); - end - end - - end - -end - -function displayStack(stack, file_handle) -%displayStack Display stack trace from MException instance -% displayStack(stack) prints information about an exception stack to the -% command window. - -for k = 1:numel(stack) - filename = stack(k).file; - linenumber = stack(k).line; - href = sprintf('matlab: opentoline(''%s'',%d)', filename, linenumber); - fprintf(file_handle, '%s at line %d\n', filename, href, linenumber); -end -end - -function new_stack = filterStack(stack) -%filterStack Remove unmeaningful stack trace calls -% new_stack = filterStack(stack) removes from the input stack trace calls -% that are framework functions and methods that are not likely to be -% meaningful to the user. - -% Testing stack traces follow this common pattern: -% -% 1. The first function call in the trace is often one of the assert functions -% in the framework directory. This is useful to see. -% -% 2. The next function calls are in the user-written test functions/methods and -% the user-written code under test. These calls are useful to see. -% -% 3. The final set of function calls are methods in the various framework -% classes. There are usually several of these calls, which clutter up the -% stack display without being that useful. -% -% The pattern above suggests the following stack filtering strategy: Once the -% stack trace has left the framework directory, do not follow the stack trace back -% into the framework directory. - -mtest_directory = fileparts(which('runtests')); -last_keeper = numel(stack); -have_left_mtest_directory = false; -for k = 1:numel(stack) - directory = fileparts(stack(k).file); - if have_left_mtest_directory - if strcmp(directory, mtest_directory) - % Stack trace has reentered mtest directory. - last_keeper = k - 1; - break; - end - else - if ~strcmp(directory, mtest_directory) - have_left_mtest_directory = true; - end - end -end - -new_stack = stack(1:last_keeper); - -end - diff --git a/ext/matlab_xunit/TestRunLogger.m b/ext/matlab_xunit/TestRunLogger.m deleted file mode 100644 index 2a82978add..0000000000 --- a/ext/matlab_xunit/TestRunLogger.m +++ /dev/null @@ -1,104 +0,0 @@ -%TestRunLogger Collect data (silently) from running test suite -% TestRunLogger is a subclass of TestRunMonitor uses to collect information -% from an executing test component (either a test case or a test suite). -% It maintains a record of event notifications received, as well as any test -% failures or test errors. -% -% TestRunLogger methods: -% testComponentStarted - Log test component started -% testComponentFinished - Log test component finished -% testCaseFailure - Log test case failure -% testCaseError - Log test case error -% -% TestRunLogger properties: -% Log - Cell array of test notification strings -% NumFailures - Number of test failures during execution -% NumErrors - Number of test errors during execution -% NumTestCases - Total number of test cases executed -% Faults - Struct array of test fault information -% -% See also CommandWindowTestRunDisplay, TestRunMonitor, TestSuite - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -classdef TestRunLogger < TestRunMonitor - - properties (SetAccess = protected) - %Log Cell array of test notification strings - % Test notification strings include 'TestRunStarted', - % 'TestRunFinished', 'TestComponentStarted', 'TestComponentFinished', - % 'TestCaseFailure', and 'TestCaseError'. - Log - - %NumFailures Number of test failures during execution - NumFailures = 0 - - %NumErrors Number of test errors during execution - NumErrors = 0 - - %NumTestCases Total number of test cases executed - NumTestCases = 0 - - %Faults Struct array of test fault information - % Faults is a struct array with the fields Type, TestCase, and - % Exception. Type is either 'failure' or 'error'. TestCase is the - % test case object that triggered the fault. Exception is the - % MException object thrown during the fault. - Faults = struct('Type', {}, 'TestCase', {}, 'Exception', {}); - end - - properties (SetAccess = private, GetAccess = private) - InitialTestComponent = [] - end - - methods - - function testComponentStarted(self, component) - if isempty(self.InitialTestComponent) - self.InitialTestComponent = component; - self.appendToLog('TestRunStarted'); - end - - self.appendToLog('TestComponentStarted'); - - if isa(component, 'TestCase') - self.NumTestCases = self.NumTestCases + 1; - end - end - - function testComponentFinished(self, component, did_pass) - self.appendToLog('TestComponentFinished'); - - if isequal(component, self.InitialTestComponent) - self.appendToLog('TestRunFinished'); - end - end - - function testCaseFailure(self, test_case, failure_exception) - self.appendToLog('TestCaseFailure'); - self.NumFailures = self.NumFailures + 1; - self.logFault('failure', test_case, ... - failure_exception); - end - - function testCaseError(self, test_case, error_exception) - self.appendToLog('TestCaseError'); - self.NumErrors = self.NumErrors + 1; - self.logFault('error', test_case, ... - error_exception); - end - end - - methods (Access = private) - function appendToLog(self, item) - self.Log{end+1} = item; - end - - function logFault(self, type, test_case, exception) - self.Faults(end + 1).Type = type; - self.Faults(end).TestCase = test_case; - self.Faults(end).Exception = exception; - end - end -end diff --git a/ext/matlab_xunit/TestRunMonitor.m b/ext/matlab_xunit/TestRunMonitor.m deleted file mode 100644 index 4af7490398..0000000000 --- a/ext/matlab_xunit/TestRunMonitor.m +++ /dev/null @@ -1,35 +0,0 @@ -%TestRunMonitor Abstract base class for monitoring a running test suite -% The abstract TestRunMonitor class defines an object that can observe and -% record the results of running a test suite. The run() method of a -% TestComponent object takes a TestRunMonitor object as an input argument. -% -% Different test suite logging or reporting functionality can be achieved by -% subclassing TestRunMonitor. For example, see the TestRunLogger and the -% CommandWindowTestRunDisplay classes. -% -% TestRunMonitor methods: -% TestRunMonitor - Constructor -% testComponentStarted - Called at beginning of test component run -% testComponentFinished - Called when test component run finished -% testCaseFailure - Called when a test case fails -% testCaseError - Called when a test case causes an error -% -% See also CommandWindowTestRunDisplay, TestRunLogger, TestCase, TestSuite - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -classdef TestRunMonitor < handle - - methods (Abstract) - - testComponentStarted(self, component) - - testComponentFinished(self, component, did_pass) - - testCaseFailure(self, test_case, failure_exception) - - testCaseError(self, test_case, error_exception) - - end -end diff --git a/ext/matlab_xunit/TestSuite.m b/ext/matlab_xunit/TestSuite.m deleted file mode 100644 index a55d91963e..0000000000 --- a/ext/matlab_xunit/TestSuite.m +++ /dev/null @@ -1,342 +0,0 @@ -%TestSuite Collection of TestComponent objects -% The TestSuite class defines a collection of TestComponent objects. -% -% TestSuite methods: -% TestSuite - Constructor -% add - Add test component to test suite -% print - Display test suite summary to Command Window -% run - Run the test suite -% keepMatchingTestCase - Keep only the named test component -% fromName - Construct test suite from directory or MATLAB function file name -% fromTestCaseClassName - Construct test suite from TestCase class name -% fromPackageName - Construct test suite from package name -% fromPwd - Construct test suite from present directory -% -% TestSuite properties: -% TestComponents - Cell array of TestComponent objects -% -% Examples -% -------- -% Run all the test cases in the SampleTests1 class. Display test suite -% progress and a summary of results in the Command Window. -% -% TestSuite('SampleTests1').run() -% -% Construct a test suite from all test components found in the current -% directory. -% -% suite = TestSuite.fromPwd(); -% -% Construct a test suite from all test components found in the package -% 'mytool.tests'. (Note that the "+" character at the beginning of the package -% folder name on disk is not part of the package name.) -% -% suite = TestSuite.fromPackageName('mytool.tests'); -% -% Run all the test cases in the SampleTests class. Display no output to the -% Command Window. Upon completion, query the number of test failures and test -% errors. -% -% logger = TestRunLogger(); -% TestSuite('SampleTests1').run(logger); -% numFailures = logger.NumFailures -% numErrors = logger.NumErrors -% -% See also CommandWindowTestRunDisplay, TestCase, TestComponent, TestRunLogger - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -classdef TestSuite < TestComponent - - properties (SetAccess = protected) - TestComponents = {}; - end - - methods - - function self = TestSuite(name) - %TestSuite Constructor - % suite = TestSuite constructs an empty test suite. suite = - % TestSuite(name) constructs a test suite by searching for test - % cases defined in an M-file with the specified name. - - if nargin >= 1 - self = TestSuite.fromName(name); - end - end - - function did_pass_out = run(self, monitor) - %run Execute test cases in test suite - % did_pass = suite.run() executes all test cases in the test - % suite, returning a logical value indicating whether or not all - % test cases passed. - - if nargin < 2 - monitor = CommandWindowTestRunDisplay(); - end - - monitor.testComponentStarted(self); - did_pass = true; - - self.setUp(); - - for k = 1:numel(self.TestComponents) - this_component_passed = self.TestComponents{k}.run(monitor); - did_pass = did_pass && this_component_passed; - end - - self.tearDown(); - - monitor.testComponentFinished(self, did_pass); - - if nargout > 0 - did_pass_out = did_pass; - end - end - - function num = numTestCases(self) - %numTestCases Number of test cases in test suite - - num = 0; - for k = 1:numel(self.TestComponents) - component_k = self.TestComponents{k}; - num = num + component_k.numTestCases(); - end - end - - function print(self, numLeadingBlanks) - %print Display test suite summary to Command Window - % test_suite.print() displays a summary of the test suite to the - % Command Window. - - if nargin < 2 - numLeadingBlanks = 0; - end - fprintf('%s%s\n', blanks(numLeadingBlanks), self.Name); - for k = 1:numel(self.TestComponents) - self.TestComponents{k}.print(numLeadingBlanks + ... - self.PrintIndentationSize); - end - end - - function add(self, component) - %add Add test component to test suite - % test_suite.add(component) adds the TestComponent object to the - % test suite. - - if iscell(component) - self.TestComponents((1:numel(component)) + end) = component; - else - self.TestComponents{end + 1} = component; - end - end - - function keepMatchingTestCase(self, name) - %keepMatchingTestCase Keep only the named test component - % test_suite.keepMatchingTestCase(name) keeps only the test - % component with a matching name and discards the rest. - - idx = []; - for k = 1:numel(self.TestComponents) - if strcmp(self.TestComponents{k}.Name, name) - idx = k; - break; - end - end - if isempty(idx) - self.TestComponents = {}; - else - self.TestComponents = self.TestComponents(idx); - end - end - - end - - methods (Static) - function suite = fromTestCaseClassName(class_name) - %fromTestCaseClassName Construct test suite from TestCase class name - % suite = TestSuite.fromTestCaseClassName(name) constructs a - % TestSuite object from the name of a TestCase subclass. - - if ~xunit.utils.isTestCaseSubclass(class_name) - error('xunit:fromTestCaseClassName', ... - 'Input string "%s" is not the name of a TestCase class.', ... - class_name); - end - - suite = TestSuite; - suite.Name = class_name; - suite.Location = which(class_name); - - methods = getClassMethods(class_name); - for k = 1:numel(methods) - if methodIsConstructor(methods{k}) - continue - end - - method_name = methods{k}.Name; - if xunit.utils.isTestString(method_name) - suite.add(feval(class_name, method_name)); - end - end - - end - - function suite = fromName(name) - %fromName Construct test suite from M-file name - % test_suite = TestSuite.fromName(name) constructs a TestSuite - % object from an M-file with the given name. The name can be of a - % directory, a TestCase subclass, or an M-file containing a simple - % test or containing subfunction-based tests. - % - % Optionally, name can contain a colon (':') followed by filter - % string. The filter string is used to select a particular named - % test case. For example, TestSuite.fromName('MyTests:testA') - % constructs a TestSuite object containing only the test case - % named 'testA' found in the TestCase subclass MyTests. - - if isdir(name) - suite = TestSuiteInDir(name); - suite.gatherTestCases(); - return; - end - - [name, filter_string] = strtok(name, ':'); - if ~isempty(filter_string) - filter_string = filter_string(2:end); - end - - if xunit.utils.isTestCaseSubclass(name) - suite = TestSuite.fromTestCaseClassName(name); - - elseif ~isempty(meta.class.fromName(name)) - % Input is the name of a class that is not a TestCase subclass. - % Return an empty test suite. - suite = TestSuite(); - suite.Name = name; - - elseif isPackage(name) - suite = TestSuite.fromPackageName(name); - - else - - try - if nargout(name) == 0 - suite = TestSuite(); - suite.Name = name; - suite.add(FunctionHandleTestCase(str2func(name), [], [])); - suite.Location = which(name); - - else - suite = feval(name); - if ~isa(suite, 'TestSuite') - error('Function did not return a TestSuite object.'); - end - end - - catch - % Ordinary function does not appear to contain tests. - % Return an empty test suite. - suite = TestSuite(); - suite.Name = name; - end - end - - if ~isempty(filter_string) - suite.keepMatchingTestCase(filter_string); - end - end - - function test_suite = fromPwd() - %fromPwd Construct test suite from present directory - % test_suite = TestSuite.fromPwd() constructs a TestSuite object - % from all the test components in the present working directory. - % all TestCase subclasses will be found, as well as simple and - % subfunction-based M-file tests beginning with the string 'test' - % or 'Test'. - - test_suite = TestSuite(); - test_suite.Name = pwd; - test_suite.Location = pwd; - - mfiles = dir(fullfile('.', '*.m')); - for k = 1:numel(mfiles) - [path, name] = fileparts(mfiles(k).name); - if xunit.utils.isTestCaseSubclass(name) - test_suite.add(TestSuite.fromTestCaseClassName(name)); - elseif xunit.utils.isTestString(name) - suite_k = TestSuite.fromName(name); - if ~isempty(suite_k.TestComponents) - test_suite.add(suite_k); - end - end - end - end - - function test_suite = fromPackageName(name) - %fromPackageName Construct test suite from package name - % test_suite = TestSuite.fromPackageName(name) constructs a - % TestSuite object from all the test components found in the - % specified package. - - package_info = meta.package.fromName(name); - if isempty(package_info) - error('xunit:fromPackageName:invalidName', ... - 'Input string "%s" is not the name of a package.', ... - name); - end - test_suite = TestSuite(); - test_suite.Name = name; - test_suite.Location = 'Package'; - - for k = 1:numel(package_info.Packages) - pkg_name = package_info.Packages{k}.Name; - pkg_suite = TestSuite.fromPackageName(pkg_name); - if ~isempty(pkg_suite.TestComponents) - test_suite.add(TestSuite.fromPackageName(pkg_name)); - end - end - - class_names = cell(1, numel(package_info.Classes)); - for k = 1:numel(package_info.Classes) - class_name = package_info.Classes{k}.Name; - class_names{k} = class_name; - if xunit.utils.isTestCaseSubclass(class_name) - test_suite.add(TestSuite.fromTestCaseClassName(class_name)); - end - end - - for k = 1:numel(package_info.Functions) - function_name = package_info.Functions{k}.Name; - if xunit.utils.isTestString(function_name) - full_function_name = [package_info.Name '.' package_info.Functions{k}.Name]; - if ~ismember(full_function_name, class_names) - suite_k = TestSuite.fromName(full_function_name); - if ~isempty(suite_k.TestComponents) - test_suite.add(suite_k); - end - end - end - end - end - end -end - -function tf = isPackage(name) -tf = ~isempty(meta.package.fromName(name)); -end - -function methods = getClassMethods(class_name) -class_meta = meta.class.fromName(class_name); -methods = class_meta.Methods; -end - -function result = methodIsConstructor(method) -method_name = method.Name; -if ~isempty(method.DefiningClass.ContainingPackage) - method_name = [method.DefiningClass.ContainingPackage.Name, '.', ... - method_name]; -end -result = strcmp(method_name, method.DefiningClass.Name); -end diff --git a/ext/matlab_xunit/TestSuiteInDir.m b/ext/matlab_xunit/TestSuiteInDir.m deleted file mode 100644 index e83ef5e89b..0000000000 --- a/ext/matlab_xunit/TestSuiteInDir.m +++ /dev/null @@ -1,50 +0,0 @@ -%TestSuiteInDir Test suite requiring temporary directory change -% The TestSuiteInDir class defines a test suite that has to be run by first -% changing to a specified directory. -% -% The setUp method adds the starting directory to the path and then uses cd to -% change into the specified directory. The tearDown method restores the -% original path and directory. -% -% TestSuiteInDir methods: -% TestSuiteInDir - Constructor -% gatherTestCases - Add test cases found in the target directory -% -% See also TestSuite - -% Steven L. Eddins -% Copyright 2009 The MathWorks, Inc. - -classdef TestSuiteInDir < TestSuite & TestComponentInDir - - methods - function self = TestSuiteInDir(testDirectory) - %TestCaseInDir Constructor - % TestCaseInDir(testName, testDirectory) constructs a test case - % using the specified name and located in the specified directory. - self = self@TestComponentInDir(testDirectory); - - if strcmp(testDirectory, '.') - self.Name = pwd; - self.Location = pwd; - else - [pathstr, name] = fileparts(testDirectory); - self.Name = name; - self.Location = testDirectory; - end - end - - function gatherTestCases(self) - %gatherTestCases Add test cases found in the target directory - % suite.gatherTestCases() automaticall finds all the test cases in - % the directory specified in the constructor call and adds them to - % the suite. - current_dir = pwd; - c = onCleanup(@() cd(current_dir)); - - cd(self.TestDirectory); - tmp = TestSuite.fromPwd(); - self.TestComponents = tmp.TestComponents; - end - end -end diff --git a/ext/matlab_xunit/VerboseTestRunDisplay.m b/ext/matlab_xunit/VerboseTestRunDisplay.m deleted file mode 100644 index 0be9d6df1a..0000000000 --- a/ext/matlab_xunit/VerboseTestRunDisplay.m +++ /dev/null @@ -1,112 +0,0 @@ -classdef VerboseTestRunDisplay < TestRunDisplay -%VerboseTestRunDisplay Print test suite execution results. -% VerboseTestRunDisplay is a subclass of -% TestRunDisplay. It supports the -verbose option of runtests. -% -% Overriddent methods: -% testComponentStarted - Update Command Window display -% testComponentFinished - Update Command Window display -% testRunFinished - Update Command Window display at end of run -% -% See also TestRunDisplay, TestRunLogger, TestRunMonitor, TestSuite - -% Steven L. Eddins -% Copyright 2010 The MathWorks, Inc. - - properties (SetAccess = private, GetAccess = private) - TicStack = uint64([]) - end - - methods - function self = VerboseTestRunDisplay(output) - if nargin < 1 - output = 1; - end - - self = self@TestRunDisplay(output); - end - - function testComponentStarted(self, component) - %testComponentStarted Update Command Window display - - self.pushTic(); - - if ~isa(component, 'TestCase') - fprintf(self.FileHandle, '\n'); - end - - fprintf(self.FileHandle, '%s%s', self.indentationSpaces(), component.Name); - - if ~isa(component, 'TestCase') - fprintf(self.FileHandle, '\n'); - else - fprintf(self.FileHandle, ' %s ', self.leaderDots(component.Name)); - end - end - - function testComponentFinished(self, component, did_pass) - %testComponentFinished Update Command Window display - - if ~isa(component, 'TestCase') - fprintf(self.FileHandle, '%s%s %s ', self.indentationSpaces(), component.Name, ... - self.leaderDots(component.Name)); - end - - component_run_time = toc(self.popTic()); - - if did_pass - fprintf(self.FileHandle, 'passed in %12.6f seconds\n', component_run_time); - else - fprintf(self.FileHandle, 'FAILED in %12.6f seconds\n', component_run_time); - end - - if ~isa(component, 'TestCase') - fprintf(self.FileHandle, '\n'); - end - - if isempty(self.TicStack) - self.testRunFinished(); - end - - end - - end - - methods (Access = protected) - function testRunFinished(self) - %testRunFinished Update Command Window display - % obj.testRunFinished(component) displays information about the test - % run results, including any test failures, to the Command - % Window. - - self.displayFaults(); - end - end - - methods (Access = private) - function pushTic(self) - self.TicStack(end+1) = tic; - end - - function t1 = popTic(self) - t1 = self.TicStack(end); - self.TicStack(end) = []; - end - - function str = indentationSpaces(self) - str = repmat(' ', 1, self.numIndentationSpaces()); - end - - function n = numIndentationSpaces(self) - indent_level = numel(self.TicStack) - 1; - n = 3 * indent_level; - end - - function str = leaderDots(self, name) - num_dots = max(0, 40 - self.numIndentationSpaces() - numel(name)); - str = repmat('.', 1, num_dots); - end - - end - -end diff --git a/ext/matlab_xunit/assertAlmostEqual.m b/ext/matlab_xunit/assertAlmostEqual.m deleted file mode 100644 index 63e195c797..0000000000 --- a/ext/matlab_xunit/assertAlmostEqual.m +++ /dev/null @@ -1,52 +0,0 @@ -function assertAlmostEqual(A, B, reltol, message) -%assertEqual Assert that inputs are equal within relative tolerance -% assertEqual(A, B, RELTOL) throws an exception of any of the values in A and -% B are not equal within the specified tolerance. NaN values are considered -% to be equal. A and B have to have the same class and sparsity to be -% considered equal. -% -% assertEqual(A, B) uses the following relative tolerance value: -% -% 100 * eps(class(A)) -% -% assertEqual(A, B, RELTOL, MESSAGE) uses the specified message string when -% throwing the exception. With this syntax, use RELTOL = [] to specify the -% default relative tolerance. -% -% Note that if either A or B are not floating-point arrays, then A and B are -% compared using ISEQUALWITHEQUALNANS and the relative tolerance value is not -% used. -% -% Examples -% -------- -% % This call returns silently. -% assertAlmostEqual(1.0, 1.0 + eps); -% -% % This call throws an error. -% assertAlmostEqual(1.0, 1.1); -% -% See also assertEqual, mtest.utils.isAlmostEqual - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -if ~(issparse(A) == issparse(B)) - throw(MException('assertAlmostEqual:sparsityNotEqual', message)); -end - -if ~strcmp(class(A), class(B)) - throw(MException('assertAlmostEqual:classNotEqual', message)); -end - -if nargin < 3 || isempty(reltol) - reltol = 100 * eps(class(A)); -end - -if nargin < 4 - message = sprintf('Inputs are not equal within relative tolerance: %g', ... - reltol); -end - -if ~xunit.utils.isAlmostEqual(A, B, reltol) - throw(MException('assertAlmostEqual:tolExceeded', message)); -end diff --git a/ext/matlab_xunit/assertElementsAlmostEqual.m b/ext/matlab_xunit/assertElementsAlmostEqual.m deleted file mode 100644 index 3ac2ba6b34..0000000000 --- a/ext/matlab_xunit/assertElementsAlmostEqual.m +++ /dev/null @@ -1,61 +0,0 @@ -function assertElementsAlmostEqual(varargin) -%assertElementsAlmostEqual Assert floating-point array elements almost equal. -% assertElementsAlmostEqual(A, B, tol_type, tol, floor_tol) asserts that all -% elements of floating-point arrays A and B are equal within some tolerance. -% tol_type can be 'relative' or 'absolute'. tol and floor_tol are scalar -% tolerance values. -% -% If the tolerance type is 'relative', then the tolerance test used is: -% -% all( abs(A(:) - B(:)) <= tol * max(abs(A(:)), abs(B(:))) + floor_tol ) -% -% If the tolerance type is 'absolute', then the tolerance test used is: -% -% all( abs(A(:) - B(:)) <= tol ) -% -% tol_type, tol, and floor_tol are all optional. The default value for -% tol_type is 'relative'. If both A and B are double, then the default value -% for tol and floor_tol is sqrt(eps). If either A or B is single, then the -% default value for tol and floor_tol is sqrt(eps('single')). -% -% If A or B is complex, then the tolerance test is applied independently to -% the real and imaginary parts. -% -% Corresponding elements in A and B that are both NaN, or are both infinite -% with the same sign, are considered to pass the tolerance test. -% -% assertElementsAlmostEqual(A, B, ..., msg) prepends the string msg to the -% output message if A and B fail the tolerance test. - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -params = xunit.utils.parseFloatAssertInputs(varargin{:}); - -if ~isequal(size(params.A), size(params.B)) - message = xunit.utils.comparisonMessage(params.Message, ... - 'Inputs are not the same size.', ... - params.A, params.B); - throwAsCaller(MException('assertElementsAlmostEqual:sizeMismatch', ... - '%s', message)); -end - -if ~(isfloat(params.A) && isfloat(params.B)) - message = xunit.utils.comparisonMessage(params.Message, ... - 'Inputs are not both floating-point.', ... - params.A, params.B); - throwAsCaller(MException('assertElementsAlmostEqual:notFloat', ... - '%s', message)); -end - -if ~xunit.utils.compareFloats(params.A, params.B, 'elementwise', ... - params.ToleranceType, params.Tolerance, params.FloorTolerance) - - tolerance_message = sprintf('Input elements are not all equal within %s tolerance: %g', ... - params.ToleranceType, params.Tolerance); - message = xunit.utils.comparisonMessage(params.Message, tolerance_message, ... - params.A, params.B); - - throwAsCaller(MException('assertElementsAlmostEqual:tolExceeded', ... - '%s', message)); -end diff --git a/ext/matlab_xunit/assertEqual.m b/ext/matlab_xunit/assertEqual.m deleted file mode 100644 index 72349cd0d9..0000000000 --- a/ext/matlab_xunit/assertEqual.m +++ /dev/null @@ -1,43 +0,0 @@ -function assertEqual(A, B, custom_message) -%assertEqual Assert that inputs are equal -% assertEqual(A, B) throws an exception if A and B are not equal. A and B -% must have the same class and sparsity to be considered equal. -% -% assertEqual(A, B, MESSAGE) prepends the string MESSAGE to the assertion -% message if A and B are not equal. -% -% Examples -% -------- -% % This call returns silently. -% assertEqual([1 NaN 2], [1 NaN 2]); -% -% % This call throws an error. -% assertEqual({'A', 'B', 'C'}, {'A', 'foo', 'C'}); -% -% See also assertElementsAlmostEqual, assertVectorsAlmostEqual - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -if nargin < 3 - custom_message = ''; -end - -if ~ (issparse(A) == issparse(B)) - message = xunit.utils.comparisonMessage(custom_message, ... - 'One input is sparse and the other is not.', A, B); - throwAsCaller(MException('assertEqual:sparsityNotEqual', '%s', message)); -end - -if ~strcmp(class(A), class(B)) - message = xunit.utils.comparisonMessage(custom_message, ... - 'The inputs differ in class.', A, B); - throwAsCaller(MException('assertEqual:classNotEqual', '%s', message)); -end - -if ~isequalwithequalnans(A, B) - message = xunit.utils.comparisonMessage(custom_message, ... - 'Inputs are not equal.', A, B); - throwAsCaller(MException('assertEqual:nonEqual', '%s', message)); -end - diff --git a/ext/matlab_xunit/assertExceptionThrown.m b/ext/matlab_xunit/assertExceptionThrown.m deleted file mode 100644 index bbe6b722e0..0000000000 --- a/ext/matlab_xunit/assertExceptionThrown.m +++ /dev/null @@ -1,53 +0,0 @@ -function assertExceptionThrown(f, expectedId, custom_message) -%assertExceptionThrown Assert that specified exception is thrown -% assertExceptionThrown(F, expectedId) calls the function handle F with no -% input arguments. If the result is a thrown exception whose identifier is -% expectedId, then assertExceptionThrown returns silently. If no exception is -% thrown, then assertExceptionThrown throws an exception with identifier equal -% to 'assertExceptionThrown:noException'. If a different exception is thrown, -% then assertExceptionThrown throws an exception identifier equal to -% 'assertExceptionThrown:wrongException'. -% -% assertExceptionThrown(F, expectedId, msg) prepends the string msg to the -% assertion message. -% -% Example -% ------- -% % This call returns silently. -% f = @() error('a:b:c', 'error message'); -% assertExceptionThrown(f, 'a:b:c'); -% -% % This call returns silently. -% assertExceptionThrown(@() sin, 'MATLAB:minrhs'); -% -% % This call throws an error because calling sin(pi) does not error. -% assertExceptionThrown(@() sin(pi), 'MATLAB:foo'); - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -noException = false; -try - f(); - noException = true; - -catch exception - if ~strcmp(exception.identifier, expectedId) - message = sprintf('Expected exception %s but got exception %s.', ... - expectedId, exception.identifier); - if nargin >= 3 - message = sprintf('%s\n%s', custom_message, message); - end - throwAsCaller(MException('assertExceptionThrown:wrongException', ... - '%s', message)); - end -end - -if noException - message = sprintf('Expected exception "%s", but none thrown.', ... - expectedId); - if nargin >= 3 - message = sprintf('%s\n%s', custom_message, message); - end - throwAsCaller(MException('assertExceptionThrown:noException', '%s', message)); -end diff --git a/ext/matlab_xunit/assertFalse.m b/ext/matlab_xunit/assertFalse.m deleted file mode 100644 index 7bc3e8420f..0000000000 --- a/ext/matlab_xunit/assertFalse.m +++ /dev/null @@ -1,31 +0,0 @@ -function assertFalse(condition, message) -%assertFalse Assert that input condition is false -% assertFalse(CONDITION, MESSAGE) throws an exception containing the string -% MESSAGE if CONDITION is not false. -% -% MESSAGE is optional. -% -% Examples -% -------- -% assertFalse(isreal(sqrt(-1))) -% -% assertFalse(isreal(sqrt(-1)), ... -% 'Expected isreal(sqrt(-1)) to be false.') -% -% See also assertTrue - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -if nargin < 2 - message = 'Asserted condition is not false.'; -end - -if ~isscalar(condition) || ~islogical(condition) - throwAsCaller(MException('assertFalse:invalidCondition', ... - 'CONDITION must be a scalar logical value.')); -end - -if condition - throwAsCaller(MException('assertFalse:trueCondition', '%s', message)); -end diff --git a/ext/matlab_xunit/assertFilesEqual.m b/ext/matlab_xunit/assertFilesEqual.m deleted file mode 100644 index d1cfc51745..0000000000 --- a/ext/matlab_xunit/assertFilesEqual.m +++ /dev/null @@ -1,68 +0,0 @@ -function assertFilesEqual(filename1, filename2, user_message) -%assertFilesEqual Assert that files contain the same contents. -% assertFilesEqual(filename1, filename2) throws an exception if the two -% specified files do not contain the same contents. -% -% assertFilesEqual(filename1, filename2, message) prepends the specified -% message string to the assertion message. - -% Steven L. Eddins -% Copyright 2009-2010 The MathWorks, Inc. - -if nargin < 3 - user_message = ''; -end - -fid1 = fopen(filename1, 'r'); -if (fid1 < 0) - message = sprintf('%s\nCould not open file for reading: %s', ... - user_message, filename1); - throwAsCaller(MException('assertFilesEqual:readFailure', ... - '%s', message)); -else - c1 = onCleanup(@() fclose(fid1)); -end - -fid2 = fopen(filename2, 'r'); -if (fid2 < 0) - message = sprintf('%s\nCould not open file for reading: %s', ... - user_message, filename2); - throwAsCaller(MException('assertFilesEqual:readFailure', '%s', message)); -else - c2 = onCleanup(@() fclose(fid2)); -end - -block_size = 100000; -num_blocks = 0; -done = false; -while ~done - block_from_file1 = fread(fid1, block_size, '*uint8'); - block_from_file2 = fread(fid2, block_size, '*uint8'); - - if numel(block_from_file1) ~= numel(block_from_file2) - fseek(fid1, 0, 'eof'); - fseek(fid2, 0, 'eof'); - message = sprintf('The two files are not the same size. File "%s" has %d bytes and file "%s" has %d bytes', ... - filename1, ftell(fid1), filename2, ftell(fid2)); - if ~isempty(user_message) - message = sprintf('%s\n%s', user_message, message); - end - throwAsCaller(MException('assertFilesEqual:sizeMismatch', '%s', message)); - end - - if ~isequal(block_from_file1, block_from_file2) - first_difference_in_block = find(block_from_file1 ~= block_from_file2); - first_difference = num_blocks * block_size + first_difference_in_block; - - message = sprintf('Files are not equal. First difference is at byte %d, where file "%s" contains 0x%X and file "%s" contains 0x%X', ... - first_difference, filename1, block_from_file1(first_difference_in_block), ... - filename2, block_from_file2(first_difference_in_block)); - if ~isempty(user_message) - message = sprintf('%s\n%s', user_message, message); - end - throwAsCaller(MException('assertFilesEqual:valuesDiffer', '%s', message)); - end - - done = numel(block_from_file1) < block_size; - num_blocks = num_blocks + 1; -end \ No newline at end of file diff --git a/ext/matlab_xunit/assertTrue.m b/ext/matlab_xunit/assertTrue.m deleted file mode 100644 index 52787a6753..0000000000 --- a/ext/matlab_xunit/assertTrue.m +++ /dev/null @@ -1,33 +0,0 @@ -function assertTrue(condition, message) -%assertTrue Assert that input condition is true -% assertTrue(CONDITION, MESSAGE) throws an exception containing the string -% MESSAGE if CONDITION is not true. -% -% MESSAGE is optional. -% -% Examples -% -------- -% % This call returns silently. -% assertTrue(rand < 1, 'Expected output of rand to be less than 1') -% -% % This call throws an error. -% assertTrue(sum(sum(magic(3))) == 0, ... -% 'Expected sum of elements of magic(3) to be 0') -% -% See also assertEqual, assertFalse - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -if nargin < 2 - message = 'Asserted condition is not true.'; -end - -if ~isscalar(condition) || ~islogical(condition) - throwAsCaller(MException('assertTrue:invalidCondition', ... - 'CONDITION must be a scalar logical value.')); -end - -if ~condition - throwAsCaller(MException('assertTrue:falseCondition', '%s', message)); -end diff --git a/ext/matlab_xunit/assertVectorsAlmostEqual.m b/ext/matlab_xunit/assertVectorsAlmostEqual.m deleted file mode 100644 index e4f10343ad..0000000000 --- a/ext/matlab_xunit/assertVectorsAlmostEqual.m +++ /dev/null @@ -1,59 +0,0 @@ -function assertVectorsAlmostEqual(varargin) -%assertVectorsAlmostEqual Assert floating-point vectors almost equal in norm sense. -% assertVectorsAlmostEqual(A, B, tol_type, tol, floor_tol) asserts that the -% vectors A and B are equal, in the L2-norm sense and within some tolerance. -% tol_type can be 'relative' or 'absolute'. tol and floor_tol are scalar -% tolerance values. -% -% If the tolerance type is 'relative', then the tolerance test used is: -% -% all( norm(A - B) <= tol * max(norm(A), norm(B)) + floor_tol ) -% -% If the tolerance type is 'absolute', then the tolerance test used is: -% -% all( norm(A - B) <= tol ) -% -% tol_type, tol, and floor_tol are all optional. The default value for -% tol_type is 'relative'. If both A and B are double, then the default value -% for tol and floor_tol is sqrt(eps). If either A or B is single, then the -% default value for tol and floor_tol is sqrt(eps('single')). -% -% If A or B is complex, then the tolerance test is applied independently to -% the real and imaginary parts. -% -% Any infinite or NaN element of A or B will cause an assertion failure. -% -% assertVectorsAlmostEqual(A, B, ..., msg) prepends the string msg to the -% assertion message if A and B fail the tolerance test. - -% Steven L. Eddins -% Copyright 2008-2010 The MathWorks, Inc. - -params = xunit.utils.parseFloatAssertInputs(varargin{:}); - -if ~isequal(size(params.A), size(params.B)) - message = xunit.utils.comparisonMessage(params.Message, ... - 'Inputs are not the same size.', ... - params.A, params.B); - throwAsCaller(MException('assertVectorsAlmostEqual:sizeMismatch', ... - '%s', message)); -end - -if ~(isfloat(params.A) && isfloat(params.B)) - message = xunit.utils.comparisonMessage(params.Message, ... - 'Inputs are not both floating-point.', ... - params.A, params.B); - throwAsCaller(MException('assertVectorsAlmostEqual:notFloat', ... - '%s', message)); -end - -if ~xunit.utils.compareFloats(params.A, params.B, 'vector', ... - params.ToleranceType, params.Tolerance, params.FloorTolerance) - - tolerance_message = sprintf('Inputs are not equal within %s vector tolerance: %g', ... - params.ToleranceType, params.Tolerance); - message = xunit.utils.comparisonMessage(params.Message, tolerance_message, ... - params.A, params.B); - throwAsCaller(MException('assertVectorsAlmostEqual:tolExceeded', ... - '%s', message)); -end diff --git a/ext/matlab_xunit/info.xml b/ext/matlab_xunit/info.xml deleted file mode 100644 index 046189b0b9..0000000000 --- a/ext/matlab_xunit/info.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - -R2009a -MATLAB xUnit Test Framework -Other -$toolbox/matlab/icons/matlabicon.gif -../doc/ - - - - - -doc xunit -$toolbox/matlab/icons/book_mat.gif - - - - -web http://www.mathworks.com/matlabcentral/fileexchange/22846 -browser; -$toolbox/matlab/icons/webicon.gif - - - - - diff --git a/ext/matlab_xunit/initTestSuite.m b/ext/matlab_xunit/initTestSuite.m deleted file mode 100644 index 9af3f7f6ed..0000000000 --- a/ext/matlab_xunit/initTestSuite.m +++ /dev/null @@ -1,58 +0,0 @@ -%findSubfunctionTests Utility script used for subfunction-based tests -% This file is a script that is called at the top of M-files containing -% subfunction-based tests. -% -% The top of a typical M-file using this script looks like this: -% -% function test_suite = testFeatureA -% -% findSubfunctionTests; -% -% IMPORTANT NOTE -% -------------- -% The output variable name for an M-file using this script must be test_suite. - -% Steven L. Eddins -% Copyright 2008-2009 The MathWorks, Inc. - -[ST,I] = dbstack('-completenames'); -caller_name = ST(I + 1).name; -caller_file = ST(I + 1).file; -subFcns = which('-subfun', caller_file); - -setup_fcn_name = subFcns(xunit.utils.isSetUpString(subFcns)); -if numel(setup_fcn_name) > 1 - error('findSubfunctionTests:tooManySetupFcns', ... - 'Found more than one setup subfunction.') -elseif isempty(setup_fcn_name) - setup_fcn = []; -else - setup_fcn = str2func(setup_fcn_name{1}); -end - -teardown_fcn_name = subFcns(xunit.utils.isTearDownString(subFcns)); -if numel(teardown_fcn_name) > 1 - error('findSubfunctionTests:tooManyTeardownFcns', ... - 'Found more than one teardown subfunction.') -elseif isempty(teardown_fcn_name) - teardown_fcn = []; -else - teardown_fcn = str2func(teardown_fcn_name{1}); -end - -test_fcns = cellfun(@str2func, subFcns(xunit.utils.isTestString(subFcns)), ... - 'UniformOutput', false); - -suite = TestSuite; -suite.Name = caller_name; -suite.Location = which(caller_file); -for k = 1:numel(test_fcns) - suite.add(FunctionHandleTestCase(test_fcns{k}, setup_fcn, teardown_fcn)); -end - -if nargout > 0 - test_suite = suite; -else - suite.run(); -end - diff --git a/ext/matlab_xunit/license.txt b/ext/matlab_xunit/license.txt deleted file mode 100644 index 2401e6db6f..0000000000 --- a/ext/matlab_xunit/license.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, The MathWorks, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution - * Neither the name of the The MathWorks, Inc. nor the names - of its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/ext/matlab_xunit/runtests.m b/ext/matlab_xunit/runtests.m deleted file mode 100644 index 74a2414a6f..0000000000 --- a/ext/matlab_xunit/runtests.m +++ /dev/null @@ -1,160 +0,0 @@ -function out = runtests(varargin) -%runtests Run unit tests -% runtests runs all the test cases that can be found in the current directory -% and summarizes the results in the Command Window. -% -% Test cases can be found in the following places in the current directory: -% -% * An M-file function whose name starts or ends with "test" or -% "Test" and that returns no output arguments. -% -% * An M-file function whose name starts or ends with "test" or -% "Test" and that contains subfunction tests and uses the -% initTestSuite script to return a TestSuite object. -% -% * An M-file defining a subclass of TestCase. -% -% runtests(dirname) runs all the test cases found in the specified directory. -% -% runtests(packagename) runs all the test cases found in the specified -% package. (This option requires R2009a or later). -% -% runtests(mfilename) runs test cases found in the specified function or class -% name. The function or class needs to be in the current directory or on the -% MATLAB path. -% -% runtests('mfilename:testname') runs the specific test case named 'testname' -% found in the function or class 'name'. -% -% Multiple directories or file names can be specified by passing multiple -% names to runtests, as in runtests(name1, name2, ...) or -% runtests({name1, name2, ...}, ...) -% -% runtests(..., '-verbose') displays the name and result, result, and time -% taken for each test case to the Command Window. -% -% runtests(..., '-logfile', filename) directs the output of runtests to -% the specified log file instead of to the Command Window. -% -% out = runtests(...) returns a logical value that is true if all the -% tests passed. -% -% Examples -% -------- -% Find and run all the test cases in the current directory. -% -% runtests -% -% Find and run all the test cases in the current directory. Display more -% detailed information to the Command Window as the test cases are run. -% -% runtests -verbose -% -% Save verbose runtests output to a log file. -% -% runtests -verbose -logfile my_test_log.txt -% -% Find and run all the test cases contained in the M-file myfunc. -% -% runtests myfunc -% -% Find and run all the test cases contained in the TestCase subclass -% MyTestCase. -% -% runtests MyTestCase -% -% Run the test case named 'testFeature' contained in the M-file myfunc. -% -% runtests myfunc:testFeature -% -% Run all the tests in a specific directory. -% -% runtests c:\Work\MyProject\tests -% -% Run all the tests in two directories. -% -% runtests c:\Work\MyProject\tests c:\Work\Book\tests - -% Steven L. Eddins -% Copyright 2009-2010 The MathWorks, Inc. - -verbose = false; -logfile = ''; -if nargin < 1 - suite = TestSuite.fromPwd(); -else - [name_list, verbose, logfile] = getInputNames(varargin{:}); - if numel(name_list) == 0 - suite = TestSuite.fromPwd(); - elseif numel(name_list) == 1 - suite = TestSuite.fromName(name_list{1}); - else - suite = TestSuite(); - for k = 1:numel(name_list) - suite.add(TestSuite.fromName(name_list{k})); - end - end -end - -if isempty(suite.TestComponents) - error('xunit:runtests:noTestCasesFound', 'No test cases found.'); -end - -if isempty(logfile) - logfile_handle = 1; % File handle corresponding to Command Window -else - logfile_handle = fopen(logfile, 'w'); - if logfile_handle < 0 - error('xunit:runtests:FileOpenFailed', ... - 'Could not open "%s" for writing.', logfile); - else - cleanup = onCleanup(@() fclose(logfile_handle)); - end -end - -fprintf(logfile_handle, 'Test suite: %s\n', suite.Name); -if ~strcmp(suite.Name, suite.Location) - fprintf(logfile_handle, 'Test suite location: %s\n', suite.Location); -end -fprintf(logfile_handle, '%s\n\n', datestr(now)); - -if verbose - monitor = VerboseTestRunDisplay(logfile_handle); -else - monitor = TestRunDisplay(logfile_handle); -end -did_pass = suite.run(monitor); - -if nargout > 0 - out = did_pass; -end - -function [name_list, verbose, logfile] = getInputNames(varargin) -name_list = {}; -verbose = false; -logfile = ''; -k = 1; -while k <= numel(varargin) - arg = varargin{k}; - if iscell(arg) - name_list = [name_list; arg]; - elseif ~isempty(arg) && (arg(1) == '-') - if strcmp(arg, '-verbose') - verbose = true; - elseif strcmp(arg, '-logfile') - if k == numel(varargin) - error('xunit:runtests:MissingLogfile', ... - 'The option -logfile must be followed by a filename.'); - else - logfile = varargin{k+1}; - k = k + 1; - end - else - warning('runtests:unrecognizedOption', 'Unrecognized option: %s', arg); - end - else - name_list{end+1} = arg; - end - k = k + 1; -end - From ee25a7821ec6b2e9031676a61b021194907f4906 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 18:35:26 -0600 Subject: [PATCH 3/9] [MATLAB-legacy] Remove MATLAB from doc build --- doc/SConscript | 174 ----------------------- doc/sphinx/conf.py | 8 +- doc/sphinx/matlab/index.rst | 16 --- doc/sphinx/matlab/matlab-template.rst.in | 4 - 4 files changed, 1 insertion(+), 201 deletions(-) delete mode 100644 doc/sphinx/matlab/index.rst delete mode 100644 doc/sphinx/matlab/matlab-template.rst.in diff --git a/doc/SConscript b/doc/SConscript index 28efacb4ac..28c3154e77 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -14,89 +14,6 @@ localenv = env.Clone() Page = namedtuple('Page', ['name', 'title', 'objects']) -# Set up functions to pseudo-autodoc the MATLAB toolbox -def extract_matlab_docstring(mfile, level): - """ - Return the docstring from mfile, assuming that it consists of the - first uninterrupted comment block. - - :param mfile: - File name of the matlab file from which the documentation will be - read - :param level: - Level of documentation. Class = 0, Function = 1 - """ - # Set the start of the docstring based on the level passed in. This is only - # necessary for the old-style MATLAB classes, where each method is its own - # file. - if level == 0: - docstring = ".. mat:class:: " - elif level == 1: - docstring = " .. mat:function:: " - else: - logger.error("Unknown level for MATLAB documentation.") - sys.exit(1) - - # The leader is the number of spaces at the beginning of a regular line - # of documentation. - leader = ' '*4*(level + 1) - - with open(mfile, 'r') as in_file: - # The function name is read from the first line - docstring += get_function_name(in_file.readline()) + '\n' - - # By convention, the second line (called H1 in the MATLAB documentation) - # is read by various MATLAB functions, so it should be in the format - # MATLAB expects - FUNCTIONNAME Summary. We read in this line and - # add the Summary to the docstring. If the line doesn't match the - # format, just write it to the docstring as is. - line = in_file.readline() - try: - docstring += leader + line.split(' ')[1] + '\n' - except IndexError: - docstring += line + '\n' - - # Skip the next line, which is a duplicate of the first. It is here - # because MATLAB doesn't show the function definition in its help. - in_file.readline() - - # For the rest of the lines in the file, get the line if it is - # in the first unbroken comment section and add it to the docstring. - for line in in_file.readlines(): - try: - if line.lstrip().startswith('%'): - docstring += leader + line.lstrip()[2:-1] + '\n' - else: - break - except IndexError: - docstring += '\n' - - return docstring + '\n' - - -def get_function_name(function_string): - """ - Return the Matlab function or classdef signature, assuming that - the string starts with either 'function ' or 'classdef '. - """ - if function_string.startswith('function '): - sig = function_string[len('function '):] - elif function_string.startswith('classdef '): - sig = function_string[len('classdef '):] - else: - logger.error(f"Unknown function declaration in MATLAB document: {function_string}") - sys.exit(1) - - # Split the function signature on the equals sign, if it exists. - # We don't care about what comes before the equals sign, since - # if a function returns, the docs will tell us. If there is no - # =, return the whole signature. - if '=' in sig: - idx = sig.index('=') - return sig[idx+2:] - else: - return sig - if localenv['doxygen_docs'] or localenv['sphinx_docs']: docs = build(localenv.Command( '#build/doc/html/cxx/index.html', 'doxygen/Doxyfile', @@ -173,97 +90,6 @@ if localenv['sphinx_docs']: "#SConstruct", save_config) env.Depends(sphinxdocs, scons_opts) - # Create a list of MATLAB classes to document. This uses the NamedTuple - # structure defined at the top of the file. The @Data and @Utilities - # classes are fake classes for the purposes of documentation only. Each - # Page represents one html page of the documentation. - pages = [ - Page('importing', 'Objects Representing Phases', - ['@Solution', '@Mixture', '@Interface', '@Pure Fluid Phases']), - Page('thermodynamics', 'Thermodynamic Properties', - ['@ThermoPhase']), - Page('kinetics', 'Chemical Kinetics', ['@Kinetics']), - Page('transport', 'Transport Properties', ['@Transport']), - Page('zero-dim', 'Zero-Dimensional Reactor Networks', - ['@Func', '@Reactor', '@ReactorNet', '@FlowDevice', '@Wall']), - Page('one-dim', 'One-Dimensional Reacting Flows', ['1D/@Domain1D', '1D/@Stack']), - Page('data', 'Physical Constants', ['@Data']), - Page('utilities', 'Utility Functions', ['@Utilities']), - ] - - # Create a dictionary of extra files associated with each class. These - # files are listed relative to the top directory interfaces/matlab/cantera - extra = { - '@Solution': ['GRI30.m', 'Air.m'], - '@Pure Fluid Phases': ['CarbonDioxide.m', 'HFC134a.m', 'Hydrogen.m', - 'Methane.m', 'Nitrogen.m', 'Oxygen.m', 'Water.m'], - '@Func': ['gaussian.m', 'polynom.m'], - '@Reactor': ['ConstPressureReactor.m', - 'FlowReactor.m', 'IdealGasConstPressureReactor.m', - 'IdealGasReactor.m', 'Reservoir.m'], - '@FlowDevice': ['MassFlowController.m', 'Valve.m'], - '1D/@Domain1D': ['1D/AxiStagnFlow.m', '1D/AxisymmetricFlow.m', - '1D/Inlet.m', '1D/Outlet.m', '1D/OutletRes.m', - '1D/Surface.m', '1D/SymmPlane.m'], - '1D/@Stack': ['1D/FreeFlame.m', '1D/CounterFlowDiffusionFlame.m'], - '@Interface': ['importEdge.m', 'importInterface.m'], - '@Data': ['gasconstant.m', 'oneatm.m'], - '@Utilities': ['adddir.m', 'cleanup.m', 'geterr.m', 'getDataDirectories.m', - 'canteraVersion.m', 'canteraGitCommit.m'] - } - - # These files do not need to be documented in the MATLAB classes because they - # are generics that are overloaded per-class. Since the loop checks for these - # strings in each file name, hndl.m is the same as *hndl.m* (to use globbing - # notation). - nodoc_matlab_files = ['clear.m', 'display.m', 'hndl.m', 'private', 'subsref.m'] - - # Loop through the pages list to document each class - for page in pages: - tempenv = env.Clone() - - # Set the title header - title = page.title - tempenv['title'] = '='*len(title) + '\n' + title + '\n' + '='*len(title) - doc = '' - - # The base directory of the MATLAB toolbox relative to the sphinx build directory - base = '../interfaces/matlab/toolbox' - for obj in page.objects: - all_files = [] - # Set the subheader based on the class name - doc += obj.split('@')[1] + '\n' + '-'*len(obj.split('@')[1]) + '\n\n' - if os.path.isdir(pjoin(base,obj)): - # Get a list of the functions in this class as long as its a file we care about - functions = [name for name in os.listdir(pjoin(base,obj)) if not any(x in name for x in nodoc_matlab_files)] - - # Add the docstring for the class name at level 0 - class_file = functions.pop(functions.index(obj.split('@')[1]+'.m')) - doc += extract_matlab_docstring(os.path.relpath(pjoin(base,obj,class_file)), 0) - - # Get the extra files from the extra dictionary and sort them with - # the regular functions. - extra_files = extra.get(obj,[]) - all_files += sorted(functions + extra_files) - else: - all_files = extra.get(obj,[]) - - for file in all_files: - if file in functions: - doc += extract_matlab_docstring(os.path.relpath(pjoin(base,obj,file)), 1) - else: - doc += extract_matlab_docstring(os.path.relpath(pjoin(base,file)), 1) - - tempenv['matlab_docstrings'] = doc - # Substitute the docstrings into the proper file. Since the docs change - # every time the source is changed, we don't want to have to commit the - # change in the rst file as well as the source - too much code churn. So - # we use a template and a SubstFile directive. - c = tempenv.SubstFile('#build/doc/sphinx/matlab/%s.rst' % page.name, - '#doc/sphinx/matlab/matlab-template.rst.in') - build(c) - localenv.Depends(sphinxdocs, c) - localenv.AlwaysBuild(sphinxdocs) if localenv['doxygen_docs']: localenv.Depends(sphinxdocs, docs) diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index ab603b2fe0..79f196c6ba 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -31,12 +31,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -# sphinxcontrib.matlab has been added to add the MATLAB domain for the -# documentation of the MATLAB functions. It is a new requirement to build the -# documentation in 2.2. It should be loaded before sphinx.ext.autodoc because -# loading it after gives errors when autodocumenting the Python interface. extensions = [ - 'sphinxcontrib.matlab', 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.autosummary', @@ -240,8 +235,7 @@ def escape_splats(app, what, name, obj, options, lines): } } -# Ensure that the primary domain is the Python domain, since we've added the -# MATLAB domain with sphinxcontrib.matlab +# Ensure that the primary domain is the Python domain primary_domain = 'py' # Add any paths that contain templates here, relative to this directory. diff --git a/doc/sphinx/matlab/index.rst b/doc/sphinx/matlab/index.rst deleted file mode 100644 index 585e47ef0d..0000000000 --- a/doc/sphinx/matlab/index.rst +++ /dev/null @@ -1,16 +0,0 @@ - -***************************** -Matlab Interface User's Guide -***************************** - -.. toctree:: - :maxdepth: 2 - - importing - thermodynamics - kinetics - transport - zero-dim - one-dim - data - utilities diff --git a/doc/sphinx/matlab/matlab-template.rst.in b/doc/sphinx/matlab/matlab-template.rst.in deleted file mode 100644 index 0c837a7382..0000000000 --- a/doc/sphinx/matlab/matlab-template.rst.in +++ /dev/null @@ -1,4 +0,0 @@ - -@title@ - -@matlab_docstrings@ From a7c0650655105f54fadfa6e2c0a133d33919f84d Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 18:48:09 -0600 Subject: [PATCH 4/9] [MATLAB-legacy] Remove references to MATLAB --- .gitignore | 2 -- data/lithium_ion_battery.yaml | 4 ++-- include/cantera/base/logger.h | 7 +++---- test/data/lithium_ion_battery.cti | 10 +++------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index c7921345c3..0793755a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,6 @@ include/cantera/base/config.h include/cantera/base/config.h.build include/cantera/base/system.h.gch include/cantera/ext/ -interfaces/matlab/ctpath.m -interfaces/matlab/Contents.m interfaces/matlab_experimental/Utility/ctRoot.m src/extensions/delegator.h stage/ diff --git a/data/lithium_ion_battery.yaml b/data/lithium_ion_battery.yaml index 7574d9dfe4..a8cab8f4da 100644 --- a/data/lithium_ion_battery.yaml +++ b/data/lithium_ion_battery.yaml @@ -12,8 +12,8 @@ description: |- to `true`. The preexponential factors and activation energies are converted from Guo et al., J. Electrochem. Soc. 158, A122 (2011) - A MATLAB example using this file for simulating a discharge curve is - samples/matlab/lithium_ion_battery.m + A Python example using this file for simulating a discharge curve is + samples/python/surface_chemistry/lithium_ion_battery.py Reference: M. Mayur, S. C. DeCaluwe, B. L. Kee, W. G. Bessler, “Modeling and simulation diff --git a/include/cantera/base/logger.h b/include/cantera/base/logger.h index 852e993cb9..89f93790a0 100644 --- a/include/cantera/base/logger.h +++ b/include/cantera/base/logger.h @@ -24,16 +24,15 @@ namespace Cantera //! output stream or standard error stream, but classes may be derived from //! Logger that implement other output options. This is important when Cantera //! is used in applications that do not display the standard output, such as -//! MATLAB. The %Cantera MATLAB interface derives a class from Logger that -//! implements these methods with MATLAB-specific procedures, insuring that the +//! Python. The %Cantera Python interface derives a class from Logger that +//! implements these methods with Python-specific procedures, insuring that the //! messages will be passed through to the user. It would also be possible to //! derive a class that displayed the messages in a pop-up window, or redirected //! them to a file, etc. //! //! To install a logger, call function setLogger (global.h / misc.cpp). //! -//! See the files Cantera/python/src/pylogger.h and -//! Cantera/matlab/cantera/private/mllogger.h for examples of +//! See the file Cantera/python/src/pylogger.h for examples of //! deriving logger classes. //! @ingroup logGroup //! diff --git a/test/data/lithium_ion_battery.cti b/test/data/lithium_ion_battery.cti index 89fd087f91..0a0dec1b65 100644 --- a/test/data/lithium_ion_battery.cti +++ b/test/data/lithium_ion_battery.cti @@ -8,13 +8,10 @@ # - Interfaces: LCO/electrolyte and LiC6/electrolyte # - Charge-transfer reactions at the two interfaces # -# A MATLAB example using this file for simulating a discharge curve is -# samples/matlab/lithium_ion_battery.m -# # Reference: -# M. Mayur, S. C. DeCaluwe, B. L. Kee, W. G. Bessler, “Modeling and simulation -# of the thermodynamics of lithium-ion battery intercalation materials in the -# open-source software Cantera,” Electrochim. Acta 323, 134797 (2019), +# M. Mayur, S. C. DeCaluwe, B. L. Kee, W. G. Bessler, “Modeling and simulation +# of the thermodynamics of lithium-ion battery intercalation materials in the +# open-source software Cantera,” Electrochim. Acta 323, 134797 (2019), # https://doi.org/10.1016/j.electacta.2019.134797 #============================================================================== @@ -292,4 +289,3 @@ edge_reaction("Li+[elyt] + V[anode] + electron <=> Li[anode]", [2.028e4, 0.0, (2 # LCO/electrolyte interface edge_reaction("Li+[elyt] + V[cathode] + electron <=> Li[cathode]", [5.629e11, 0.0, (58, 'kJ/mol')], rate_coeff_type = "exchangecurrentdensity", beta = 0.5,id="cathode_reaction") - From 84156a10e7d31a9862478bd93180809b5a4b2d7f Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 18:48:47 -0600 Subject: [PATCH 5/9] [MATLAB-legacy] Remove MATLAB from build system --- SConstruct | 111 +----------------- .../develop/compiling/configure-build.md | 9 -- interfaces/python_sdist/SConscript | 2 +- site_scons/wxsgen.py | 10 -- test/SConscript | 85 -------------- 5 files changed, 7 insertions(+), 210 deletions(-) diff --git a/SConstruct b/SConstruct index bb631c790f..3da2e7a2f7 100644 --- a/SConstruct +++ b/SConstruct @@ -127,22 +127,12 @@ if "clean" in COMMAND_LINE_TARGETS: remove_file("src/pch/system.h.gch") remove_directory("include/cantera/ext") remove_file("config.log") - remove_directory("doc/sphinx/matlab/examples") - remove_file("doc/sphinx/matlab/examples.rst") - for name in Path("doc/sphinx/matlab/").glob("**/*.rst"): - if name.name != "index.rst": - remove_file(name) remove_directory("doc/sphinx/cython/examples") remove_file("doc/sphinx/cython/examples.rst") for name in Path(".").glob("*.msi"): remove_file(name) for name in Path("site_scons").glob("**/*.pyc"): remove_file(name) - remove_file("interfaces/matlab/toolbox/cantera_shared.dll") - remove_file("interfaces/matlab/Contents.m") - remove_file("interfaces/matlab/ctpath.m") - for name in Path("interfaces/matlab/toolbox").glob("ctmethods.*"): - remove_file(name) logger.status("Done removing output files.", print_level=False) @@ -257,7 +247,7 @@ config_options = [ "python_package", """If you plan to work in Python, then you need the 'full' Cantera Python package. If, on the other hand, you will only use Cantera from some - other language (for example, MATLAB or Fortran 90/95) and only need Python + other language (for example, C or Fortran 90/95) and only need Python to process YAML files, then you only need a 'minimal' subset of the package and Cython and NumPy are not necessary. The 'none' option doesn't install any components of the Python interface. The default @@ -288,21 +278,6 @@ config_options = [ 'python_prefix=USER'.""", {"default": ""}, PathVariable.PathAccept), - EnumOption( - "matlab_toolbox", - """This variable controls whether the MATLAB toolbox will be built. If - set to 'y', you will also need to set the value of the 'matlab_path' - variable. If set to 'default', the MATLAB toolbox will be built if - 'matlab_path' is set.""", - "default", ("y", "n", "default")), - PathOption( - "matlab_path", - """Path to the MATLAB install directory. This should be the directory - containing the 'extern', 'bin', etc. subdirectories. Typical values - are: "C:\\Program Files\\MATLAB\\R2021a" on Windows, - "/Applications/MATLAB_R2021a.app" on macOS, or - "/opt/MATLAB/R2021a" on Linux.""", - "", PathVariable.PathAccept), EnumOption( "f90_interface", """This variable controls whether the Fortran 90/95 interface will be @@ -423,9 +398,8 @@ config_options = [ """Select whether to use BLAS/LAPACK from a system installation ('y'), use Eigen linear algebra support ('n'), or to decide automatically based on libraries detected on the system ('default'). Specifying 'blas_lapack_libs' - or 'blas_lapack_dir' changes the default to 'y', whereas installing the - Matlab toolbox changes the default to 'n'. On macOS, the 'default' option - uses the Accelerate framework, whereas on other operating systems the + or 'blas_lapack_dir' changes the default to 'y'. On macOS, the 'default' + option uses the Accelerate framework, whereas on other operating systems the preferred option depends on the CPU manufacturer. In general, OpenBLAS ('openblas') is prioritized over standard libraries ('lapack,blas'), with Eigen being used if no suitable BLAS/LAPACK libraries are detected. On Intel @@ -816,10 +790,6 @@ if "cygwin" in env["OS"].lower(): if "FRAMEWORKS" not in env: env["FRAMEWORKS"] = [] -# Needed for Matlab to source ~/.matlab7rc.sh -if "HOME" in os.environ: - env["ENV"]["HOME"] = os.environ["HOME"] - if os.name == "nt": env["INSTALL_MANPAGES"] = False @@ -1379,11 +1349,6 @@ elif env["blas_lapack_libs"] or env["blas_lapack_dir"]: if not conf.CheckLib(lib, autoadd=False): config_error(f"Library {lib!r} could not be found.") -elif env["matlab_path"] != "" and env["matlab_toolbox"] in {"default", "y"}: - # MATLAB provides the mwlapack and mwblas libraries in matlabroot/extern/lib. - if env["system_blas_lapack"] == "default": - env["system_blas_lapack"] = "n" - elif env["system_blas_lapack"] == "default": # auto-detect versions if env["OS"] == "Darwin": @@ -1960,43 +1925,6 @@ if env["python_package"] == "full" and env["OS"] == "Darwin": env["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = mac_target logger.info(f"MACOSX_DEPLOYMENT_TARGET = {mac_target}") -# Matlab Toolbox settings -if env["matlab_path"] != "" and env["matlab_toolbox"] == "default": - env["matlab_toolbox"] = "y" - -if env["matlab_toolbox"] == "y": - matlab_path = env["matlab_path"] - if matlab_path == "": - logger.error( - "Unable to build the Matlab toolbox because 'matlab_path' " - "has not been set.") - sys.exit(1) - - if env["blas_lapack_libs"] or env["system_blas_lapack"] == "y": - logger.error( - "The Matlab toolbox is incompatible with external BLAS and LAPACK " - "libraries. Unset 'blas_lapack_libs' (for example, 'scons build " - "blas_lapack_libs=') and/or 'system_blas_lapack' in order to build the " - "Matlab toolbox, or set 'matlab_toolbox=n' to use the specified BLAS/" - "LAPACK libraries and skip building the Matlab toolbox.") - sys.exit(1) - - if env["system_sundials"] == "y": - logger.error( - "The Matlab toolbox is incompatible with external SUNDIALS " - "libraries. Set system_sundials to no (for example, 'scons build " - "system_sundials=n') in order to build the Matlab " - "toolbox, or set 'matlab_toolbox=n' to use the specified " - "SUNDIALS libraries and skip building the Matlab toolbox.") - sys.exit(1) - - matlab_path = Path(matlab_path) - env["matlab_path"] = matlab_path.as_posix() - if not matlab_path.is_dir() and (matlab_path / "extern").is_dir(): - logger.error( - f"Path set for 'matlab_path' is not correct. Path was {matlab_path!r}") - sys.exit(1) - # ********************************************** # *** Set additional configuration variables *** @@ -2076,18 +2004,11 @@ if env["layout"] == "compact": env["ct_sampledir"] = (prefix / "samples").as_posix() env["ct_docdir"] = (prefix / "doc").as_posix() env["ct_mandir"] = (prefix / "man1").as_posix() - env["ct_matlab_dir"] = (prefix / "matlab" / "toolbox").as_posix() else: env["ct_datadir"] = (prefix / "share" / "cantera" / "data").as_posix() env["ct_sampledir"] = (prefix / "share" / "cantera" / "samples").as_posix() env["ct_docdir"] = (prefix / "share" / "cantera" / "doc").as_posix() env["ct_mandir"] = (prefix / "share" / "man" / "man1").as_posix() - if env["layout"] == "conda": - env["ct_matlab_dir"] = ( - prefix / "share" / "cantera" / "matlab" / "toolbox").as_posix() - else: - env["ct_matlab_dir"] = ( - prefix / env["libdirname"] / "cantera" / "matlab" / "toolbox").as_posix() addInstallActions = ('install' in COMMAND_LINE_TARGETS or @@ -2112,7 +2033,7 @@ if os.path.abspath(instRoot) == Dir('.').abspath: env["inst_root"] = instRoot locations = ["libdir", "shlibdir", "bindir", "python_bindir", "incdir", "incroot", - "matlab_dir", "datadir", "sampledir", "docdir", "mandir"] + "datadir", "sampledir", "docdir", "mandir"] for loc in locations: if env["prefix"] == ".": env[f"inst_{loc}"] = (Path(instRoot) / env[f"ct_{loc}"]).as_posix() @@ -2309,9 +2230,6 @@ if env['CC'] != 'cl': VariantDir('build/platform', 'platform/posix', duplicate=0) SConscript('build/platform/SConscript') -if env['matlab_toolbox'] == 'y': - SConscript('build/src/matlab/SConscript') - if env['doxygen_docs'] or env['sphinx_docs']: SConscript('doc/SConscript') @@ -2397,21 +2315,6 @@ def postInstallMessage(target, source, env): name="Python examples", location=env_dict["python_example_loc"] )) - if env["matlab_toolbox"] == "y": - env["matlab_sample_loc"] = (Path(env["ct_sampledir"]) / "matlab").as_posix() - env["matlab_ctpath_loc"] = (Path(env["ct_matlab_dir"]) / "ctpath.m").as_posix() - install_message.append(locations_message.format( - name="Matlab toolbox", location=env_dict["ct_matlab_dir"] - )) - install_message.append(locations_message.format( - name="Matlab samples", location=env_dict["matlab_sample_loc"] - )) - install_message.append(textwrap.dedent(""" - An m-file to set the correct matlab path for Cantera is at: - - {matlab_ctpath_loc!s} - """.format(**env_dict))) - status = f" Cantera {env['cantera_version']} has been successfully installed " install_message = [ f"\n{status:*^80}\n", @@ -2479,8 +2382,7 @@ if 'msi' in COMMAND_LINE_TARGETS: wxs = wxsgen.WxsGenerator(env['stage_dir'], short_version=env['cantera_short_version'], full_version=env['cantera_pure_version'], - x64=env['TARGET_ARCH']=='amd64', - includeMatlab=env['matlab_toolbox']=='y') + x64=env['TARGET_ARCH']=='amd64') wxs.make_wxs(str(target[0])) wxs_target = env.Command('build/wix/cantera.wxs', [], build_wxs) @@ -2518,8 +2420,7 @@ if any(target.startswith('test') for target in COMMAND_LINE_TARGETS): env['ENV']['PYTHON_CMD'] = env.subst('$python_cmd') - # Tests written using the gtest framework, the Python unittest module, - # or the Matlab xunit package. + # Tests written using the gtest framework or the Python unittest module VariantDir('build/test', 'test', duplicate=0) SConscript('build/test/SConscript') diff --git a/doc/sphinx/develop/compiling/configure-build.md b/doc/sphinx/develop/compiling/configure-build.md index 21c77c5e94..b71d0bfefd 100644 --- a/doc/sphinx/develop/compiling/configure-build.md +++ b/doc/sphinx/develop/compiling/configure-build.md @@ -123,15 +123,6 @@ you can use forward slashes (`/`) in paths. - [`toolchain`](sconsopt-toolchain) -### MATLAB Toolbox Options - -Building the MATLAB toolbox requires an installed copy of MATLAB, and the path -to the directory where MATLAB is installed must be specified using the following -option: - -- [`matlab_toolbox`](sconsopt-matlab-toolbox) -- [`matlab_path`](sconsopt-matlab-path) - ### Fortran Module Options Building the Fortran module requires a compatible Fortran compiler. SCons will diff --git a/interfaces/python_sdist/SConscript b/interfaces/python_sdist/SConscript index 7c3e6b652d..6c9d599e74 100644 --- a/interfaces/python_sdist/SConscript +++ b/interfaces/python_sdist/SConscript @@ -83,7 +83,7 @@ def replace_git_hash(target, source, env): sdist(localenv.RecursiveInstall( "src", "#src", - exclude=["fortran", "matlab", "clib", r"global\.cpp", "SCons.*", r"canteraStatic\.cpp"], + exclude=["fortran", "clib", r"global\.cpp", "SCons.*", r"canteraStatic\.cpp"], )) sdist(localenv.Command("src/base/global.cpp", "#src/base/global.cpp", diff --git a/site_scons/wxsgen.py b/site_scons/wxsgen.py index e71571922f..da106cb7f9 100644 --- a/site_scons/wxsgen.py +++ b/site_scons/wxsgen.py @@ -130,22 +130,12 @@ def make_wxs(self, outFile): Display='expand', AllowAdvertise='no')) - if self.includeMatlab: - matlab = et.SubElement(product, 'Feature', - dict(Id='Matlab', Level='1', - Title='Matlab Toolbox', - Description='Cantera Matlab toolbox', - Display='expand', - AllowAdvertise='no')) - # Files includes = self.addDirectoryContents('include', instdir, devel) binaries = self.addDirectoryContents('bin', instdir, core) lib_dir = self.addDirectoryContents('lib', instdir, devel) data_dir = self.addDirectoryContents('data', instdir, core) sample_dir = self.addDirectoryContents('samples', instdir, samples) - if self.includeMatlab: - matlab_dir = self.addDirectoryContents('matlab', instdir, matlab) # Registry entries reg_options = dict(ForceCreateOnInstall="yes", ForceDeleteOnUninstall="yes", diff --git a/test/SConscript b/test/SConscript index e80e650597..8868c06d5a 100644 --- a/test/SConscript +++ b/test/SConscript @@ -204,85 +204,6 @@ def addPythonTest(testname, subset): return run_program -def addMatlabTest(script, testName, dependencies=None, env_vars=()): - def matlabRunner(target, source, env): - passedFile = target[0] - del test_results.tests[passedFile.name] - workDir = Dir('#test/work').abspath - if not os.path.isdir(workDir): - os.mkdir(workDir) - outfile = pjoin(workDir, 'matlab-results.txt') - runCommand = "%s('%s'); exit" % (source[0].name[:-2], outfile) - if os.name == 'nt': - matlabOptions = ['-nojvm','-nosplash','-wait'] - else: - matlabOptions = ['-nojvm','-nodisplay'] - if os.path.exists(outfile): - os.remove(outfile) - - environ = dict(os.environ) - environ.update(env['ENV']) - environ.update(env_vars) - code = subprocess.call([pjoin(env['matlab_path'], 'bin', 'matlab')] + - matlabOptions + ['-r', runCommand], - env=environ, cwd=Dir('#test/matlab').abspath) - if code and env["fast_fail_tests"]: - sys.exit(1) - try: - with open(outfile, "r") as output_file: - results = output_file.read() - except EnvironmentError: # TODO: replace with 'FileNotFoundError' after end of Python 2.7 support - test_results.failed['Matlab' + - ' ***no results for entire test suite***'] = 100 - return - - matlab_test_message = [ - f"{' Matlab test results ':-^88}", - results, - f"{' end Matlab test results ':-^88}", - ] - logger.info("\n".join(matlab_test_message)) - - passed = True - for line in results.split('\n'): - line = line.strip() - if not line: - continue - label = line.split()[0] - if 'seconds' not in line: # Headers for test suite sections - section = line - elif 'test' in line and 'matlab' in line: # skip overall summary line - continue - elif label == section: # skip summary line for each section - continue - elif 'FAILED' in line: - test_results.failed['.'.join(['Matlab', section, label])] = 1 - passed = False - elif 'passed' in line: - test_results.passed['.'.join(['Matlab', section, label])] = 1 - - if passed: - open(target[0].path, 'w').write(time.asctime()+'\n') - - testenv = localenv.Clone() - passedFile = File('matlab/%s.passed' % (script)) - PASSED_FILES[testName] = str(passedFile) - test_results.tests[passedFile.name] = True - run_program = testenv.Command(passedFile, pjoin('matlab', script), matlabRunner) - - dependencies = (dependencies or []) + localenv['matlab_extension'] - for dep in dependencies: - if isinstance(dep, str): - dep = File(pjoin('matlab', dep)) - testenv.Depends(run_program, dep) - - testenv.Depends(testenv['test_results'], run_program) - if os.path.exists(passedFile.abspath): - Alias('test-reset', testenv.Command('reset-%s%s' % ('matlab', script), - [], [Delete(passedFile.abspath)])) - - return run_program - # Instantiate tests addTestProgram('clib', 'clib') addTestProgram('equil', 'equil') @@ -310,12 +231,6 @@ if localenv['python_package'] == 'full': localenv.Alias('test-' + name, pyTest) env['testNames'].append(name) -if localenv['matlab_toolbox'] == 'y': - matlabTest = addMatlabTest('runCanteraTests.m', 'matlab', - dependencies=multi_glob(localenv, 'matlab', 'm')) - localenv.Alias('test-matlab', matlabTest) - env['testNames'].append('matlab') - # Force explicitly-named tests to run even if SCons thinks they're up to date for command in COMMAND_LINE_TARGETS: if command.startswith('test-'): From b0697ba5c5dfe12d1e6e5f07d3dcd5cbdecb729e Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 19:30:02 -0600 Subject: [PATCH 6/9] [MATLAB-legacy] Remove samples --- samples/matlab/PFR_solver.m | 53 ----- samples/matlab/Plug_Flow_Reactor.m | 165 ---------------- samples/matlab/catcomb.m | 219 --------------------- samples/matlab/conhp.m | 28 --- samples/matlab/conuv.m | 28 --- samples/matlab/diffflame.m | 129 ------------ samples/matlab/equil.m | 62 ------ samples/matlab/flame.m | 86 -------- samples/matlab/flame1.m | 113 ----------- samples/matlab/flame2.m | 112 ----------- samples/matlab/ignite.m | 102 ---------- samples/matlab/ignite_hp.m | 38 ---- samples/matlab/ignite_uv.m | 38 ---- samples/matlab/isentropic.m | 59 ------ samples/matlab/lithium_ion_battery.m | 136 ------------- samples/matlab/periodic_cstr.m | 106 ---------- samples/matlab/prandtl1.m | 76 ------- samples/matlab/prandtl2.m | 74 ------- samples/matlab/rankine.m | 61 ------ samples/matlab/reactor1.m | 83 -------- samples/matlab/reactor2.m | 61 ------ samples/matlab/reactor_ode.m | 50 ----- samples/matlab/surfreactor.m | 99 ---------- samples/matlab/test_examples.m | 29 --- samples/matlab/tut1.m | 174 ---------------- samples/matlab/tut2.m | 105 ---------- samples/matlab/tut3.m | 55 ------ samples/matlab/tut4.m | 87 -------- samples/matlab/tut5.m | 109 ---------- samples/matlab/tut6.m | 73 ------- samples/matlab/tut7.m | 35 ---- samples/matlab_experimental/plotSolution.m | 4 +- 32 files changed, 2 insertions(+), 2647 deletions(-) delete mode 100644 samples/matlab/PFR_solver.m delete mode 100644 samples/matlab/Plug_Flow_Reactor.m delete mode 100644 samples/matlab/catcomb.m delete mode 100644 samples/matlab/conhp.m delete mode 100644 samples/matlab/conuv.m delete mode 100644 samples/matlab/diffflame.m delete mode 100644 samples/matlab/equil.m delete mode 100644 samples/matlab/flame.m delete mode 100644 samples/matlab/flame1.m delete mode 100644 samples/matlab/flame2.m delete mode 100644 samples/matlab/ignite.m delete mode 100644 samples/matlab/ignite_hp.m delete mode 100644 samples/matlab/ignite_uv.m delete mode 100644 samples/matlab/isentropic.m delete mode 100644 samples/matlab/lithium_ion_battery.m delete mode 100644 samples/matlab/periodic_cstr.m delete mode 100644 samples/matlab/prandtl1.m delete mode 100644 samples/matlab/prandtl2.m delete mode 100644 samples/matlab/rankine.m delete mode 100644 samples/matlab/reactor1.m delete mode 100644 samples/matlab/reactor2.m delete mode 100644 samples/matlab/reactor_ode.m delete mode 100644 samples/matlab/surfreactor.m delete mode 100644 samples/matlab/test_examples.m delete mode 100644 samples/matlab/tut1.m delete mode 100644 samples/matlab/tut2.m delete mode 100644 samples/matlab/tut3.m delete mode 100644 samples/matlab/tut4.m delete mode 100644 samples/matlab/tut5.m delete mode 100644 samples/matlab/tut6.m delete mode 100644 samples/matlab/tut7.m diff --git a/samples/matlab/PFR_solver.m b/samples/matlab/PFR_solver.m deleted file mode 100644 index 672986b01a..0000000000 --- a/samples/matlab/PFR_solver.m +++ /dev/null @@ -1,53 +0,0 @@ -function [F] = PFR_solver(x,soln_vector,gas,mdot,A_in,dAdx,k) - -% This function defines the spatial derivatives for an ideal gas plug-flow -% reactor, where the cross-sectional area and pressure are allowed to vary, -% axially. The model is set up by the example file 'Plug_Flow_Reactor.m', -% which points the integrator to this function. The integrator integrates the -% derivatives spatially, to solve the density, temperature, and species mass -% fraction profiles as a function of distance x. - -rho = soln_vector(1); -T = soln_vector(2); -Y = soln_vector(3:end); - -if k==1 - A = A_in+k*dAdx*x; -elseif k==-1 - A = A_in+k*dAdx*x; - dAdx = -dAdx; -else - A = A_in+k*dAdx*x; -end - -% the gas is set to the corresponding properties during each iteration of the ode loop -set(gas,'Temperature',T,'Density',rho,'MassFractions',Y); - -MW_mix = meanMolecularWeight(gas); -Ru = gasconstant(); -R = Ru/MW_mix; -nsp = nSpecies(gas); -vx = mdot/(rho*A); -P = rho*R*T; - -MW = molecularWeights(gas); -h = enthalpies_RT(gas).*R.*T; -w = netProdRates(gas); -Cp = cp_mass(gas); -%-------------------------------------------------------------------------- -%---F(1), F(2) and F(3:end) are the differential equations modelling the--- -%---density, temperature and mass fractions variations along a plug flow--- -%-------------------------reactor------------------------------------------ -%-------------------------------------------------------------------------- -F(1) = ((1-R/Cp)*((rho*vx)^2)*(1/A)*(dAdx)... - + rho*R*sum(MW.*w.*(h-MW_mix*Cp*T./MW))/(vx*Cp) )... - / (P*(1+vx^2/(Cp*T)) - rho*vx^2); - -F(2) = (vx*vx/(rho*Cp))*F(1) + vx*vx*(1/A)*(dAdx)/Cp... - - (1/(vx*rho*Cp))*sum(h.*w.*MW); - -F(3:nsp+2) = w(1:nsp).*MW(1:nsp)./(rho*vx); - -F = F'; - -end diff --git a/samples/matlab/Plug_Flow_Reactor.m b/samples/matlab/Plug_Flow_Reactor.m deleted file mode 100644 index abad7cb7d9..0000000000 --- a/samples/matlab/Plug_Flow_Reactor.m +++ /dev/null @@ -1,165 +0,0 @@ -% General_Plug_Flow_Reactor (PFR) - to solve PFR equations for reactors -% -% This code snippet is to model a constant area and varying area -% (converging and diverging) nozzle as Plug Flow Reactor with given -% dimensions and an incoming gas. The pressure is not assumed to be -% constant here, as opposed to the Python Version of the -% Plug Flow Reactor model. -% -% The reactor assumes that the flow follows the Ideal Gas Law. -% -% The governing equations used in this code can be referenced at: -% *S.R Turns, An Introduction to Combustion - Concepts and Applications, -% McGraw Hill Education, India, 2012, 206-210.* -% -% The current example is written for methane combustion, but can be readily -% adapted for other chemistries. -% -% Developed by Ashwin Kumar/Dr.Joseph Meadows (mgak@vt.edu/jwm84@vt.edu) on 3-June-2020 -% Research Assistant/Assistant Professor -% Advanced Propulsion and Power Laboratory -% Virginia Tech -% -% Keywords: combustion, user-defined model, compressible flow, plotting - -%% Clear all variables, close all figures, clear the command line: -clear all -close all -clc - -% Temperature of gas, in K -T0 = 1473; -% Pressure of gas, in Pa -P0 = 4.47*101325; - -% Equivalence Ratio -Phi = 0.2899; - -% Import the gas phase, read out key species indices: -gas_calc = Solution('gri30.yaml'); -ich4 = speciesIndex(gas_calc,'CH4'); -io2 = speciesIndex(gas_calc,'O2'); -in2 = speciesIndex(gas_calc,'N2'); -nsp = nSpecies(gas_calc); -x = zeros(nsp,1); - -% Change the below values for different Phi values of methane Combustion -x(ich4,1) = Phi; -x(io2,1) = 2.0; -x(in2,1) = 7.52; - -% Set the initial state and then equilibrate for a given enthalpy and pressure: -set(gas_calc,'T',T0,'P',P0,'MoleFractions',x); -gas_calc = equilibrate(gas_calc,'HP'); - -%% Calculation of properties along the reactor length -% The Dimensions and conditions of the reactor are given below - -% Inlet Area, in m^2 -A_in = 0.018; -% Exit Area, in m^2 -A_out = 0.003; -% Length of the reactor, in m -L = 1.284*0.0254; -% The whole reactor is divided into n small reactors -n = 100; -% Mass flow rate into the reactor, in kg/s -mdot_calc = 1.125; - -% Flag to indicate whether the area is converging, diverging, or constant: -% k = -1 makes the solver solve for converging area. -% k = +1 makes the solver solve for diverging area. -% k = 0 makes the solver solve for constant cross sectional area -if A_in>A_out - k = -1; -elseif A_out>A_in - k = 1; -else - k = 0; -end - -dAdx = abs(A_in-A_out)/L; -% The whole length of the reactor is divided into n small lengths -dx = L/n; - -x_calc = 0:dx:L; -nsp = nSpecies(gas_calc); - -% Initialize arrays for T, Y, and rho at each location: -T_calc = zeros(length(x_calc),1); -Y_calc = zeros(length(x_calc),nsp); -rho_calc = zeros(length(x_calc),1); - -T_calc(1) = temperature(gas_calc); -Y_calc(1,:) = massFractions(gas_calc); -rho_calc(1) = density(gas_calc); - -for i = 2:length(x_calc) - - %Solver location indicator - fprintf('Solving reactor %d of %d\n', i, length(x_calc)) - -%-------------------------------------------------------------------------- -%------The values of variables at previous location are given as initial--- -%------values to the current iteration and the limits of the current------- -%--------------reactor and the gas entering it are being set--------------- -%-------------------------------------------------------------------------- - inlet_soln(1) = rho_calc(i-1); - inlet_soln(2) = T_calc(i-1); - inlet_soln(3:nsp+2) = Y_calc(i-1,:); - limits = [x_calc(i-1),x_calc(i)]; - set(gas_calc,'T',T_calc(i-1),'Density',rho_calc(i-1),'MoleFractions',Y_calc(i-1,:)); - options = odeset('RelTol',1.e-10,'AbsTol',1e-10,'InitialStep',1e-8,'NonNegative',1); -%-------------------------------------------------------------------------- -%-------------------------------------------------------------------------- - % These values are passed onto the ode15s solver - [~,y] = ode15s(@PFR_solver,limits,inlet_soln,options,gas_calc,mdot_calc,A_in,dAdx,k); - - T_calc(i) = y(end,2); - rho_calc(i) = y(end,1); - Y_calc(i,:) = y(end,3:nsp+2); -end - -A_calc = A_in+k.*x_calc*dAdx; -vx_calc = zeros(length(x_calc),1); -R_calc = zeros(length(x_calc),1); -M_calc = zeros(length(x_calc),1); -P_calc = zeros(length(x_calc),1); -for i=1:length(x_calc) - % The gas is set to the solved property values at each location - set(gas_calc,'Temperature',T_calc(i),'Density',rho_calc(i),'MassFractions',Y_calc(i,:)); - % Velocity is calculated from Mass flow rate, Area and Density - vx_calc(i) = mdot_calc./(A_calc(i)*rho_calc(i)); - % Specific Gas Constant - R_calc(i) = gasconstant()/meanMolecularWeight(gas_calc); - % Mach No. is calculated from local velocity and local speed of sound - M_calc(i) = vx_calc(i)/soundspeed(gas_calc); - % Pressure is calculated from density, temeprature and gas constant - P_calc(i) = rho_calc(i)*R_calc(i)*T_calc(i); -end - -%% Plotting -plot(x_calc,M_calc) -xlabel('X-Position (m)') -ylabel('Mach No') -title('Mach No. Variation') -figure(2) -plot(x_calc,A_calc) -xlabel('X-Position (m)') -ylabel('Area (m^2)') -title('Reactor Profile') -figure(3) -plot(x_calc,T_calc) -xlabel('X-Position (m)') -ylabel('Temperature') -title('Temperature Variation') -figure(4) -plot(x_calc,rho_calc) -xlabel('X-Position (m)') -ylabel('Density (kg/m^3)') -title('Density Variation') -figure(5) -plot(x_calc,P_calc) -xlabel('X-Position (m)') -ylabel('Pressure (Pa)') -title('Pressure Variation') diff --git a/samples/matlab/catcomb.m b/samples/matlab/catcomb.m deleted file mode 100644 index a7147cd25b..0000000000 --- a/samples/matlab/catcomb.m +++ /dev/null @@ -1,219 +0,0 @@ -% Catalytic combustion of a stagnation flow on a platinum surface -% -% This script solves a catalytic combustion problem. A stagnation flow -% is set up, with a gas inlet 10 cm from a platinum surface at 900 -% K. The lean, premixed methane/air mixture enters at ~ 6 cm/s (0.06 -% kg/m2/s), and burns catalytically on the platinum surface. Gas-phase -% chemistry is included too, and has some effect very near the -% surface. -% -% The catalytic combustion mechanism is from Deutschmann et al., 26th -% Symp. (Intl.) on Combustion,1996 pp. 1747-1754 -% -% Keywords: combustion, catalysis, 1D flow, surface chemistry - -help catcomb; - -clear all; -cleanup; - -t0 = cputime; % record the starting time - -% Parameter values are collected here to make it easier to modify -% them - -p = oneatm; % pressure -tinlet = 300.0; % inlet temperature -tsurf = 900.0; % surface temperature -mdot = 0.06; % kg/m^2/s -transport = 'mixture-averaged'; % transport model - -% We will solve first for a hydrogen/air case to -% use as the initial estimate for the methane/air case - -% composition of the inlet premixed gas for the hydrogen/air case -comp1 = 'H2:0.05, O2:0.21, N2:0.78, AR:0.01'; - -% composition of the inlet premixed gas for the methane/air case -comp2 = 'CH4:0.095, O2:0.21, N2:0.78, AR:0.01'; - -% the initial grid, in meters. The inlet/surface separation is 10 cm. -initial_grid = [0.0 0.02 0.04 0.06 0.08 0.1]; % m - -% numerical parameters -tol_ss = [1.0e-8 1.0e-14]; % [rtol atol] for steady-state problem -tol_ts = [1.0e-4 1.0e-9]; % [rtol atol] for time stepping - -loglevel = 1; % amount of diagnostic output - % (0 to 5) - -refine_grid = 1; % 1 to enable refinement, 0 to - % disable - -%%%%%%%%%%%%%%% end of parameter list %%%%%%%%%%%%%%%%%%%%%% - -%%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% -% -% This object will be used to evaluate all thermodynamic, kinetic, -% and transport properties -% -% The gas phase will be taken from the definition of phase 'gas' in -% input file 'ptcombust.yaml,' which is a stripped-down version of -% GRI-Mech 3.0. -gas = Solution('ptcombust.yaml','gas',transport); -set(gas,'T',tinlet,'P',p,'X',comp1); - -%%%%%%%%%%%%%%%% create the interface object %%%%%%%%%%%%%%%%%% -% -% This object will be used to evaluate all surface chemical production -% rates. It will be created from the interface definition 'Pt_surf' -% in input file 'ptcombust.yaml,' which implements the reaction -% mechanism of Deutschmann et al., 1995 for catalytic combustion on -% platinum. -% -surf_phase = importInterface('ptcombust.yaml','Pt_surf',gas); -setTemperature(surf_phase, tsurf); - -% integrate the coverage equations in time for 1 s, holding the gas -% composition fixed to generate a good starting estimate for the -% coverages. -advanceCoverages(surf_phase, 1.0); - -% The two objects we just created are independent of the problem -% type -- they are useful in zero-D simulations, 1-D simulations, -% etc. Now we turn to creating the objects that are specifically -% for 1-D simulations. These will be 'stacked' together to create -% the complete simulation. - -%%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% -% -% The flow object is responsible for evaluating the 1D governing -% equations for the flow. We will initialize it with the gas -% object, and assign it the name 'flow'. -% -flow = AxisymmetricFlow(gas, 'flow'); - -% set some parameters for the flow -set(flow, 'P', p, 'grid', initial_grid, 'tol', tol_ss, 'tol-time', tol_ts); - -%%%%%%%%%%%%%%% create the inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% The temperature, mass flux, and composition (relative molar) may be -% specified. This object provides the inlet boundary conditions for -% the flow equations. -% -inlt = Inlet('inlet'); - -% set the inlet parameters. Start with comp1 (hydrogen/air) -set(inlt, 'T', tinlet, 'MassFlux', mdot, 'X', comp1); - -%%%%%%%%%%%%%% create the surface %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% This object provides the surface boundary conditions for the flow -% equations. By supplying object surface_phase as an argument, the -% coverage equations for its surface species will be added to the -% equation set, and used to compute the surface production rates of -% the gas-phase species. -% -surf = Surface('surface', surf_phase); -setTemperature(surf,tsurf); - -%%%%%%%%%%%%% create the stack %%%%%%%%%%%% -% -% Once the component parts have been created, they can be assembled -% to create the 1D simulation. -% -sim1D = Stack([inlt, flow, surf]); - -% set the initial profiles. -setProfile(sim1D, 2, {'velocity', 'spread_rate', 'T'}, ... - [0.0 1.0 % z/zmax - 0.06 0.0 % velocity (u) - 0.0 0.0 % spread rate (V) - tinlet tsurf]); % T -names = speciesNames(gas); -for k = 1:nSpecies(gas) - y = massFraction(inlt, k); - setProfile(sim1D, 2, names{k}, [0 1; y y]); -end -sim1D - -%setTimeStep(fl, 1.0e-5, [1, 3, 6, 12]); -%setMaxJacAge(fl, 4, 5); - -%%%%%%%%%%%%% solution %%%%%%%%%%%%%%%%%%%% - -% start with the energy equation on -enableEnergy(flow); - -% disable the surface coverage equations, and turn off all gas and -% surface chemistry -setCoverageEqs(surf, 'off'); -setMultiplier(surf_phase, 0.0); -setMultiplier(gas, 0.0); - -% solve the problem, refining the grid if needed -solve(sim1D, 1, refine_grid); - -% now turn on the surface coverage equations, and turn the -% chemistry on slowly -setCoverageEqs(surf, 'on'); -for iter=1:6 - mult = 10.0^(iter - 6); - setMultiplier(surf_phase, mult); - setMultiplier(gas, mult); - solve(sim1D, 1, refine_grid); -end - -% At this point, we should have the solution for the hydrogen/air -% problem. Now switch the inlet to the methane/air composition. -set(inlt,'X',comp2); - -% set more stringent grid refinement criteria -setRefineCriteria(sim1D, 2, 100.0, 0.15, 0.2); - -% solve the problem for the final time -solve(sim1D, loglevel, refine_grid); - -% show the solution -sim1D - -% save the solution -saveSoln(sim1D,'catcomb.yaml','energy',['solution with energy equation']); - -%%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -writeStats(sim1D); -elapsed = cputime - t0; -e = sprintf('Elapsed CPU time: %10.4g',elapsed); -disp(e); - -%%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -clf; -subplot(3,3,1); -plotSolution(sim1D, 'flow', 'T'); -title('Temperature [K]'); -subplot(3,3,2); -plotSolution(sim1D, 'flow', 'u'); -title('Axial Velocity [m/s]'); -subplot(3,3,3); -plotSolution(sim1D, 'flow', 'V'); -title('Radial Velocity / Radius [1/s]'); -subplot(3,3,4); -plotSolution(sim1D, 'flow', 'CH4'); -title('CH4 Mass Fraction'); -subplot(3,3,5); -plotSolution(sim1D, 'flow', 'O2'); -title('O2 Mass Fraction'); -subplot(3,3,6); -plotSolution(sim1D, 'flow', 'CO'); -title('CO Mass Fraction'); -subplot(3,3,7); -plotSolution(sim1D, 'flow', 'CO2'); -title('CO2 Mass Fraction'); -subplot(3,3,8); -plotSolution(sim1D, 'flow', 'H2O'); -title('H2O Mass Fraction'); -subplot(3,3,9); -plotSolution(sim1D, 'flow', 'H2'); -title('H2 Mass Fraction'); diff --git a/samples/matlab/conhp.m b/samples/matlab/conhp.m deleted file mode 100644 index 8c5504e319..0000000000 --- a/samples/matlab/conhp.m +++ /dev/null @@ -1,28 +0,0 @@ -function dydt = conhp(t, y, gas, mw) %#ok -% CONHP ODE system for a constant-pressure, adiabatic reactor. -% -% Function CONHP evaluates the system of ordinary differential -% equations for an adiabatic, constant-pressure, -% zero-dimensional reactor. It assumes that the 'gas' object -% represents a reacting ideal gas mixture. - - -% Set the state of the gas, based on the current solution vector. -setMassFractions(gas, y(2:end), 'nonorm'); -set(gas, 'T', y(1), 'P', pressure(gas)); -nsp = nSpecies(gas); - -% energy equation -wdot = netProdRates(gas); -tdot = - temperature(gas) * gasconstant * enthalpies_RT(gas)' ... - * wdot / (density(gas)*cp_mass(gas)); - -% set up column vector for dydt -dydt = [ tdot - zeros(nsp, 1) ]; - -% species equations -rrho = 1.0/density(gas); -for i = 1:nsp - dydt(i+1) = rrho*mw(i)*wdot(i); -end diff --git a/samples/matlab/conuv.m b/samples/matlab/conuv.m deleted file mode 100644 index 6ff1695cdb..0000000000 --- a/samples/matlab/conuv.m +++ /dev/null @@ -1,28 +0,0 @@ -function dydt = conuv(t, y, gas, mw) %#ok -% CONUV ODE system for a constant-volume, adiabatic reactor. -% -% Function CONUV evaluates the system of ordinary differential -% equations for an adiabatic, constant-volume, -% zero-dimensional reactor. It assumes that the 'gas' object -% represents a reacting ideal gas mixture. - - -% Set the state of the gas, based on the current solution vector. -setMassFractions(gas, y(2:end), 'nonorm'); -set(gas, 'T', y(1), 'Rho', density(gas)); -nsp = nSpecies(gas); - -% energy equation -wdot = netProdRates(gas); -tdot = - temperature(gas) * gasconstant * (enthalpies_RT(gas) - ones(nsp,1))' ... - * wdot / (density(gas)*cv_mass(gas)); - -% set up column vector for dydt -dydt = [ tdot - zeros(nsp, 1) ]; - -% species equations -rrho = 1.0/density(gas); -for i = 1:nsp - dydt(i+1) = rrho*mw(i)*wdot(i); -end diff --git a/samples/matlab/diffflame.m b/samples/matlab/diffflame.m deleted file mode 100644 index 5fb861749e..0000000000 --- a/samples/matlab/diffflame.m +++ /dev/null @@ -1,129 +0,0 @@ -% DIFFFLAME - An opposed-flow diffusion flame. -% This example uses the CounterFlowDiffusionFlame function to solve an -% opposed-flow diffusion flame for Ethane in Air. This example is the same -% as the diffusion_flame.py example without radiation. -% -% Keywords: combustion, 1D flow, diffusion flame, plotting - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% - -runtime = cputime; % Record the starting time -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Parameter values of inlet streams -% - -p = oneatm; % Pressure -tin = 300.0; % Inlet temperature -mdot_o = 0.72; % Air mass flux, kg/m^2/s -mdot_f = 0.24; % Fuel mass flux, kg/m^2/s -transport = 'mixture-averaged'; % Transport model -% NOTE: Transport model needed if mechanism file does not have transport -% properties. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Set-up initial grid, loglevel, tolerances. Enable/Disable grid -% refinement. -% - -initial_grid = 0.02*[0.0 0.2 0.4 0.6 0.8 1.0]; % Units: m -tol_ss = [1.0e-5 1.0e-9]; % [rtol atol] for steady-state problem -tol_ts = [1.0e-3 1.0e-9]; % [rtol atol] for time stepping -loglevel = 1; % Amount of diagnostic output (0 to 5) -refine_grid = 1; % 1 to enable refinement, 0 to disable -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Create the gas objects for the fuel and oxidizer streams. These objects -% will be used to evaluate all thermodynamic, kinetic, and transport -% properties. -% - -fuel = GRI30(transport); -ox = GRI30(transport); -oxcomp = 'O2:0.21, N2:0.78'; % Air composition -fuelcomp = 'C2H6:1'; % Fuel composition -% Set each gas mixture state with the corresponding composition. -set(fuel,'T', tin, 'P', p, 'X', fuelcomp); -set(ox,'T',tin,'P',p,'X', oxcomp); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Set-up the flow object. For this problem, the AxisymmetricFlow model is -% needed. Set the state of the flow as the fuel gas object. This is -% arbitrary and is only used to initialize the flow object. Set the grid to -% the initial grid defined prior, same for the tolerances. -% - -f = AxisymmetricFlow(fuel,'flow'); -set(f, 'P', p, 'grid', initial_grid); -set(f, 'tol', tol_ss, 'tol-time', tol_ts); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Create the fuel and oxidizer inlet steams. Specify the temperature, mass -% flux, and composition correspondingly. -% - -% Set the oxidizer inlet. -inlet_o = Inlet('air_inlet'); -set(inlet_o, 'T', tin, 'MassFlux', mdot_o, 'X', oxcomp); -% -% Set the fuel inlet. -inlet_f = Inlet('fuel_inlet'); -set(inlet_f, 'T', tin, 'MassFlux', mdot_f, 'X', fuelcomp); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Once the inlets have been created, they can be assembled -% to create the flame object. Function CounterFlorDiffusionFlame -% (in Cantera/1D) sets up the initial guess for the solution using a -% Burke-Schumann flame. The input parameters are: fuel inlet object, flow -% object, oxidizer inlet object, fuel gas object, oxidizer gas object, and -% the name of the oxidizer species as in character format. -% - -fl = CounterFlowDiffusionFlame(inlet_f, f, inlet_o, fuel, ox, 'O2'); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Solve with fixed temperature profile first. Grid refinement is turned off -% for this process in this example. To turn grid refinement on, change 0 to -% 1 for last input is solve function. -% - -solve(fl, loglevel, 0); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Enable the energy equation. The energy equation will now be solved to -% compute the temperature profile. We also tighten the grid refinement -% criteria to get an accurate final solution. The explanation of the -% setRefineCriteria function is located on cantera.org in the Matlab User's -% Guide and can be accessed by help setRefineCriteria -% - -enableEnergy(f); -setRefineCriteria(fl, 2, 200.0, 0.1, 0.2); -solve(fl, loglevel, refine_grid); -saveSoln(fl,'c2h6.yaml','energy',['solution with energy equation']); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Show statistics of solution and elapsed time. -% - -writeStats(fl); -elapsed = cputime - runtime; -e = sprintf('Elapsed CPU time: %10.4g',elapsed); -disp(e); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Make a single plot showing temperature and mass fraction of select -% species along axial distance from fuel inlet to air inlet. -% - -z = grid(fl, 'flow'); % Get grid points of flow -spec = speciesNames(fuel); % Get species names in gas -T = solution(fl, 'flow', 'T'); % Get temperature solution -for i = 1:length(spec) - % Get mass fraction of all species from solution - y(i,:) = solution(fl, 'flow', spec{i}); -end -j = speciesIndex(fuel, 'O2'); % Get index of O2 in gas object -k = speciesIndex(fuel, 'H2O'); % Get index of H2O in gas object -l = speciesIndex(fuel, 'C2H6'); % Get index of C2H6 in gas object -m = speciesIndex(fuel, 'CO2'); % Get index of CO2 in gas object -clf; -yyaxis left -plot(z,T) -xlabel('z (m)'); -ylabel('Temperature (K)'); -yyaxis right -plot(z,y(j,:),'r',z,y(k,:),'g',z,y(l,:),'m',z,y(m,:),'b'); -ylabel('Mass Fraction'); -legend('T','O2','H2O','C2H6','CO2'); diff --git a/samples/matlab/equil.m b/samples/matlab/equil.m deleted file mode 100644 index 1b85467cf7..0000000000 --- a/samples/matlab/equil.m +++ /dev/null @@ -1,62 +0,0 @@ -function equil(g) -% EQUIL a chemical equilibrium example. -% -% This example computes the adiabatic flame temperature and -% equilibrium composition for a methane/air mixture as a function of -% equivalence ratio. -% -% Keywords: combustion, equilibrium, plotting -help equil - -if nargin == 1 - gas = g; -else - gas = Solution('gri30.yaml'); -end - -nsp = nSpecies(gas); - -% find methane, nitrogen, and oxygen indices -ich4 = speciesIndex(gas,'CH4'); -io2 = speciesIndex(gas,'O2'); -in2 = speciesIndex(gas,'N2'); - -nPhis = 50; -phi = linspace(0.2, 2.70, nPhis); -tad(nPhis) = 0; -xeq(nsp,nPhis) = 0; - -for i = 1:nPhis - x = zeros(nsp,1); - x(ich4,1) = phi(i); - x(io2,1) = 2.0; - x(in2,1) = 7.52; - set(gas,'Temperature',300.0,'Pressure',101325.0,'MoleFractions',x); - equilibrate(gas,'HP'); - tad(i) = temperature(gas); - xeq(:,i) = moleFractions(gas); -end - -% make plots -clf; -subplot(1,2,1); -plot(phi,tad); -xlabel('Equivalence Ratio'); -ylabel('Temperature (K)'); -title('Adiabatic Flame Temperature'); - -subplot(1,2,2); -semilogy(phi,xeq); -axis([phi(1) phi(50) 1.0e-14 1]); -%legend(speciesName(gas,1:nsp),1); -j = 10; -for k = 1:nsp - text(phi(j),1.5*xeq(k,j),speciesName(gas,k)) - j = j + 2; - if j > 46 - j = 10; - end -end -xlabel('Equivalence Ratio'); -ylabel('Mole Fraction'); -title('Equilibrium Composition'); diff --git a/samples/matlab/flame.m b/samples/matlab/flame.m deleted file mode 100644 index c9f4aca91d..0000000000 --- a/samples/matlab/flame.m +++ /dev/null @@ -1,86 +0,0 @@ -function f = flame(gas, left, flow, right) -% FLAME - create a flame object. -% -% gas -- object representing the gas. This object will be used to -% compute all required thermodynamic, kinetic, and transport -% properties. The state of this object should be set -% to an estimate of the gas state emerging from the -% burner before calling StagnationFlame. -% -% left -- object representing the burner, which must be -% created using function Inlet. -% -% flow -- object representing the flow, created with -% function AxisymmetricFlow. -% -% right -- object representing the surface. -% - -% Check input parameters -if nargin ~= 4 - error('wrong number of input arguments.'); -end - -if ~isIdealGas(gas) - error('gas object must represent an ideal gas mixture.'); -end -if ~isInlet(left) - error('burner object of wrong type.'); -end -if ~isFlow(flow) - error('flow object of wrong type.'); -end - -flametype = 0; -if isSurface(right) - flametype = 1; -elseif isInlet(right) - flametype = 3; -end - -% create the container object -f = Stack([left flow right]); - -% set default initial profiles. -rho0 = density(gas); - -% find the adiabatic flame temperature and corresponding -% equilibrium composition -equilibrate(gas, 'HP'); -teq = temperature(gas); -yeq = massFractions(gas); - -z1 = 0.2; -mdot0 = massFlux(left); -mdot1 = massFlux(right); -t0 = temperature(left); -if flametype == 0 - t1 = teq; - mdot1 = -mdot0; -else - t1 = temperature(right); -end -setProfile(f, 2, {'velocity', 'spread_rate'}, ... - [0.0 1.0 - mdot0/rho0 -mdot1/rho0 - 0.0 0.0]); -setProfile(f, 2, 'T', [0.0 z1 1.0; t0 2000.0 t1]); - -for n = 1:nSpecies(gas) - nm = speciesName(gas,n); - if strcmp(nm,'H') | strcmp(nm,'OH') | strcmp(nm,'O') | strcmp(nm,'HO2') - yint = 1.0*yeq(n); - else - yint = yeq(n); - end - if flametype == 3 - y1 = massFraction(right, n); - else - y1 = yeq(n); - end - setProfile(f, 2, nm, [0 z1 1 - massFraction(left, n) yint y1]); -end - -% set minimal grid refinement criteria -setRefineCriteria(f, 2, 10.0, 0.8, 0.8); diff --git a/samples/matlab/flame1.m b/samples/matlab/flame1.m deleted file mode 100644 index 1d4c91ffa9..0000000000 --- a/samples/matlab/flame1.m +++ /dev/null @@ -1,113 +0,0 @@ -% FLAME1 - A burner-stabilized flat flame -% -% This script simulates a burner-stablized lean hydrogen-oxygen flame -% at low pressure. -% -% Keywords: combustion, 1D flow, burner-stabilized flame, plotting - -help flame1 - -t0 = cputime; % record the starting time - -% parameter values -p = 0.05*oneatm; % pressure -tburner = 373.0; % burner temperature -mdot = 0.06; % kg/m^2/s - -rxnmech = 'h2o2.yaml'; % reaction mechanism file -comp = 'H2:1.8, O2:1, AR:7'; % premixed gas composition - -initial_grid = [0.0 0.02 0.04 0.06 0.08 0.1 ... - 0.15 0.2 0.4 0.49 0.5]; % m - -tol_ss = [1.0e-5 1.0e-13]; % [rtol atol] for steady-state - % problem -tol_ts = [1.0e-4 1.0e-9]; % [rtol atol] for time stepping - -loglevel = 1; % amount of diagnostic output (0 - % to 5) - -refine_grid = 1; % 1 to enable refinement, 0 to - % disable -max_jacobian_age = [5, 10]; - -%%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% -% -% This object will be used to evaluate all thermodynamic, kinetic, -% and transport properties -% -gas = Solution(rxnmech, 'ohmech', 'mixture-averaged'); - -% set its state to that of the unburned gas at the burner -set(gas,'T', tburner, 'P', p, 'X', comp); - -%%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% - -f = AxisymmetricFlow(gas,'flow'); -set(f, 'P', p, 'grid', initial_grid); -set(f, 'tol', tol_ss, 'tol-time', tol_ts); - -%%%%%%%%%%%%%%% create the burner %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% The burner is an Inlet object. The temperature, mass flux, -% and composition (relative molar) may be specified. -% -burner = Inlet('burner'); -set(burner, 'T', tburner, 'MassFlux', mdot, 'X', comp); - -%%%%%%%%%%%%%% create the outlet %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% The type of flame is determined by the object that terminates -% the domain. An Outlet object imposes zero gradient boundary -% conditions for the temperature and mass fractions, and zero -% radial velocity and radial pressure gradient. -% -s = Outlet('out'); - -%%%%%%%%%%%%% create the flame object %%%%%%%%%%%% -% -% Once the component parts have been created, they can be assembled -% to create the flame object. -% -fl = flame(gas, burner, f, s); -setMaxJacAge(fl, max_jacobian_age(1), max_jacobian_age(2)); - -% if the starting solution is to be read from a previously-saved -% solution, uncomment this line and edit the file name and solution id. -%restore(fl,'h2flame.yaml', 'energy') - -solve(fl, loglevel, refine_grid); - -%%%%%%%%%%%% enable the energy equation %%%%%%%%%%%%%%%%%%%%% -% -% The energy equation will now be solved to compute the -% temperature profile. We also tighten the grid refinement -% criteria to get an accurate final solution. -% - -enableEnergy(f); -setRefineCriteria(fl, 2, 200.0, 0.05, 0.1); -solve(fl, 1, 1); -saveSoln(fl,'h2flame.yaml','energy',['solution with energy equation']); - -%%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -writeStats(fl); -elapsed = cputime - t0; -e = sprintf('Elapsed CPU time: %10.4g',elapsed); -disp(e); - -%%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -clf; -subplot(2,2,1); -plotSolution(fl, 'flow', 'T'); -title('Temperature [K]'); -subplot(2,2,2); -plotSolution(fl, 'flow', 'u'); -title('Axial Velocity [m/s]'); -subplot(2,2,3); -plotSolution(fl, 'flow', 'H2O'); -title('H2O Mass Fraction'); -subplot(2,2,4); -plotSolution(fl, 'flow', 'O2'); -title('O2 Mass Fraction'); diff --git a/samples/matlab/flame2.m b/samples/matlab/flame2.m deleted file mode 100644 index fb0c24383c..0000000000 --- a/samples/matlab/flame2.m +++ /dev/null @@ -1,112 +0,0 @@ -% FLAME1 - An axisymmetric stagnation-point non-premixed flame -% -% This script simulates a stagnation-point ethane-air flame. -% -% Keywords: combustion, 1D flow, strained flame, diffusion flame, plotting - -t0 = cputime; % record the starting time - -% parameter values -p = oneatm; % pressure -tin = 300.0; % inlet temperature -mdot_o = 0.72; % air, kg/m^2/s -mdot_f = 0.24; % fuel, kg/m^2/s - -rxnmech = 'gri30.yaml'; % reaction mechanism file -comp1 = 'O2:0.21, N2:0.78, AR:0.01'; % air composition -comp2 = 'C2H6:1'; % fuel composition - -initial_grid = 0.02*[0.0 0.2 0.4 0.6 0.8 1.0]; % m - -tol_ss = [1.0e-5 1.0e-13]; % [rtol atol] for steady-state - % problem -tol_ts = [1.0e-4 1.0e-13]; % [rtol atol] for time stepping - -loglevel = 1; % amount of diagnostic output (0 - % to 5) - -refine_grid = 1; % 1 to enable refinement, 0 to - % disable - -%%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% -% -% This object will be used to evaluate all thermodynamic, kinetic, -% and transport properties -% -gas = Solution(rxnmech,'gri30','mixture-averaged'); - -% set its state to that of the fuel (arbitrary) -set(gas,'T', tin, 'P', p, 'X', comp2); - -%%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% - -f = AxisymmetricFlow(gas,'flow'); - -set(f, 'P', p, 'grid', initial_grid); -set(f, 'tol', tol_ss, 'tol-time', tol_ts); - -%%%%%%%%%%%%%%% create the air inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% The temperature, mass flux, and composition (relative molar) may be -% specified. -% -inlet_o = Inlet('air_inlet'); -set(inlet_o, 'T', tin, 'MassFlux', mdot_o, 'X', comp1); - -%%%%%%%%%%%%%% create the fuel inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%% -inlet_f = Inlet('fuel_inlet'); -set(inlet_f, 'T', tin, 'MassFlux', mdot_f, 'X', comp2); - -%%%%%%%%%%%%% create the flame object %%%%%%%%%%%% -% -% Once the component parts have been created, they can be assembled -% to create the flame object. -% -fl = flame(gas, inlet_o, f, inlet_f); - -% if the starting solution is to be read from a previously-saved -% solution, uncomment this line and edit the file name and solution id. -%restore(fl,'c2h6-flame.yaml', 'energy') - -% solve with fixed temperature profile first -solve(fl, loglevel, refine_grid); - -%%%%%%%%%%%% enable the energy equation %%%%%%%%%%%%%%%%%%%%% -% -% The energy equation will now be solved to compute the -% temperature profile. We also tighten the grid refinement -% criteria to get an accurate final solution. -% - -enableEnergy(f); -setRefineCriteria(fl, 2, 200.0, 0.1, 0.1); -solve(fl, loglevel, refine_grid); -saveSoln(fl,'c2h6-flame.yaml','energy',['solution with energy equation']); - -%%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -writeStats(fl); -elapsed = cputime - t0; -e = sprintf('Elapsed CPU time: %10.4g',elapsed); -disp(e); - -%%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -figure(1); -subplot(2,3,1); -plotSolution(fl, 'flow', 'T'); -title('Temperature [K]'); -subplot(2,3,2); -plotSolution(fl, 'flow', 'C2H6'); -title('C2H6 Mass Fraction'); -subplot(2,3,3); -plotSolution(fl, 'flow', 'O2'); -title('O2 Mass Fraction'); -subplot(2,3,4); -plotSolution(fl, 'flow', 'CH'); -title('CH Mass Fraction'); -subplot(2,3,5); -plotSolution(fl, 'flow', 'V'); -title('Radial Velocity / Radius [s^-1]'); -subplot(2,3,6); -plotSolution(fl, 'flow', 'u'); -title('Axial Velocity [m/s]'); diff --git a/samples/matlab/ignite.m b/samples/matlab/ignite.m deleted file mode 100644 index cb300f6cff..0000000000 --- a/samples/matlab/ignite.m +++ /dev/null @@ -1,102 +0,0 @@ -function plotdata = ignite(g) -% IGNITE Zero-dimensional kinetics: adiabatic, constant pressure. -% -% This example solves the same problem as 'reactor1,' but does -% it using one of MATLAB's ODE integrators, rather than using the -% Cantera Reactor class. -% -% Keywords: combustion, reactor network, ignition delay, plotting - -help ignite - -if nargin == 1 - gas = g; -else - gas = Solution('gri30.yaml'); -end - -% set the initial conditions - -set(gas,'T',1001.0,'P',oneatm,'X','H2:2,O2:1,N2:4'); - -y0 = [intEnergy_mass(gas) - 1.0/density(gas) - massFractions(gas)]; - -time_interval = [0 0.001]; -options = odeset('RelTol',1.e-5,'AbsTol',1.e-12,'Stats','on'); - -t0 = cputime; -out = ode15s(@reactor_ode,time_interval,y0,options,gas,@vdot,@area,@heatflux); -disp(['CPU time = ' num2str(cputime - t0)]); - -plotdata = output(out,gas); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% the functions below may be defined arbitrarily to set the reactor -% boundary conditions - the rate of change of volume, the heat -% flux, and the area. - -% Rate of change of volume. Any arbirtrary function may be implemented. -% Input arguments: -% t time -% vol volume -% gas ideal gas object - -function v = vdot(t, vol, gas) -%v = 0.0; %uncomment for constant volume -v = 1.e11 * (pressure(gas) - 101325.0); % holds pressure very - % close to 1 atm - -% heat flux (W/m^2). -function q = heatflux(t, gas) -q = 0.0; % adiabatic - -% surface area (m^2). Used only to compute heat transfer. -function a = area(t,vol) -a = 1.0; - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Since the solution variables used by the 'reactor' function are -% not necessarily those desired for output, this function is called -% after the integration is complete to generate the desired -% outputs. - -function pv = output(s, gas) -times = s.x; -soln = s.y; -[~,n] = size(times); -pv = zeros(nSpecies(gas) + 4, n); - -set(gas,'T',1001.0,'P',oneatm); - -for j = 1:n - ss = soln(:,j); - y = ss(3:end); - mass = sum(y); - u_mass = ss(1)/mass; - v_mass = ss(2)/mass; - setMassFractions(gas, y); - setState_UV(gas, [u_mass v_mass]); - - pv(1,j) = times(j); - pv(2,j) = temperature(gas); - pv(3,j) = density(gas); - pv(4,j) = pressure(gas); - pv(5:end,j) = y; -end - -% plot the temperature and OH mass fractions. -figure(1); -plot(pv(1,:),pv(2,:)); -xlabel('time'); -ylabel('Temperature'); -title(['Final T = ' num2str(pv(2,end)) ' K']); - -figure(2); -ioh = speciesIndex(gas,'OH'); -plot(pv(1,:),pv(4+ioh,:)); -xlabel('time'); -ylabel('Mass Fraction'); -title('OH Mass Fraction'); diff --git a/samples/matlab/ignite_hp.m b/samples/matlab/ignite_hp.m deleted file mode 100644 index 8fb5e8bbee..0000000000 --- a/samples/matlab/ignite_hp.m +++ /dev/null @@ -1,38 +0,0 @@ -function ignite_hp(gas) -% IGNITE_HP Solves the same ignition problem as 'ignite', but uses function -% conhp instead of reactor. -% -% Keywords: combustion, user-defined model, ignition delay, plotting - -help ignite_hp - -if nargin == 0 - gas = Solution('h2o2.yaml', 'ohmech', 'none'); -end - -mw = molecularWeights(gas); -set(gas,'T',1001.0,'P',oneatm,'X','H2:2,O2:1,N2:4'); - -y0 = [temperature(gas) - massFractions(gas)]; -tel = [0 0.001]; -options = odeset('RelTol',1.e-5,'AbsTol',1.e-12,'Stats','on'); -t0 = cputime; -out = ode15s(@conhp,tel,y0,options,gas,mw); -disp(['CPU time = ' num2str(cputime - t0)]); - -if nargout == 0 - % plot the temperature and OH mole fractions. - figure(1); - plot(out.x,out.y(1,:)); - xlabel('time'); - ylabel('Temperature'); - title(['Final T = ' num2str(out.y(1,end)) ' K']); - - figure(2); - ioh = speciesIndex(gas,'OH'); - plot(out.x,out.y(1+ioh,:)); - xlabel('time'); - ylabel('Mass Fraction'); - title('OH Mass Fraction'); -end diff --git a/samples/matlab/ignite_uv.m b/samples/matlab/ignite_uv.m deleted file mode 100644 index 8f7f54b59b..0000000000 --- a/samples/matlab/ignite_uv.m +++ /dev/null @@ -1,38 +0,0 @@ -function ignite_uv(gas) -% IGNITE_UV Solves the same ignition problem as 'ignite2', except -% that function conuv is used instead of reactor. -% -% Keywords: combustion, user-defined model, ignition delay, plotting - -help ignite_uv - -if nargin == 0 - gas = Solution('h2o2.yaml', 'ohmech', 'none'); -end - -mw = molecularWeights(gas); -set(gas,'T',1001.0,'P',oneatm,'X','H2:2,O2:1,N2:4'); - -y0 = [temperature(gas) - massFractions(gas)]; -tel = [0 0.001]; -options = odeset('RelTol',1.e-5,'AbsTol',1.e-12,'Stats','on'); -t0 = cputime; -out = ode15s(@conuv,tel,y0,options,gas,mw); -disp(['CPU time = ' num2str(cputime - t0)]); - -if nargout == 0 - % plot the temperature and OH mole fractions. - figure(1); - plot(out.x,out.y(1,:)); - xlabel('time'); - ylabel('Temperature'); - title(['Final T = ' num2str(out.y(1,end)) ' K']); - - figure(2); - ioh = speciesIndex(gas,'OH'); - plot(out.x,out.y(1+ioh,:)); - xlabel('time'); - ylabel('Mass Fraction'); - title('OH Mass Fraction'); -end diff --git a/samples/matlab/isentropic.m b/samples/matlab/isentropic.m deleted file mode 100644 index 45ea16d8e1..0000000000 --- a/samples/matlab/isentropic.m +++ /dev/null @@ -1,59 +0,0 @@ -function isentropic(g) -% ISENTROPIC isentropic, adiabatic flow example -% -% In this example, the area ratio vs. Mach number curve is -% computed for a hydrogen/nitrogen gas mixture. -% -% Keywords: thermodynamics, compressible flow, plotting - -help isentropic - -if nargin == 1 - gas = g; -else - gas = Solution('h2o2.yaml'); -end - -% set the stagnation state -set(gas,'T',1200.0,'P',10.0*oneatm,'X','H2:1,N2:0.1'); -s0 = entropy_mass(gas); -h0 = enthalpy_mass(gas); -p0 = pressure(gas); - -mdot = 1; % arbitrary - -mach = []; -a = []; -i = 1; -amin = 1.e14; - -% compute values for a range of pressure ratios -for r = 0.005:0.0025:0.995 - p = p0*r; - - % set the state using (p,s0) - set(gas,'P',p,'S',s0); - - h = enthalpy_mass(gas); - rho = density(gas); - - v2 = 2.0*(h0 - h); % h + V^2/2 = h0 - v = sqrt(v2); - a(i) = mdot/(rho*v); % rho*v*A = constant - - if a(i) < amin - amin = a(i); - end - mach(i) = v/soundspeed(gas); - i = i + 1; -end - -a = a/amin; - -% plot results - -clf; -plot(mach,a); -ylabel('Area Ratio'); -xlabel('Mach Number'); -title('Isentropic Flow: Area Ratio vs. Mach Number'); diff --git a/samples/matlab/lithium_ion_battery.m b/samples/matlab/lithium_ion_battery.m deleted file mode 100644 index a943e43717..0000000000 --- a/samples/matlab/lithium_ion_battery.m +++ /dev/null @@ -1,136 +0,0 @@ -% This example file calculates the cell voltage of a lithium-ion battery -% at given temperature, pressure, current, and range of state of charge (SOC). -% -% The thermodynamics are based on a graphite anode and a LiCoO2 cathode, -% modeled using the 'BinarySolutionTabulatedThermo' class. -% Further required cell parameters are the electrolyte ionic resistance, the -% stoichiometry ranges of the active materials (electrode balancing), and the -% surface area of the active materials. -% -% The functionality of this example is presented in greater detail in the -% reference (which also describes the derivation of the -% BinarySolutionTabulatedThermo class): -% -% Reference: -% M. Mayur, S. C. DeCaluwe, B. L. Kee, W. G. Bessler, “Modeling and simulation -% of the thermodynamics of lithium-ion battery intercalation materials in the -% open-source software Cantera,” Electrochim. Acta 323, 134797 (2019), -% https://doi.org/10.1016/j.electacta.2019.134797 -% -% Keywords: surface chemistry, kinetics, electrochemistry, battery, plotting - -% ----------------------------------------------------------------------------- -% Input -% ----------------------------------------------------------------------------- - -% Operation parameters -SOC = 0:0.02:1; % [-] Input state of charge (0...1) (can be a vector) -I_app = -1; % [A] Externally-applied current, negative for discharge -T = 293; % [K] Temperature -P = oneatm; % [Pa] Pressure - -% Cell properties -inputFile = 'lithium_ion_battery.yaml'; % Cantera input file name -R_elyt = 0.0384; % [Ohm] Electrolyte resistance -S_ca = 1.1167; % [m^2] Cathode total active material surface area -S_an = 0.7824; % [m^2] Anode total active material surface area - -% Electrode balancing: The "balancing" of the electrodes relates the chemical -% composition (lithium mole fraction in the active materials) to the macroscopic -% cell-level state of charge. -X_Li_an_0 = 0.01; % [-] anode Li mole fraction at SOC = 0 % -X_Li_an_1 = 0.75; % [-] anode Li mole fraction at SOC = 100 % -X_Li_ca_0 = 0.99; % [-] cathode Li mole fraction at SOC = 0 % -X_Li_ca_1 = 0.49; % [-] cathode Li mole fraction at SOC = 100 % - -% ----------------------------------------------------------------------------- -% Calculations -% ----------------------------------------------------------------------------- - -% Calculate mole fractions from SOC -X_Li_an = (X_Li_an_1-X_Li_an_0)*SOC+X_Li_an_0; % anode balancing -X_Li_ca = (X_Li_ca_0-X_Li_ca_1)*(1-SOC)+X_Li_ca_1; % cathode balancing - -% Import all Cantera phases -anode = Solution(inputFile, 'anode'); -cathode = Solution(inputFile, 'cathode'); -elde = Solution(inputFile, 'electron'); -elyt = Solution(inputFile, 'electrolyte'); -anode_interface = Interface(inputFile, 'edge_anode_electrolyte', anode, elde, elyt); -cathode_interface = Interface(inputFile, 'edge_cathode_electrolyte', cathode, elde, elyt); - -% Set the temperatures and pressures of all phases -set(anode,'T',T,'P',P); -set(cathode,'T',T,'P',P); -set(elde,'T',T,'P',P); -set(elyt,'T',T,'P',P); -set(anode_interface,'T',T,'P',P); -set(cathode_interface,'T',T,'P',P); - -% Calculate cell voltage, separately for each entry of the input vectors -V_cell = zeros(length(SOC),1); -phi_l_an = 0; -phi_s_ca = 0; -for i = 1:length(SOC) - % Set anode electrode potential to 0 - phi_s_an = 0; - - % Calculate anode electrolyte potential - phi_l_an = fzero(@(E) anode_curr(phi_s_an,E,X_Li_an(i),anode,elde,elyt,anode_interface,S_an)-I_app, phi_l_an); - - % Calculate cathode electrolyte potential - phi_l_ca = phi_l_an + I_app*R_elyt; - - % Calculate cathode electrode potential - phi_s_ca = fzero(@(E) cathode_curr(E,phi_l_ca,X_Li_ca(i),cathode,elde,elyt,cathode_interface,S_ca)-I_app, phi_s_ca); - - % Calculate cell voltage - V_cell(i) = phi_s_ca - phi_s_an; -end - -% Let's plot the cell voltage, as a function of the state of charge: -figure(1); -plot(SOC*100,V_cell,'linewidth',2.5) -ylim([2.5,4.3]) -xlabel('State of charge / %') -ylabel('Cell voltage / V') -set(gca,'fontsize',14) - - -%-------------------------------------------------------------------------- -% Helper functions -% ----------------------------------------------------------------------------- - -% This function returns the Cantera calculated anode current (in A) -function anCurr = anode_curr(phi_s,phi_l,X_Li_an,anode,elde,elyt,anode_interface,S_an) - % Set the active material mole fraction - set(anode,'X',['Li[anode]:' num2str(X_Li_an) ', V[anode]:' num2str(1-X_Li_an)]); - - % Set the electrode and electrolyte potential - setElectricPotential(elde,phi_s); - setElectricPotential(elyt,phi_l); - - % Get the net reaction rate at the anode-side interface - % Reaction according to YAML file: Li+[elyt] + V[anode] + electron <=> Li[anode] - r = rop_net(anode_interface); % [kmol/m2/s] - - % Calculate the current. Should be negative for cell discharge. - anCurr = r*faradayconstant*S_an; % -end - -% This function returns the Cantera calculated cathode current (in A) -function caCurr = cathode_curr(phi_s,phi_l,X_Li_ca,cathode,elde,elyt,cathode_interface,S_ca) - % Set the active material mole fractions - set(cathode,'X',['Li[cathode]:' num2str(X_Li_ca) ', V[cathode]:' num2str(1-X_Li_ca)]); - - % Set the electrode and electrolyte potential - setElectricPotential(elde,phi_s); - setElectricPotential(elyt,phi_l); - - % Get the net reaction rate at the cathode-side interface - % Reaction according to YAML file: Li+[elyt] + V[cathode] + electron <=> Li[cathode] - r = rop_net(cathode_interface); % [kmol/m2/s] - - % Calculate the current. Should be negative for cell discharge. - caCurr = r*faradayconstant*S_ca*(-1); % -end diff --git a/samples/matlab/periodic_cstr.m b/samples/matlab/periodic_cstr.m deleted file mode 100644 index 6ec0e15df8..0000000000 --- a/samples/matlab/periodic_cstr.m +++ /dev/null @@ -1,106 +0,0 @@ -function periodic_cstr -% -% A CSTR with steady inputs but periodic interior state. -% -% A stoichiometric hydrogen/oxygen mixture is introduced and reacts to produce -% water. But since water has a large efficiency as a third body in the chain -% termination reaction -% -% H + O2 + M = HO2 + M -% -% as soon as a significant amount of water is produced the reaction -% stops. After enough time has passed that the water is exhausted from -% the reactor, the mixture explodes again and the process -% repeats. This explanation can be verified by decreasing the rate for -% reaction 7 in file 'h2o2.yaml' and re-running the example. -% -% Acknowledgments: The idea for this example and an estimate of the -% conditions needed to see the oscillations came from Bob Kee, -% Colorado School of Mines -% -% Keywords: combustion, reactor network, well-stirred reactor, plotting - -help periodic_cstr - -% create the gas mixture -gas = Solution('h2o2.yaml'); - -% pressure = 60 Torr, T = 770 K -p = 60.0*133.3; -t = 770.0; - -OneAtm = 1.01325e5; - -set(gas,'T', 300.0, 'P', p, 'X', 'H2:2, O2:1'); - -% create an upstream reservoir that will supply the reactor. The -% temperature, pressure, and composition of the upstream reservoir are -% set to those of the 'gas' object at the time the reservoir is -% created. -upstream = Reservoir(gas); - -% Now set the gas to the initial temperature of the reactor, and create -% the reactor object. -set(gas, 'T', t, 'P', p); -cstr = IdealGasReactor(gas); - -% Set its volume to 10 cm^3. In this problem, the reactor volume is -% fixed, so the initial volume is the volume at all later times. -setInitialVolume(cstr, 10.0*1.0e-6); - -% We need to have heat loss to see the oscillations. Create a -% reservoir to represent the environment, and initialize its -% temperature to the reactor temperature. -env = Reservoir(gas); - -% Create a heat-conducting wall between the reactor and the -% environment. Set its area, and its overall heat transfer -% coefficient. Larger U causes the reactor to be closer to isothermal. -% If U is too small, the gas ignites, and the temperature spikes and -% stays high. -w = Wall; -install(w, cstr, env); -setArea(w, 1.0); -setHeatTransferCoeff(w, 0.02); - -% Connect the upstream reservoir to the reactor with a mass flow -% controller (constant mdot). Set the mass flow rate to 1.25 sccm. -sccm = 1.25; -vdot = sccm * 1.0e-6/60.0 * ((OneAtm / pressure(gas)) * ( temperature(gas) / 273.15)); % m^3/s -mdot = density(gas) * vdot; % kg/s -mfc = MassFlowController; -install(mfc, upstream, cstr); -setMassFlowRate(mfc, mdot); - -% now create a downstream reservoir to exhaust into. -downstream = Reservoir(gas); - -% connect the reactor to the downstream reservoir with a valve, and -% set the coefficient sufficiently large to keep the reactor pressure -% close to the downstream pressure of 60 Torr. -v = Valve; -install(v, cstr, downstream); -setValveCoeff(v, 1.0e-9); - -% create the network -network = ReactorNet({cstr}); - -% now integrate in time -tme = 0.0; -dt = 0.1; - -n = 0; -while tme < 300.0 - n = n + 1; - tme = tme + dt; - advance(network, tme); - tm(n) = tme; - y(1,n) = massFraction(cstr,'H2'); - y(2,n) = massFraction(cstr,'O2'); - y(3,n) = massFraction(cstr,'H2O'); -end -clf -figure(1) -plot(tm,y) -legend('H2','O2','H2O') -title('Mass Fractions') diff --git a/samples/matlab/prandtl1.m b/samples/matlab/prandtl1.m deleted file mode 100644 index 975c6d083c..0000000000 --- a/samples/matlab/prandtl1.m +++ /dev/null @@ -1,76 +0,0 @@ -function prandtl1(g) -% PRANDTL1 Prandtl number for an equilibrium H/O gas mixture. -% -% This example computes and plots the Prandtl number for a -% hydrogen / oxygen mixture in chemical equilibrium for P = 1 -% atm and a range of temperatures and elemental O/(O+H) ratios. -% -% Keywords: equilibrium, transport, plotting - -help prandtl1 - -if nargin == 1 - gas = g; -else - gas = Solution('h2o2.yaml', 'ohmech', 'mixture-averaged'); -end - -pr = zeros(31,31); -xh2 = zeros(31,31); -visc = zeros(31,31); -lambda = zeros(31,31); -t = []; -xo2 = []; -io2 = speciesIndex(gas,'O2'); -ih2 = speciesIndex(gas,'H2'); - -minT = minTemp(gas); -maxT = maxTemp(gas); -dT = (maxT - minT)/30.0; - -t0 = cputime; -for i = 1:31 - t(i) = minT + dT*(i-1); - for j = 1:31 - xo2(j) = 0.99*(j-1)/30.0; - x = zeros(nSpecies(gas),1); - x(io2) = xo2(j); - x(ih2) = 1.0 - xo2(j); - set(gas,'T',t(i),'P',oneatm,'X',x); - equilibrate(gas,'TP'); - visc(i,j) = viscosity(gas); - lambda(i,j) = thermalConductivity(gas); - pr(i,j) = visc(i,j)*cp_mass(gas)/lambda(i,j); - x = moleFractions(gas); - xh2(i,j) = x(ih2); - end -end -disp(['CPU time = ' num2str(cputime - t0)]); - -% plot results - -clf; -%figure(1); -subplot(2,2,1); -surf(xo2,t,pr); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('Prandtl Number'); - -subplot(2,2,2); -surf(xo2,t,xh2); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('H_2 Mole Fraction'); - -subplot(2,2,3); -surf(xo2,t,visc); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('Viscosity'); - -subplot(2,2,4); -surf(xo2,t,lambda); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('Thermal Conductivity'); diff --git a/samples/matlab/prandtl2.m b/samples/matlab/prandtl2.m deleted file mode 100644 index 23de6c38ae..0000000000 --- a/samples/matlab/prandtl2.m +++ /dev/null @@ -1,74 +0,0 @@ -function prandtl2(g) -% PRANDTL2 Prandtl number for an equilibrium H/O gas mixture. -% -% This example does the same thing as prandtl1, but using -% the multicomponent expression for the thermal conductivity. -% -% Keywords: transport, equilibrium, multicomponent transport, plotting - -help prandtl2 - -if nargin == 1 - gas = g; -else - gas = Solution('h2o2.yaml', 'ohmech', 'multicomponent'); -end - -pr = zeros(31,31); -xh2 = zeros(31,31); -visc = zeros(31,31); -lambda = zeros(31,31); -t = []; -xo2 = []; -io2 = speciesIndex(gas,'O2'); -ih2 = speciesIndex(gas,'H2'); - -minT = minTemp(gas); -maxT = maxTemp(gas); -dT = (maxT - minT)/30.0; - -t0 = cputime; -for i = 1:31 - t(i) = minT + dT*(i-1); - for j = 1:31 - xo2(j) = 0.99*(j-1)/30.0; - x = zeros(nSpecies(gas),1); - x(io2) = xo2(j); - x(ih2) = 1.0 - xo2(j); - set(gas,'T',t(i),'P',oneatm,'X',x); - equilibrate(gas,'TP'); - visc(i,j) = viscosity(gas); - lambda(i,j) = thermalConductivity(gas); - pr(i,j) = visc(i,j)*cp_mass(gas)/lambda(i,j); - x = moleFractions(gas); - xh2(i,j) = x(ih2); - end -end -disp(['CPU time = ' num2str(cputime - t0)]); - -% plot results - -clf; -subplot(2,2,1); -surf(xo2,t,pr); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('Prandtl Number'); - -subplot(2,2,2); -surf(xo2,t,xh2); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('H_2 Mole Fraction'); - -subplot(2,2,3); -surf(xo2,t,visc); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('Viscosity'); - -subplot(2,2,4); -surf(xo2,t,lambda); -xlabel('Elemental O/(O+H)'); -ylabel('Temperature (K)'); -zlabel('Thermal Conductivity'); diff --git a/samples/matlab/rankine.m b/samples/matlab/rankine.m deleted file mode 100644 index 9d219b5244..0000000000 --- a/samples/matlab/rankine.m +++ /dev/null @@ -1,61 +0,0 @@ -function [work, efficiency] = rankine(t1, p2, eta_pump, eta_turbine) -% -% This example computes the efficiency of a simple vapor power cycle. -% -% Keywords: thermodynamics, thermodynamic cycle, non-ideal fluid - -help rankine - -% create an object representing water -w = Water; - -% start with saturated liquid water at t1 -set(w,'T',t1,'Liquid',1.0); -p1 = pressure(w); - -% pump it to p2 -pump_work = pump(w, p2, eta_pump); -h2 = enthalpy_mass(w); -p2 = pressure(w); - -% heat to saturated vapor -set(w,'P',p2,'Vapor',1.0); -h3 = enthalpy_mass(w); - -heat_added = h3 - h2; - -% expand adiabatically back to the initial pressure -work = expand(w, p1, eta_turbine); - -% compute the efficiency -efficiency = (work - pump_work)/heat_added; - - -function w = pump(fluid, pfinal, eta) -% PUMP - Adiabatically pump a fluid to pressure pfinal, using a pump -% with isentropic efficiency eta. -% -h0 = enthalpy_mass(fluid); -s0 = entropy_mass(fluid); -set(fluid, 'S', s0, 'P', pfinal); -h1s = enthalpy_mass(fluid); -isentropic_work = h1s - h0; -actual_work = isentropic_work / eta; -h1 = h0 + actual_work; -set(fluid, 'H',h1, 'P',pfinal); -w = actual_work; - - -function w = expand(fluid, pfinal, eta) -% EXPAND - Adiabatically expand a fluid to pressure pfinal, using a -% turbine with isentropic efficiency eta. -% -h0 = enthalpy_mass(fluid); -s0 = entropy_mass(fluid); -set(fluid, 'S', s0, 'P', pfinal); -h1s = enthalpy_mass(fluid); -isentropic_work = h0 - h1s; -actual_work = isentropic_work * eta; -h1 = h0 - actual_work; -set(fluid, 'H',h1, 'P',pfinal); -w = actual_work; diff --git a/samples/matlab/reactor1.m b/samples/matlab/reactor1.m deleted file mode 100644 index 6c128c3382..0000000000 --- a/samples/matlab/reactor1.m +++ /dev/null @@ -1,83 +0,0 @@ -function reactor1(g) -% REACTOR1 Zero-dimensional kinetics: adiabatic, constant pressure. -% -% >>>> For a simpler way to carry out a constant-pressure simulation, -% see example reactor3.m <<<<< -% -% This example illustrates how to use class 'Reactor' for -% zero-dimensional kinetics simulations. Here the parameters are -% set so that the reactor is adiabatic and very close to constant -% pressure. -% -% Keywords: combustion, reactor network, ignition delay, plotting - -help reactor1 - -if nargin == 1 - gas = g; -else - gas = Solution('h2o2.yaml', 'ohmech', 'none'); -end - -P = oneatm; -% set the initial conditions -set(gas,'T',1001.0,'P',P,'X','H2:2,O2:1,N2:4'); - -% create a reactor, and insert the gas -r = IdealGasReactor(gas); - -% create a reservoir to represent the environment -a = Solution('air.yaml','air','none'); -set(a,'P',P) -env = Reservoir(a); - -% Define a wall between the reactor and the environment and -% make it flexible, so that the pressure in the reactor is held -% at the environment pressure. -w = Wall; -install(w,r,env); - -% set expansion parameter. dV/dt = KA(P_1 - P_2) -setExpansionRateCoeff(w, 1.0e6); - -% set wall area -setArea(w, 1.0); - -% create a reactor network and insert the reactor: -network = ReactorNet({r}); - -nSteps = 100; -tim(nSteps) = 0; -temp(nSteps) = 0; -x(nSteps,3) = 0; -t = 0.0; -dt = 1.0e-5; -t0 = cputime; -for n = 1:nSteps - t = t + dt; - advance(network, t); - tim(n) = time(network); - temp(n) = temperature(r); - x(n,1:3) = moleFraction(gas,{'OH','H','H2'}); -end -disp(['CPU time = ' num2str(cputime - t0)]); - -clf; -subplot(2,2,1); -plot(tim,temp); -xlabel('Time (s)'); -ylabel('Temperature (K)'); -subplot(2,2,2) -plot(tim,x(:,1)); -xlabel('Time (s)'); -ylabel('OH Mole Fraction (K)'); -subplot(2,2,3) -plot(tim,x(:,2)); -xlabel('Time (s)'); -ylabel('H Mole Fraction (K)'); -subplot(2,2,4) -plot(tim,x(:,3)); -xlabel('Time (s)'); -ylabel('H2 Mole Fraction (K)'); -clear all -cleanup diff --git a/samples/matlab/reactor2.m b/samples/matlab/reactor2.m deleted file mode 100644 index f6e206f940..0000000000 --- a/samples/matlab/reactor2.m +++ /dev/null @@ -1,61 +0,0 @@ -function reactor2(g) -% REACTOR2 Zero-dimensional kinetics: adiabatic, constant volume. -% -% This example illustrates how to use class 'Reactor' for -% zero-dimensional kinetics simulations. Here the parameters are -% set so that the reactor is adiabatic and constant volume. -% -% Keywords: combustion, reactor network, ignition delay, plotting - -help reactor2 - -if nargin == 1 - gas = g; -else - gas = Solution('h2o2.yaml', 'ohmech', 'none'); -end - -% set the initial conditions -set(gas,'T',1001.0,'P',oneatm,'X','H2:2,O2:1,N2:4'); - -% create a reactor, and insert the gas -r = IdealGasReactor(gas); - -% create a reactor network and insert the reactor -network = ReactorNet({r}); - -nSteps = 100; -tim(nSteps) = 0; -temp(nSteps) = 0; -x(nSteps,3) = 0; -t = 0; -dt = 1.0e-5; -t0 = cputime; -for n = 1:100 - t = t + dt; - advance(network, t); - tim(n) = time(network); - temp(n) = temperature(r); - x(n,1:3) = moleFraction(gas,{'OH','H','H2'}); -end -disp(['CPU time = ' num2str(cputime - t0)]); - -clf; -subplot(2,2,1); -plot(tim,temp); -xlabel('Time (s)'); -ylabel('Temperature (K)'); -subplot(2,2,2) -plot(tim,x(:,1)); -xlabel('Time (s)'); -ylabel('OH Mole Fraction (K)'); -subplot(2,2,3) -plot(tim,x(:,2)); -xlabel('Time (s)'); -ylabel('H Mole Fraction (K)'); -subplot(2,2,4) -plot(tim,x(:,3)); -xlabel('Time (s)'); -ylabel('H2 Mole Fraction (K)'); -clear all -cleanup diff --git a/samples/matlab/reactor_ode.m b/samples/matlab/reactor_ode.m deleted file mode 100644 index 000ae58d77..0000000000 --- a/samples/matlab/reactor_ode.m +++ /dev/null @@ -1,50 +0,0 @@ -function dydt = reactor_ode(t,y,gas,vdot,area,heatflux) -% REACTOR ODE system for a generic zero-dimensional reactor. -% -% Function REACTOR evaluates the system of ordinary differential -% equations for a zero-dimensional reactor with arbitrary heat -% transfer and volume change. -% -% Solution vector components: -% y(1) Total internal energy U -% y(2) Volume V -% y(3) Mass of species 1 -% .... -% y(2+nsp) Mass of last species -% - -[m,n] = size(y); -dydt = zeros(m,n); - -for j = 1:n - this_y = y(:,j); - int_energy = this_y(1); - vol = this_y(2); - masses = this_y(3:end); - - % evaluate the total mass, and the specific internal energy and volume. - total_mass = sum(masses); - u_mass = int_energy/total_mass; - v_mass = vol/total_mass; - - % set the state of the gas by specifying (u,v,{Y_k}) - setMassFractions(gas,masses); - setState_UV(gas, [u_mass v_mass]); - p = pressure(gas); - - % volume equation - vdt = feval(vdot, t, vol, gas); - - % energy equation - a = feval(area, t, vol); - q = feval(heatflux, t, gas); - udt = -p * vdt + a * q; - - % species equations - ydt = total_mass * ydot(gas); - - % set up column vector for dydt - dydt(:,j) = [udt - vdt - ydt ]; -end diff --git a/samples/matlab/surfreactor.m b/samples/matlab/surfreactor.m deleted file mode 100644 index df9cdc0c21..0000000000 --- a/samples/matlab/surfreactor.m +++ /dev/null @@ -1,99 +0,0 @@ -% SURFREACTOR Zero-dimensional reactor with surface chemistry -% -% This example illustrates how to use class 'Reactor' for -% zero-dimensional simulations including both homogeneous and -% heterogeneous chemistry. -% -% Keywords: catalysis, combustion, reactor network, plotting - -help surfreactor - -t = 870.0; -gas = Solution('ptcombust.yaml','gas'); - -% set the initial conditions -set(gas,'T',t,'P',oneatm,'X','CH4:0.01, O2:0.21, N2:0.78'); - -% The surface reaction mechanism describes catalytic combustion of -% methane on platinum, and is from Deutschmann et al., 26th -% Symp. (Intl.) on Combustion,1996, pp. 1747-1754 -surf = importInterface('ptcombust.yaml','Pt_surf', gas); -setTemperature(surf, t); - -nsp = nSpecies(gas); -nSurfSp = nSpecies(surf); - -% create a reactor, and insert the gas -r = IdealGasReactor(gas); -setInitialVolume(r, 1.0e-6) - -% create a reservoir to represent the environment -a = Solution('air.yaml','air','none'); -set(a,'T',t,'P',oneatm); -env = Reservoir(a); - -% Define a wall between the reactor and the environment and -% make it flexible, so that the pressure in the reactor is held -% at the environment pressure. -w = Wall; -install(w,r,env); - -A = 1e-4; % Wall area - -% Add a reacting surface, with an area matching that of the wall -rsurf = ReactorSurface(surf, r, A); - -% set the wall area and heat transfer coefficient. -setArea(w, A); -setHeatTransferCoeff(w,1.0e1); % W/m2/K - -% set expansion rate parameter. dV/dt = KA(P_1 - P_2) -setExpansionRateCoeff(w, 1.0); - -network = ReactorNet({r}); -% setTolerances(network, 1.0e-8, 1.0e-12); - -nSteps = 100; -p0 = pressure(r); -names = {'CH4','CO','CO2','H2O'}; -x = zeros([nSteps 4]); -tim = zeros(nSteps, 1); -temp = zeros(nSteps, 1); -pres = zeros(nSteps, 1); -cov = zeros([nSteps nSurfSp]); -t = 0; -dt = 0.1; -t0 = cputime; -for n = 1:nSteps - t = t + dt; - advance(network, t); - tim(n) = t; - temp(n) = temperature(r); - pres(n) = pressure(r) - p0; - cov(n,:) = coverages(surf)'; - x(n,:) = moleFraction(gas,names); -end -disp(['CPU time = ' num2str(cputime - t0)]); - -clf; -subplot(2,2,1); -plot(tim,temp); -xlabel('Time (s)'); -ylabel('Temperature (K)'); -subplot(2,2,2); -plot(tim,pres); -axis([0 5 -0.1 0.1]); -xlabel('Time (s)'); -ylabel('Delta Pressure (Pa)'); -subplot(2,2,3); -semilogy(tim,cov); -xlabel('Time (s)'); -ylabel('Coverages'); -legend(speciesNames(surf)); -subplot(2,2,4); -plot(tim,x); -xlabel('Time (s)'); -ylabel('Mole Fractions'); -legend(names); -clear all -cleanup diff --git a/samples/matlab/test_examples.m b/samples/matlab/test_examples.m deleted file mode 100644 index 60a0105e6d..0000000000 --- a/samples/matlab/test_examples.m +++ /dev/null @@ -1,29 +0,0 @@ -% runs selected examples without pausing - -clear all -close all -cleanup - -equil(); -isentropic(); -reactor1(); -reactor2(); -surfreactor; -periodic_cstr; -Plug_Flow_Reactor; -lithium_ion_battery -rankine(300.0, 2.0*oneatm, 0.8, 0.7); -prandtl1(); -prandtl2(); -flame1; -flame2; -catcomb; -clear all -close all -diffflame; -ignite_hp; -ignite_uv; - -clear all -close all -cleanup diff --git a/samples/matlab/tut1.m b/samples/matlab/tut1.m deleted file mode 100644 index 9bf79b6f57..0000000000 --- a/samples/matlab/tut1.m +++ /dev/null @@ -1,174 +0,0 @@ -% Tutorial 1: Getting started -% -% Topics: -% - creating a gas mixture -% - setting the state -% - cleaning up -% -% Keywords: tutorial - -help tut1 - -% Start MATLAB, and at the prompt type: - -gas1 = GRI30 - -% If you have successfully installed the Cantera toolbox, you should -%see something like this: -% temperature 300 K -% pressure 101325 Pa -% density 0.081889 kg/m^3 -% mean mol. weight 2.01588 amu -% -% 1 kg 1 kmol -% ----------- ------------ -% enthalpy 26470.1 5.336e+04 J -% internal energy -1.21088e+06 -2.441e+06 J -% entropy 64914 1.309e+05 J/K -% Gibbs function -1.94477e+07 -3.92e+07 J -% heat capacity c_p 14311.8 2.885e+04 J/K -% heat capacity c_v 10187.3 2.054e+04 J/K -% -% X Y Chem. Pot. / RT -% ------------- ------------ ------------ -% H2 1 1 -15.7173 -% [ +52 minor] 0 0 -% -% What you have just done is to create an object ("gas1") that -% implements GRI-Mech 3.0, the 53-species, 325-reaction natural gas -% combustion mechanism developed by Gregory P. Smith, David M. Golden, -% Michael Frenklach, Nigel W. Moriarty, Boris Eiteneer, Mikhail -% Goldenberg, C. Thomas Bowman, Ronald K. Hanson, Soonho Song, William -% C. Gardiner, Jr., Vitali V. Lissianski, and Zhiwei Qin. (See -% http://www.me.berkeley.edu/gri_mech/ for more information about -% GRI-Mech 3.0.) -% -% The object created by GI30 has properties you would expect for a gas -% mixture - it has a temperature, a pressure, species mole and mass -% fractions, etc. As we'll soon see, it has many other properties too. -% -% The summary of the state of 'gas1' printed above shows that new -% objects created by function GRI30 start out with a temperature of -% 300 K, a pressure of 1 atm, and have a composition that consists of -% only one species, in this case hydrogen. There is nothing special -% about H2 - it just happens to be the first species listed in the -% input file defining GRI-Mech 3.0 that the 'GRI30' function reads. In -% general, the species listed first will initially have a mole -% fraction of 1.0, and all of the others will be zero. - -% Setting the state -% ----------------- - -% The state of the object can be easily changed. For example, - -setTemperature(gas1, 1200) - -% sets the temperature to 1200 K. (Cantera always uses SI units.) - -% Notice in the summary of properties that MATLAB prints after this -% command is executed that the temperature has been changed as -% requested, but the pressure has changed too. The density and -% composition have not. -% -% When setting properties individually, some convention needs to be -% adopted to specify which other properties are held constant. This is -% because thermodynamics requires that *two* properties (not one) in -% addition to composition information be specified to fix the -% intensive state of a substance (or mixture). -% -% Cantera adopts the following convention: only one of the set -% (temperature, density, mass fractions) is altered by setting any -% single property. In particular: -% -% a) Setting the temperature is done holding density and -% composition fixed. (The pressure changes.) - -% b) Setting the pressure is done holding temperature and -% composition fixed. (The density changes.) -% -% c) Setting the composition is done holding temperature -% and density fixed. (The pressure changes). -% - - -% Setting multiple properties: the 'set' method -% --------------------------------------------- - -% If you want to set multiple properties at once, use the 'set' -% method. (Note: a 'method' is just the term for a function that acts -% on an object. In MATLAB, methods take the object as the first -% argument.) - -set(gas1, 'Temperature', 900.0, 'Pressure', 1.e5); - -% This statement sets both temperature and pressure at the same -% time. Any number of property/value pairs can be specified in a -% call to 'set'. For example, the following sets the mole fractions -% too: -set(gas1, 'Temperature', 900.0, 'Pressure', 1.e5, 'MoleFractions', ... - 'CH4:1,O2:2,N2:7.52'); - -% The 'set' method also accepts abbreviated property names: - -set(gas1,'T',900.0,'P',1.e5,'X','CH4:1,O2:2,N2:7.52') - -% Either version results in -% -% temperature 900 K -% pressure 100000 Pa -% density 0.369279 kg/m^3 -% mean mol. weight 27.6332 amu -% -% 1 kg 1 kmol -% ----------- ------------ -% enthalpy 455660 1.259e+07 J -% internal energy 184862 5.108e+06 J -% entropy 8529.31 2.357e+05 J/K -% Gibbs function -7.22072e+06 -1.995e+08 J -% heat capacity c_p 1304.4 3.604e+04 J/K -% heat capacity c_v 1003.52 2.773e+04 J/K -% -% X Y Chem. Pot. / RT -% ------------- ------------ ------------ -% O2 0.190114 0.220149 -27.9596 -% CH4 0.095057 0.0551863 -37.0813 -% N2 0.714829 0.724665 -24.935 -% [ +50 minor] 0 0 - -% Other properties may also be set using 'set', including some that -% can't be set individually. The following property pairs may be -% set: (Enthalpy, Pressure), (IntEnergy, Volume), (Entropy, -% Volume), (Entropy, Pressure). In each case, the values of the -% extensive properties must be entered *per unit mass*. - -% Setting the enthalpy and pressure: -set(gas1, 'Enthalpy', 2*enthalpy_mass(gas1), 'Pressure', 2*oneatm); - -% The composition above was specified using a string. The format is a -% comma-separated list of : -% pairs. The mole numbers will be normalized to produce the mole -% fractions, and therefore they are 'relative' mole numbers. Mass -% fractions can be set in this way too by changing 'X' to 'Y' in the -% above statement. - -% The composition can also be set using an array, which can be -% either a column vector or a row vector but must have the same -% size as the number of species. For example, to set all 53 mole -% fractions to the same value, do this: - -x = ones(53,1); % a column vector of 53 ones -set(gas1, 'X', x) - -% To set the mass fractions to equal values: -set(gas1, 'Y', x) - - -% This clears all Matlab objects created -clear all - -% and this clears all Cantera objects created -cleanup - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% end of tutorial 1 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/samples/matlab/tut2.m b/samples/matlab/tut2.m deleted file mode 100644 index 7b71a6f6b5..0000000000 --- a/samples/matlab/tut2.m +++ /dev/null @@ -1,105 +0,0 @@ -% Tutorial 2: Working with input files -% -% Topics: -% - using functions 'Solution' and 'importInterface' -% - input files distributed with Cantera -% - the Cantera search path -% - CTML files -% - converting from CK format -% -% Keywords: tutorial, input files - -help tut2 - -t0 = cputime; - -% In the last tutorial, we used function GRI30 to create an object -% that models an ideal gas mixture with the species and reactions of -% GRI-Mech 3.0. Another way to do this is shown here, with statements -% added to measure how long this takes: - -gas1 = Solution('gri30.yaml', 'gas', 'mixture-averaged'); -msg = sprintf('time to create gas1: %f', cputime - t0) - -% Function 'Solution' constructs an object representing a phase of -% matter by reading in attributes of the phase from a file, which in -% this case is 'gri30.yaml'. This file contains a complete specification -% of the GRI-Mech 3.0 reaction mechanism, including element data -% (name, atomic weight), species data (name, elemental composition, -% coefficients to compute thermodynamic and transport properties), and -% reaction data (stoichiometry, rate coefficient parameters). The file -% is written in a format understood by Cantera, which is described in -% the document "Defining Phases and Interfaces." - -% On some systems, processing long files can be a little slow. Loading -% a file again takes much less time, because Cantera 'remembers' files -% it has already processed and doesn't need to read them in again: - -t0 = cputime; -gas1b = Solution('gri30.yaml', 'gas', 'none'); -msg = sprintf('time to create gas1b: %f', cputime - t0) - -% Since GRI-Mech is a rather small mechanism, there might not be much -% difference in these times. - -% YAML files distributed with Cantera -%------------------------------------ - -% Several reaction mechanism files in this format are included in the -% Cantera distribution, including ones that model high-temperature -% air, a hydrogen/oxygen reaction mechanism, and a few surface -% reaction mechanisms. Under Windows, these files may be located in -% 'C:\Program Files\Common Files\Cantera', or in 'C:\cantera\data', -% depending on how you installed Cantera and the options you -% specified. On a Unix/Linux/macOS machine, they are usually kept -% in the 'data' subdirectory within the Cantera installation -% directory. - -% If for some reason Cantera has difficulty finding where these files -% are on your system, set environment variable CANTERA_DATA to the -% directory where they are located. Alternatively, you can call function -% adddir to add a directory to the Cantera search path: -adddir('/usr/local/cantera/my_data_files'); - -% Cantera input files are plain text files, and can be created with -% any text editor. See the document 'Defining Phases and Interfaces' -% for more information. - - -% Importing multiple phases or interfaces -% --------------------------------------- - -% A Cantera input file may contain more than one phase specification, -% or may contain specifications of interfaces (surfaces). Here we -% import definitions of two bulk phases and the interface between them -% from file diamond.yaml: - -gas2 = Solution('diamond.yaml', 'gas'); % a gas - -diamond = Solution('diamond.yaml','diamond'); % bulk diamond - -diamonnd_surf = importInterface('diamond.yaml','diamond_100',... - gas2, diamond); - -% Note that the bulk (that is, 3D) phases that participate in the surface -% reactions must also be passed as arguments to importInterface. - -% Converting CK-format files -% -------------------------- - -% Many existing reaction mechanism files are in "CK format," by which -% we mean the input file format developed for use with the Chemkin-II -% software package. [See R. J. Kee, F. M. Rupley, and J. A. Miller, -% Sandia National Laboratories Report SAND89-8009 (1989).] - -% Cantera comes with a converter utility program 'ck2yaml' (or -% 'ck2yaml.exe') that converts CK format into YAML format. This -% program should be run from the command line first to convert any CK -% files you plan to use into YAML format. -% -% Here's an example of how to use it: -% -% ck2yaml --input=mech.inp --thermo=therm.dat --transport=tran.dat --name=mymech - -clear all -cleanup diff --git a/samples/matlab/tut3.m b/samples/matlab/tut3.m deleted file mode 100644 index 70559f46b5..0000000000 --- a/samples/matlab/tut3.m +++ /dev/null @@ -1,55 +0,0 @@ -% Tutorial 3: Getting Help -% -% Keywords: tutorial - -help tut3 - -% Suppose you have created a Cantera object and want to know what -% methods are available for it, and get help on using the methods. - -g = GRI30 - -% The first thing you need to know is the MATLAB class object g -% belongs to. Type: - -class(g) - -% This tells you that g belongs to a class called 'Solution'. To find -% the methods for this class, type - -methods Solution - -% This command returns only a few method names. These are the ones -% directly defined in this class. But solution inherits many other -% methods from base classes. To see all of its methods, type - -methods Solution -full - -% Now a long list is printed, along with a specification of the class -% the method is inherited from. For example, 'setPressure' is -% inherited from a class 'ThermoPhase'. Don't be concerned at this -% point about what these base classes are - we'll come back to them -% later. - -% Now that you see what methods are available, you can type 'help -% ' to print help text for any method. For example, - -help setTemperature -help setMassFractions -help rop_net - -% For help on how to construct objects of a given class, type 'help -% ' - -help Solution - -% Now that you know how to get help when you need it, you can -% explore using the Cantera Toolbox on your own. But there are a -% few more useful things to know, which are described in the next -% few tutorials. - -clear all -cleanup -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% end of tutorial 3 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/samples/matlab/tut4.m b/samples/matlab/tut4.m deleted file mode 100644 index 154e98ccd6..0000000000 --- a/samples/matlab/tut4.m +++ /dev/null @@ -1,87 +0,0 @@ -% Tutorial 4: Chemical Equilibrium -% -% Topics: -% - the equilibrate method -% - specifying fixed TP, HP, UV, SV, or SP -% - checking reaction rates of progress -% -% Keywords: tutorial, equilibrium, kinetics - -help tut4 - -% To set a gas mixture to a state of chemical equilibrium, use the -% 'equilibrate' method. -% -g = GRI30('none'); -set(g,'T',1200.0,'P',oneatm,'X','CH4:0.95,O2:2,N2:7.52') -equilibrate(g,'TP') - -% The above statement sets the state of object 'g' to the state of -% chemical equilibrium holding temperature and pressure -% fixed. Alternatively, the specific enthalpy and pressure can be held -% fixed: - -disp('fixed H and P:'); -set(g,'T',1200.0,'P',oneatm,'X','CH4:0.95,O2:2.0,N2:7.52'); -equilibrate(g,'HP') - - -% Other options are -% 'UV' fixed specific internal energy and specific volume -% 'SV' fixed specific entropy and specific volume -% 'SP' fixed specific entropy and pressure - -disp('fixed U and V:'); -set(g,'T',1200.0,'P',oneatm,'X','CH4:0.95,O2:2,N2:7.52'); -equilibrate(g,'UV') - -disp('fixed S and V:'); -set(g,'T',1200.0,'P',oneatm,'X','CH4:0.95,O2:2,N2:7.52'); -equilibrate(g,'SV') - -disp('fixed S and P:'); -set(g,'T',1200.0,'P',oneatm,'X','CH4:0.95,O2:2,N2:7.52'); -equilibrate(g,'SP') - -% How can you tell if 'equilibrate' has correctly found the -% chemical equilibrium state? One way is verify that the net rates of -% progress of all reversible reactions are zero. - -% Here is the code to do this: -set(g,'T',2000.0,'P',oneatm,'X','CH4:0.95,O2:2,N2:7.52'); -equilibrate(g,'TP') -rf = rop_f(g); -rr = rop_r(g); -format short e; -for i = 1:nReactions(g) - if isReversible(g,i) - disp([i, rf(i), rr(i), (rf(i) - rr(i))/rf(i)]); - end -end - - -% You might be wondering how 'equilibrate' works. (Then again, you might -% not, in which case you can go on to the next tutorial now.) Method -% 'equilibrate' invokes Cantera's chemical equilibrium solver, which -% uses an element potential method. The element potential method is -% one of a class of equivalent 'nonstoichiometric' methods that all -% have the characteristic that the problem reduces to solving a set of -% M nonlinear algebraic equations, where M is the number of elements -% (not species). The so-called 'stoichiometric' methods, on the other -% hand, (including Gibbs minimization), require solving K nonlinear -% equations, where K is the number of species (usually K >> M). See -% Smith and Missen, "Chemical Reaction Equilibrium Analysis" for more -% information on the various algorithms and their characteristics. -% -% Cantera uses a damped Newton method to solve these equations, and -% does a few other things to generate a good starting guess and to -% produce a reasonably robust algorithm. If you want to know more -% about the details, look at the on-line documented source code of -% Cantera C++ class 'ChemEquil' at https://cantera.org. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -clear all -cleanup -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% end of tutorial 4 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/samples/matlab/tut5.m b/samples/matlab/tut5.m deleted file mode 100644 index 79ff48a0a7..0000000000 --- a/samples/matlab/tut5.m +++ /dev/null @@ -1,109 +0,0 @@ -% Tutorial 5: Reaction information and rates -% -% Topics: -% - stoichiometric coefficients -% - reaction rates of progress -% - species production rates -% - reaction equations -% - equilibrium constants -% - rate multipliers -% -% Keywords: tutorial, kinetics - -help tut5 - -g = GRI30('none'); -set(g,'T',1500,'P',oneatm,'X',ones(nSpecies(g),1)); - -% Methods are provided that compute many quantities of interest for -% kinetics. Some of these are: - - -% 1) Stoichiometric coefficients - -nu_r = stoich_r(g) % reactant stoichiometric coefficient mstix -nu_p = stoich_p(g) % product stoichiometric coefficient mstix -nu_net = stoich_net(g) % net (product - reactant) stoichiometric - % coefficient mstix - -% For any of these, the (k,i) matrix element is the stoichiometric -% coefficient of species k in reaction i. Since these coefficient -% matrices are very sparse, they are implemented as MATLAB sparse -% matrices. - - -% 2) Reaction rates of progress - -% Methods rop_f, rop_r, and rop_net return column vectors containing -% the forward, reverse, and net (forward - reverse) rates of -% progress, respectively, for all reactions. - -qf = rop_f(g); -qr = rop_r(g); -qn = rop_net(g); -rop = [qf, qr, qn] - -% This plots the rates of progress -figure(1); -bar(rop); -legend('forward','reverse','net'); - -% 3) Species production rates - -% Methods creationRates, destructionRates, and netProdRates return -% column vectors containing the creation, destruction, and net -% production (creation - destruction) rates, respectively, for all species. - -cdot = creationRates(g); -ddot = destructionRates(g); -wdot = netProdRates(g); -rates = [cdot, ddot, wdot] - -% This plots the production rates -figure(2); -bar(rates); -legend('creation','destruction','net'); - -% For comparison, the production rates may also be computed -% directly from the rates of progress and stoichiometric -% coefficients. - -cdot2 = nu_p*qf + nu_r*qr; -creation = [cdot, cdot2, cdot - cdot2] - -ddot2 = nu_r*qf + nu_p*qr; -destruction = [ddot, ddot2, ddot - ddot2] - -wdot2 = nu_net * qn; -net = [wdot, wdot2, wdot - wdot2] - -% 4) Reaction equations - -e8 = reactionEqn(g,8) % equation for reaction 8 -e1_10 = reactionEqn(g,1:10) % equation for rxns 1 - 10 -eqs = reactionEqn(g) % all equations - -% 5) Equilibrium constants - -% The equilibrium constants are computed in concentration units, -% with concentrations in kmol/m^3. - -kc = equil_Kc(g); -for i = 1:nReactions(g) - fprintf('%50s %13.5g', eqs{i}, kc(i)) -end - -% 6) Multipliers - -% For each reaction, a multiplier may be specified that is applied -% to the forward rate coefficient. By default, the multiplier is -% 1.0 for all reactions. - -for i = 1:nReactions(g) - setMultiplier(g, i, 2*i); - m = multiplier(g, i); -end - -clear all -cleanup -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/samples/matlab/tut6.m b/samples/matlab/tut6.m deleted file mode 100644 index 0de6b634ab..0000000000 --- a/samples/matlab/tut6.m +++ /dev/null @@ -1,73 +0,0 @@ -% Tutorial 6: Transport properties -% -% Topics: -% - mixture-averaged and multicomponent models -% - viscosity -% - thermal conductivity -% - binary diffusion coefficients -% - mixture-averaged diffusion coefficients -% - multicomponent diffusion coefficients -% - thermal diffusion coefficients -% -% Keywords: tutorial, transport - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Methods are provided to compute transport properties. By -% default, calculation of transport properties is not enabled. If -% transport properties are required, the transport model must be -% specified when the gas mixture object is constructed. - -% Currently, two models are implemented. Both are based on kinetic -% theory expressions, and follow the approach described in Dixon-Lewis -% (1968) and Kee, Coltrin, and Glarborg (2003). The first is a full -% multicomponent formulation, and the second is a simplification that -% uses expressions derived for mixtures with a small number of species -% (1 to 3), using approximate mixture rules to average over -% composition. - -% To use the multicomponent model with GRI-Mech 3.0, call function -% GRI30 as follows: - -g1 = GRI30('multicomponent') - -% To use the mixture-averaged model: - -g2 = GRI30('mixture-averaged') - -% Both models use a mixture-averaged formulation for the viscosity. -visc = [viscosity(g1), viscosity(g2)] - -% The thermal conductivity differs, however. -lambda = [thermalConductivity(g1), thermalConductivity(g2)] - -% Binary diffusion coefficients -bdiff1 = binDiffCoeffs(g1) -bdiff2 = binDiffCoeffs(g2) - -% Mixture-averaged diffusion coefficients. For convenience, the -% multicomponent model implements mixture-averaged diffusion -% coefficients too. -dmix2 = mixDiffCoeffs(g1) -dmix1 = mixDiffCoeffs(g2) - -% Multicomponent diffusion coefficients. These are only implemented -% if the multicomponent model is used. -dmulti = multiDiffCoeffs(g1) - -% Thermal diffusion coefficients. These are only implemented with the -% multicomponent model. These will be very close to zero, since -% the composition is pure H2. -dt = thermalDiffCoeffs(g1) - -% Now change the composition and re-evaluate -set(g1,'X',ones(nSpecies(g1),1)); -dt = thermalDiffCoeffs(g1) - -% Note that there are no singularities for pure gases. This is -% because a very small positive value is added to all mole -% fractions for the purpose of computing transport properties. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -clear all -cleanup diff --git a/samples/matlab/tut7.m b/samples/matlab/tut7.m deleted file mode 100644 index db6c226a10..0000000000 --- a/samples/matlab/tut7.m +++ /dev/null @@ -1,35 +0,0 @@ -% Tutorial 7: Thermodynamic Properties -% -% Keywords: tutorial, thermodynamics - -help tut7 - -% A variety of thermodynamic property methods are provided. -gas = Air -set(gas,'T',800,'P',oneatm) - -% temperature, pressure, density -T = temperature(gas) -P = pressure(gas) -rho = density(gas) -n = molarDensity(gas) - -% species non-dimensional properties -hrt = enthalpies_RT(gas) % vector of h_k/RT - -% mixture properties per mole -hmole = enthalpy_mole(gas) -umole = intEnergy_mole(gas) -smole = entropy_mole(gas) -gmole = gibbs_mole(gas) - -% mixture properties per unit mass -hmass = enthalpy_mass(gas) -umass = intEnergy_mass(gas) -smass = entropy_mass(gas) -gmass = gibbs_mass(gas) - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -clear all -cleanup diff --git a/samples/matlab_experimental/plotSolution.m b/samples/matlab_experimental/plotSolution.m index 9ad7a75777..70326a325a 100644 --- a/samples/matlab_experimental/plotSolution.m +++ b/samples/matlab_experimental/plotSolution.m @@ -4,7 +4,7 @@ function plotSolution(s, domain, component) % >> plotSolution(s, domain, component) % % :s: - % Instance of class :mat:class:`Sim1D`. + % Instance of class Matlab class `Sim1D`. % :domain: % Name of domain from which the component should be retrieved. % :component: @@ -17,4 +17,4 @@ function plotSolution(s, domain, component) plot(z, x); xlabel('z (m)'); ylabel(component); -end \ No newline at end of file +end From 39adb547f6e4686d072032884c84d39a7721a436 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 20 Feb 2024 19:30:33 -0600 Subject: [PATCH 7/9] [MATLAB-legacy] Remove MATLAB-legacy docs --- doc/sphinx/reference/index.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/sphinx/reference/index.md b/doc/sphinx/reference/index.md index d5143bbc98..ef3d92271b 100644 --- a/doc/sphinx/reference/index.md +++ b/doc/sphinx/reference/index.md @@ -18,12 +18,6 @@ mechanism files. :text-align: center ``` -```{grid-item-card} Matlab API Reference -:link: /matlab/index -:link-type: doc -:text-align: center -``` - ```{grid-item-card} C++ API Reference :link: ../cxx/index.html :text-align: center @@ -49,7 +43,6 @@ mechanism files. :caption: API Reference /python/index -/matlab/index /yaml/index releasenotes/index ``` From 1d2ed5f42cb25b70981f46e6e37f13fb4f730a91 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Wed, 13 Mar 2024 09:40:49 -0600 Subject: [PATCH 8/9] [MATLAB-legacy] Remove obsolete installation instructions --- doc/sphinx/install/conda.md | 35 +------------------------- doc/sphinx/install/fedora-rhel.md | 6 ----- doc/sphinx/install/freebsd.md | 6 ----- doc/sphinx/install/gentoo.md | 6 ----- doc/sphinx/install/index.md | 10 -------- doc/sphinx/install/macos.md | 41 ------------------------------- doc/sphinx/install/opensuse.md | 6 ----- doc/sphinx/install/ubuntu.md | 6 ----- doc/sphinx/install/windows.md | 20 +-------------- 9 files changed, 2 insertions(+), 134 deletions(-) delete mode 100644 doc/sphinx/install/macos.md diff --git a/doc/sphinx/install/conda.md b/doc/sphinx/install/conda.md index 0e89301eef..bb3d2b3262 100644 --- a/doc/sphinx/install/conda.md +++ b/doc/sphinx/install/conda.md @@ -8,8 +8,7 @@ distributions that include the ``conda`` package manager, which can be used to i Cantera. Installing Cantera using Conda can provide the Cantera -[Python module](sec-conda-python-interface) and -[MATLAB toolbox](sec-conda-matlab-interface), as well as libraries for linking to +[Python module](sec-conda-python-interface) as well as libraries for linking to applications written in C++, C, or Fortran 90. There are some exceptions to the availability of each interface depending on the operating system and Conda channel used. @@ -162,38 +161,6 @@ This assumes you are using Python from the default conda channel. If you install Python and Cantera from the `conda-forge` channel, you should specify the option `--channel conda-forge`. -(sec-conda-matlab-interface)= - -## MATLAB interface - -Cantera's MATLAB interface can be installed from the `cantera` channel. In this example, -the command will create a new conda environment named `ct-env`. From the command line -(or the Anaconda Prompt on Windows), run: - -```shell -conda create --name ct-env --channel cantera cantera cantera-matlab -``` - -This will create an environment named `ct-env` with Cantera's Python and MATLAB -interfaces. Even if you plan to use Cantera via MATLAB, the Python interface is required -to convert input files. In this case, Cantera must be installed from the `cantera` -channel, so we add `--channel cantera` and to tell Conda to look at the `cantera` -channel in addition to the default channels. - -To install the a development version of Cantera, specify `cantera/label/dev` as the -channel. - -### Upgrading from an earlier Cantera version - -If you already have the Cantera MATLAB interface installed in a conda environment -(named, for example, `ct-env`), you can upgrade it to the latest version available by -running the commands: - -```shell -conda activate ct-env -conda update --channel cantera cantera cantera-matlab -``` - (sec-conda-development-interface)= ## Development (C++ & Fortran 90) Interface diff --git a/doc/sphinx/install/fedora-rhel.md b/doc/sphinx/install/fedora-rhel.md index 7d9741abe4..699ef7665c 100644 --- a/doc/sphinx/install/fedora-rhel.md +++ b/doc/sphinx/install/fedora-rhel.md @@ -5,12 +5,6 @@ RPM packages are provided for supported versions of Fedora Linux. Stable builds available in the official repositories and development builds are in a Community Projects (COPR) repository. -:::{attention} -The Matlab interface is not available from this archive. To install the Matlab interface -on Fedora, you must install it using [conda](sec-conda-matlab-interface) or -[compile the source code](sec-compiling). -::: - As of Cantera 3.0.0, packages are available for currently supported releases of Fedora Linux and Fedora Rawhide as well as Enterprise Linux 8. diff --git a/doc/sphinx/install/freebsd.md b/doc/sphinx/install/freebsd.md index d2f178d5e8..ff3005a2ea 100644 --- a/doc/sphinx/install/freebsd.md +++ b/doc/sphinx/install/freebsd.md @@ -4,12 +4,6 @@ A community-maintained FreeBSD port ``science/cantera`` and package are available. This port provides the Octave interface when the OCTAVE option is turned on. -:::{attention} -The Matlab interface is not available from this port; to install the Matlab interface on -FreeBSD, you must install it using [conda](sec-conda-matlab-interface) or -[compile the source code](sec-compiling). -::: - The package can be installed by running ```shell diff --git a/doc/sphinx/install/gentoo.md b/doc/sphinx/install/gentoo.md index aeb1957404..ee33f0e22c 100644 --- a/doc/sphinx/install/gentoo.md +++ b/doc/sphinx/install/gentoo.md @@ -7,12 +7,6 @@ package is provided using a main portage tree. Additionally the package is provided for offline Documentation API reference for Cantera package libraries. -:::{attention} -The Matlab interface is not available from this archive. To install the Matlab interface -on Gentoo, you must install it using [conda](sec-conda-matlab-interface) or -[compile the source code](sec-compiling). -::: - The following interfaces and tools are installed by default: - C++ Libraries and header files for compiling your own programs that use Cantera. diff --git a/doc/sphinx/install/index.md b/doc/sphinx/install/index.md index cc7e39c815..eb5c18e57d 100644 --- a/doc/sphinx/install/index.md +++ b/doc/sphinx/install/index.md @@ -25,15 +25,6 @@ We highly recommend that all new users install the Python interface using - If you want to use the current development version, or add features of your own, you should [compile Cantera from source](sec-compiling). -## Installing the Cantera Matlab Toolbox - -- The Cantera Matlab toolbox can be installed on all operating systems using - [Conda](sec-conda-matlab-interface). -- Windows users can use [MSI installer packages](sec-install-windows). -- macOS users can also install using a [.pkg installer](sec-install-macos). -- If you want to use the current development version, or add features of your own, you - should [compile Cantera from source](sec-compiling). - ## Installing the Cantera C++ Interface & Fortran 90 Module - The Cantera development interface can be installed on all operating systems using @@ -60,7 +51,6 @@ opensuse gentoo freebsd windows -macos ``` ```{seealso} diff --git a/doc/sphinx/install/macos.md b/doc/sphinx/install/macos.md deleted file mode 100644 index 6ae19149e8..0000000000 --- a/doc/sphinx/install/macos.md +++ /dev/null @@ -1,41 +0,0 @@ -(sec-install-macos)= -# macOS Matlab Toolbox - -The Cantera Matlab toolbox can be installed using a macOS-specific installer. The -toolbox requires macOS version 10.15 (Catalina) or higher and a copy of Matlab built for -Intel processors (which will run under Rosetta 2 on ARM-based processors). - -:::{seealso} -To install the Cantera Python package, see the [pip](pip) or [conda](conda) -instructions. The Python package is required if: - -- You need to convert legacy input files to YAML -- You need to convert Chemkin-format input files to YAML -::: - -## Installation - -Download the Matlab Interface Installer package from -[GitHub](https://github.com/Cantera/cantera/releases/) - -When the file has downloaded, find it in Finder, hold *Control* and click the file. -Choose *Open* from the resulting menu, and select *Open* in the security dialog that -appears. Click *Continue* to proceed in the installer (noting that the installer may -open in the background; you can find its icon on the Dock), agreeing to the -[Cantera license terms](https://github.com/Cantera/cantera/blob/main/License.txt) and -the terms of the other open source software that we use. - -By default, the installer will add some lines to the file -`$HOME/Documents/MATLAB/startup.m` to enable loading the Cantera toolbox when Matlab -starts. If you wish to disable this, click *Customize* and de-select the *Install -startup.m script* option. Finally, clicking *Install* will install the interface to the -`$HOME/Applications/Cantera` folder. - -## Testing the installation - -Open Matlab and enter the following code: - -```matlab -gas = Solution('gri30.yaml') -h2o = Solution('liquidvapor.yaml','water') -``` diff --git a/doc/sphinx/install/opensuse.md b/doc/sphinx/install/opensuse.md index 76898bc65a..caaec323b5 100644 --- a/doc/sphinx/install/opensuse.md +++ b/doc/sphinx/install/opensuse.md @@ -11,9 +11,3 @@ $ zypper addrepo https://download.opensuse.org/repositories/home:fuller/openSUSE $ zypper refresh $ zypper install cantera ``` - -:::{attention} -The Matlab interface is not available from this archive. To install the Matlab interface -on openSUSE, you must install it using [conda](sec-conda-matlab-interface) or -[compile the source code](sec-compiling). -::: diff --git a/doc/sphinx/install/ubuntu.md b/doc/sphinx/install/ubuntu.md index 441c22ee42..e5781a3864 100644 --- a/doc/sphinx/install/ubuntu.md +++ b/doc/sphinx/install/ubuntu.md @@ -21,12 +21,6 @@ The available packages are: - `cantera` - A metapackage that will install everything except for the development files. -:::{attention} -The Matlab packages are not available from this archive; to install the Matlab packages -on Ubuntu, you must install it using [conda](sec-conda-matlab-interface) or -[compile the source code](sec-compiling). -::: - ## Installing To add the Cantera PPA: diff --git a/doc/sphinx/install/windows.md b/doc/sphinx/install/windows.md index dcff930053..289c9e448f 100644 --- a/doc/sphinx/install/windows.md +++ b/doc/sphinx/install/windows.md @@ -2,8 +2,7 @@ # Windows Packages Windows installers are provided for stable versions of Cantera. These installers -provide the Matlab toolbox and header/library files that can be used to compile -C++ applications. +provide header/library files that can be used to compile C++ applications. :::{seealso} To install the Cantera Python package, see the [pip](pip) or [conda](conda) @@ -23,20 +22,3 @@ installation instructions. The Python package is required if: - Go to the [Cantera Releases](https://github.com/Cantera/cantera/releases) page and download **Cantera-3.0.0-x64.msi**. - Run the installer and follow the prompts. - -3. **Configure Matlab** - -- Launch Matlab -- Go to *File->Set Path...* -- Select *Add with Subfolders* -- Browse to the folder `C:\Program Files\Cantera\matlab\toolbox` -- Select *Save*, then *Close*. - -4. **Test the installation** - -- From the Matlab prompt, run: - - ```matlab - gas = Solution('gri30.yaml') - h2o = Solution('liquidvapor.yaml', 'water') - ``` From d740f1b1fab7c3dd6334c30240f09ea17e4f815c Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Wed, 13 Mar 2024 09:55:12 -0600 Subject: [PATCH 9/9] [MATLAB-legacy] Add warnings for legacy MATLAB removal --- doc/sphinx/install/conda.md | 7 +++++++ doc/sphinx/install/index.md | 11 +++++++++++ doc/sphinx/install/windows.md | 7 +++++++ 3 files changed, 25 insertions(+) diff --git a/doc/sphinx/install/conda.md b/doc/sphinx/install/conda.md index bb3d2b3262..c977ced1c3 100644 --- a/doc/sphinx/install/conda.md +++ b/doc/sphinx/install/conda.md @@ -12,6 +12,13 @@ Installing Cantera using Conda can provide the Cantera applications written in C++, C, or Fortran 90. There are some exceptions to the availability of each interface depending on the operating system and Conda channel used. +:::{attention} +The *legacy* Matlab Cantera interface is discontinued and removed in Cantera 3.1. Users +requiring support of legacy Matlab Cantera code should continue using Cantera 3.0 +packages, or migrate their code base to the experimental Matlab toolbox that is +currently under development. +::: + Both the Anaconda and Miniconda distributions are available for Linux, macOS (Intel and ARM/Apple Silicon), and Windows. On Windows, users should install a 64-bit version of Anaconda or Miniconda, since the Cantera Conda packages are only available for 64-bit diff --git a/doc/sphinx/install/index.md b/doc/sphinx/install/index.md index eb5c18e57d..9a83d314bb 100644 --- a/doc/sphinx/install/index.md +++ b/doc/sphinx/install/index.md @@ -39,6 +39,15 @@ We highly recommend that all new users install the Python interface using - Users of other Linux distributions should [compile Cantera from source](sec-compiling). +## Installing the Cantera Matlab Toolbox + +:::{attention} +The *legacy* Matlab Cantera interface is discontinued and removed in Cantera 3.1. Users +requiring support of legacy Matlab Cantera code should continue using Cantera 3.0 +packages, or migrate their code base to the experimental Matlab toolbox that is +currently under development. +::: + ```{toctree} :maxdepth: 1 :hidden: @@ -53,6 +62,8 @@ freebsd windows ``` +## Troubleshooting + ```{seealso} Check the [FAQ](sec-faq-installation) for solutions to some common installation problems. diff --git a/doc/sphinx/install/windows.md b/doc/sphinx/install/windows.md index 289c9e448f..dfa840fda8 100644 --- a/doc/sphinx/install/windows.md +++ b/doc/sphinx/install/windows.md @@ -4,6 +4,13 @@ Windows installers are provided for stable versions of Cantera. These installers provide header/library files that can be used to compile C++ applications. +:::{attention} +The *legacy* Matlab Cantera interface is discontinued and removed in Cantera 3.1. Users +requiring support of legacy Matlab Cantera code should continue using Cantera 3.0 +packages, or migrate their code base to the experimental Matlab toolbox that is +currently under development. +::: + :::{seealso} To install the Cantera Python package, see the [pip](pip) or [conda](conda) installation instructions. The Python package is required if: