Changeset 349:b855b51c22f4
- Timestamp:
- Dec 11, 2013, 7:42:19 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/class/pf/Application.js
r341 r349 530 530 evaluateEntityValue : function(entity, s1, s2) 531 531 { 532 var formula; 533 switch (entity.nspecies) { 534 case 1: 535 var s1_str = "this.plasma." + s1.id; 536 formula = entity.formula.replace(/\%s1/g, s1_str); 537 break; 538 case 2: 539 var s1_str = "this.plasma." + s1.id; 540 var s2_str = "this.plasma." + s2.id; 541 formula = entity.formula.replace(/\%s1/g, s1_str); 542 formula = formula.replace(/\%s2/g, s2_str); 543 break; 544 default: 545 formula = entity.formula; 546 break; 547 } 548 var v = eval(formula); 549 550 return v; 532 var F = new Function("s1", "s2", entity.formula); 533 534 return F.call(this, s1, s2); 551 535 }, 552 536 -
source/entities.js
r318 r349 6 6 nspecies : 1, 7 7 section : "waves", 8 formula : " %s1.getPlasmaFrequency()",8 formula : "return s1.getPlasmaFrequency()", 9 9 wikiLink : "Plasma_frequency" 10 10 }, … … 15 15 nspecies : 1, 16 16 section : "fundamental", 17 formula : " %s1.getGyroFrequency(this.plasma.B)",17 formula : "return s1.getGyroFrequency(this.plasma.B)", 18 18 wikiLink : "Gyrofrequency" 19 19 }, … … 25 25 nspecies : 1, 26 26 section : "fundamental", 27 formula : " %s1.getTypicalDistance()",27 formula : "return s1.getTypicalDistance()", 28 28 wikiLink : "Wigner-Seitz_radius" 29 29 }, … … 34 34 nspecies : 1, 35 35 section : "fundamental", 36 formula : " %s1.getDebyeLength()",36 formula : "return s1.getDebyeLength()", 37 37 wikiLink : "Debye_length" 38 38 }, … … 43 43 nspecies : 1, 44 44 section : "fundamental", 45 formula : " this.plasma.getFullDebyeLength(%s1)",45 formula : "return this.plasma.getFullDebyeLength(s1)", 46 46 wikiLink : "Debye_length" 47 47 }, … … 52 52 nspecies : 1, 53 53 section : "fundamental", 54 formula : " %s1.getGyroRadius(this.plasma.B)",54 formula : "return s1.getGyroRadius(this.plasma.B)", 55 55 wikiLink : "Gyroradius" 56 56 }, … … 61 61 nspecies : 1, 62 62 section : "fundamental", 63 formula : " %s1.getMinApproachDistance()"63 formula : "return s1.getMinApproachDistance()" 64 64 }, 65 65 { … … 69 69 nspecies : 1, 70 70 section : "waves", 71 formula : " %s1.getInertialLength()",71 formula : "return s1.getInertialLength()", 72 72 wikiLink : "Inertial_length" 73 73 }, … … 78 78 nspecies : 1, 79 79 section : "fundamental", 80 formula : " %s1.getDeBroglieLength()",80 formula : "return s1.getDeBroglieLength()", 81 81 wikiLink : "DeBroglie_wavelength" 82 82 }, … … 88 88 nspecies : 1, 89 89 section : "fundamental", 90 formula : " %s1.getThermalVelocity()",90 formula : "return s1.getThermalVelocity()", 91 91 wikiLink : "Thermal_velocity" 92 92 }, … … 97 97 nspecies : 0, 98 98 section : "waves", 99 formula : " this.plasma.getAlfvenVelocity(this.plasma.B)",99 formula : "return this.plasma.getAlfvenVelocity(this.plasma.B)", 100 100 wikiLink : "Alfven_velocity" 101 101 }, … … 107 107 nspecies : 1, 108 108 section : "fundamental", 109 formula : " %s1.getCoupling()"109 formula : "return s1.getCoupling()" 110 110 }, 111 111 { … … 115 115 nspecies : 1, 116 116 section : "spectroscopy", 117 formula : "var r = %s1.getTypicalDistance()/%s1.getDebyeLength(); \118 (1 + r)*Math.exp(-r)"117 formula : "var r = s1.getTypicalDistance()/s1.getDebyeLength(); \ 118 return (1 + r)*Math.exp(-r)" 119 119 }, 120 120 … … 125 125 nspecies : 0, 126 126 section : "spectroscopy", 127 formula : " this.plasma.r.getTransitionEnergy()"127 formula : "return this.plasma.r.getTransitionEnergy()" 128 128 }, 129 129 { … … 133 133 nspecies : 0, 134 134 section : "spectroscopy", 135 formula : " this.plasma.r.getNaturalWidth()"135 formula : "return this.plasma.r.getNaturalWidth()" 136 136 }, 137 137 { … … 141 141 nspecies : 0, 142 142 section : "spectroscopy", 143 formula : " this.plasma.dE2dWl(this.plasma.r.getNaturalWidth())"143 formula : "return this.plasma.dE2dWl(this.plasma.r.getNaturalWidth())" 144 144 }, 145 145 { … … 149 149 nspecies : 0, 150 150 section : "spectroscopy", 151 formula : " this.plasma.r.getFineStructure()",151 formula : "return this.plasma.r.getFineStructure()", 152 152 wikiLink : "Fine_structure" 153 153 }, … … 158 158 nspecies : 0, 159 159 section : "spectroscopy", 160 formula : " this.plasma.dE2dWl(this.plasma.r.getFineStructure())",160 formula : "return this.plasma.dE2dWl(this.plasma.r.getFineStructure())", 161 161 wikiLink : "Fine_structure" 162 162 }, … … 167 167 nspecies : 0, 168 168 section : "spectroscopy", 169 formula : " 2*this.plasma.r.getDopplerHwhm()",169 formula : "return 2*this.plasma.r.getDopplerHwhm()", 170 170 wikiLink : "Doppler_broadening" 171 171 }, … … 176 176 nspecies : 0, 177 177 section : "spectroscopy", 178 formula : " this.plasma.dE2dWl(2*this.plasma.r.getDopplerHwhm())",178 formula : "return this.plasma.dE2dWl(2*this.plasma.r.getDopplerHwhm())", 179 179 wikiLink : "Doppler_broadening" 180 180 }, … … 185 185 nspecies : 0, 186 186 section : "spectroscopy", 187 formula : " 2*this.plasma.getZeemanSplitting()"187 formula : "return 2*this.plasma.getZeemanSplitting()" 188 188 }, 189 189 { … … 193 193 nspecies : 0, 194 194 section : "spectroscopy", 195 formula : " this.plasma.dE2dWl(2*this.plasma.getZeemanSplitting())"195 formula : "return this.plasma.dE2dWl(2*this.plasma.getZeemanSplitting())" 196 196 }, 197 197 { … … 201 201 nspecies : 0, 202 202 section : "spectroscopy", 203 formula : " 2*this.plasma.getStarkHwhm()"203 formula : "return 2*this.plasma.getStarkHwhm()" 204 204 }, 205 205 { … … 209 209 nspecies : 0, 210 210 section : "spectroscopy", 211 formula : " this.plasma.dE2dWl(2*this.plasma.getStarkHwhm())"211 formula : "return this.plasma.dE2dWl(2*this.plasma.getStarkHwhm())" 212 212 }, 213 213 { … … 218 218 prepos : "due to", 219 219 section : "spectroscopy", 220 formula : " 2*this.plasma.getQsHwhm(%s1)*this.plasma.getStarkQuasistaticity(%s1)"220 formula : "return 2*this.plasma.getQsHwhm(s1)*this.plasma.getStarkQuasistaticity(s1)" 221 221 }, 222 222 … … 228 228 prepos : "due to", 229 229 section : "spectroscopy", 230 formula : " 2*this.plasma.getQsHwhm(%s1)"230 formula : "return 2*this.plasma.getQsHwhm(s1)" 231 231 }, 232 232 … … 237 237 nspecies : 1, 238 238 section : "spectroscopy", 239 formula : " this.plasma.getMicrofieldFrequency(%s1)"239 formula : "return this.plasma.getMicrofieldFrequency(s1)" 240 240 }, 241 241 … … 246 246 nspecies : 0, 247 247 section : "spectroscopy", 248 formula : " this.plasma.r.getMinEnergyDistance()"248 formula : "return this.plasma.r.getMinEnergyDistance()" 249 249 }, 250 250 { … … 254 254 nspecies : 0, 255 255 section : "spectroscopy", 256 formula : " this.plasma.e.getPlasmaFrequencyW()",256 formula : "return this.plasma.e.getPlasmaFrequencyW()", 257 257 wikiLink : "Plasmon" 258 258 }, … … 263 263 nspecies : 0, 264 264 section : "fundamental", 265 formula : " this.plasma.getFermiEnergy()",265 formula : "return this.plasma.getFermiEnergy()", 266 266 wikiLink : "Fermi_energy" 267 267 }, … … 272 272 nspecies : 0, 273 273 section : "fundamental", 274 formula : " this.plasma.getFermiVelocity()",274 formula : "return this.plasma.getFermiVelocity()", 275 275 wikiLink : "Fermi_velocity" 276 276 }, … … 281 281 nspecies : 0, 282 282 section : "fundamental", 283 formula : " this.plasma.getFermiLength()",283 formula : "return this.plasma.getFermiLength()", 284 284 wikiLink : "Electric-field_screening" 285 285 }, … … 290 290 nspecies : 1, 291 291 section : "fundamental", 292 formula : " %s1.getChemicalPotential()",292 formula : "return s1.getChemicalPotential()", 293 293 wikiLink : "Chemical_potential" 294 294 }, … … 300 300 nspecies : 1, 301 301 section : "fundamental", 302 formula : " %s1.getMassDensity()",302 formula : "return s1.getMassDensity()", 303 303 wikiLink : "Density" 304 304 }, … … 309 309 nspecies : 0, 310 310 section : "fundamental", 311 formula : " this.plasma.getMassDensity()",311 formula : "return this.plasma.getMassDensity()", 312 312 wikiLink : "Density" 313 313 }, … … 319 319 nspecies : 0, 320 320 section : "fundamental", 321 formula : " this.plasma.getBeta()",321 formula : "return this.plasma.getBeta()", 322 322 wikiLink : "Beta_(plasma_physics)" 323 323 }, … … 329 329 nspecies : 0, 330 330 section : "spectroscopy", 331 formula : " pf.base.Bohr.c/this.plasma.r.getTransitionEnergy()*(2*Math.PI)"331 formula : "return pf.base.Bohr.c/this.plasma.r.getTransitionEnergy()*(2*Math.PI)" 332 332 }, 333 333 { … … 337 337 nspecies : 0, 338 338 section : "spectroscopy", 339 formula : " this.plasma.r.getTransitionEnergy()/(2*Math.PI)"339 formula : "return this.plasma.r.getTransitionEnergy()/(2*Math.PI)" 340 340 }, 341 341 … … 346 346 nspecies : 0, 347 347 section : "spectroscopy", 348 formula : " this.plasma.r.getOscillatorStrength()",348 formula : "return this.plasma.r.getOscillatorStrength()", 349 349 wikiLink : "Oscillator_strength" 350 350 }, … … 355 355 nspecies : 0, 356 356 section : "spectroscopy", 357 formula : " this.plasma.r.getEinsteinA()",357 formula : "return this.plasma.r.getEinsteinA()", 358 358 wikiLink : "Einstein_coefficients" 359 359 }, … … 365 365 nspecies : 0, 366 366 section : "spectroscopy", 367 formula : " this.plasma.e.getN()/this.plasma.getLteNe()",367 formula : "return this.plasma.e.getN()/this.plasma.getLteNe()", 368 368 wikiLink : "Einstein_coefficients" 369 369 }, … … 375 375 nspecies : 1, 376 376 section : "spectroscopy", 377 formula : " this.plasma.getStarkQuasistaticity(%s1)"377 formula : "return this.plasma.getStarkQuasistaticity(s1)" 378 378 }, 379 379 { … … 383 383 nspecies : 1, 384 384 section : "spectroscopy", 385 formula : " this.plasma.getStarkRatio(%s1)"385 formula : "return this.plasma.getStarkRatio(s1)" 386 386 }, 387 387 … … 392 392 nspecies : 1, 393 393 section : "spectroscopy", 394 formula : " %s1.getHoltsmarkField()"394 formula : "return s1.getHoltsmarkField()" 395 395 }, 396 396 … … 401 401 nspecies : 1, 402 402 section : "spectroscopy", 403 formula : " this.plasma.getMicrofieldFrequency(%s1)"403 formula : "return this.plasma.getMicrofieldFrequency(s1)" 404 404 }, 405 405 … … 410 410 nspecies : 1, 411 411 section : "radiation", 412 formula : " %s1.getCyclotronLosses(this.plasma.B)",412 formula : "return s1.getCyclotronLosses(this.plasma.B)", 413 413 wikiLink : "Cyclotron_radiation" 414 414 }, … … 420 420 nspecies : 0, 421 421 section : "radiation", 422 formula : " this.plasma.getBremsstrahlungLosses()",422 formula : "return this.plasma.getBremsstrahlungLosses()", 423 423 wikiLink : "Bremsstrahlung" 424 424 }, … … 430 430 nspecies : 0, 431 431 section : "radiation", 432 formula : " this.plasma.getBremsstrahlungSpectralDensity()",432 formula : "return this.plasma.getBremsstrahlungSpectralDensity()", 433 433 wikiLink : "Bremsstrahlung" 434 434 }, … … 440 440 nspecies : 0, 441 441 section : "radiation", 442 formula : " this.plasma.getFreeBoundLosses()"442 formula : "return this.plasma.getFreeBoundLosses()" 443 443 }, 444 444 … … 449 449 nspecies : 0, 450 450 section : "radiation", 451 formula : " this.plasma.getFreeBoundSpectralDensity()"451 formula : "return this.plasma.getFreeBoundSpectralDensity()" 452 452 }, 453 453 … … 458 458 nspecies : 1, 459 459 section : "fundamental", 460 formula : " %s1.getPressure()",460 formula : "return s1.getPressure()", 461 461 wikiLink : "Ideal_gas" 462 462 }, … … 468 468 nspecies : 0, 469 469 section : "fundamental", 470 formula : " this.plasma.getPressure()"470 formula : "return this.plasma.getPressure()" 471 471 }, 472 472 … … 477 477 nspecies : 0, 478 478 section : "fundamental", 479 formula : " this.plasma.getMagneticFieldPressure()",479 formula : "return this.plasma.getMagneticFieldPressure()", 480 480 wikiLink : "Magnetic_pressure" 481 481 }, … … 487 487 nspecies : 2, 488 488 section : "collisions", 489 formula : " this.plasma.getCoulombLog(%s1, %s2)",489 formula : "return this.plasma.getCoulombLog(s1, s2)", 490 490 wikiLink : "Coulomb_collision" 491 491 }, … … 497 497 nspecies : 2, 498 498 section : "collisions", 499 formula : " this.plasma.getRelaxationRate(%s1, %s2)"499 formula : "return this.plasma.getRelaxationRate(s1, s2)" 500 500 }, 501 501 … … 506 506 nspecies : 1, 507 507 section : "collisions", 508 formula : " %s1.getThomsonXsTotal()",508 formula : "return s1.getThomsonXsTotal()", 509 509 wikiLink : "Thomson_cross_section" 510 510 }, … … 516 516 nspecies : 0, 517 517 section : "spectroscopy", 518 formula : " this.plasma.r.getClassicalIonizationField()"518 formula : "return this.plasma.r.getClassicalIonizationField()" 519 519 }, 520 520 { … … 524 524 nspecies : 0, 525 525 section : "spectroscopy", 526 formula : " this.plasma.r.getInglisTellerField()",526 formula : "return this.plasma.r.getInglisTellerField()", 527 527 wikiLink : "Inglis-Teller_equation" 528 528 }, … … 533 533 nspecies : 0, 534 534 section : "collisions", 535 formula : " this.plasma.getDreicerField()"535 formula : "return this.plasma.getDreicerField()" 536 536 } 537 537 );
Note: See TracChangeset
for help on using the changeset viewer.