Memosa-FVM  0.2
PhononMacro.cpp
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #include "PhononMacro.h"
6 
7 PhononMacro::PhononMacro(const std::string baseName) :
8  temperature(baseName + ".temperature"),
9  deltaT(baseName + ".deltaT"),
10  e0(baseName + ".e0"),
11  TlResidual(baseName + "TlResidual"),
12  TlInjected(baseName + "TlInjected"),
13  TlFASCorrection(baseName + "TlFASCorrection"),
14  heatFlux(baseName + ".heatFlux"),
15  lam(baseName + ".lam"),
16  BranchTemperatures(),
17  BranchFlux(),
18  BandTemperatures(),
19  BandRelEnergy(),
20  BandFlux(),
21  CellColors(),
22  zero(baseName + "zero"),
23  one(baseName + "one")
24 {}
25 
26 Field& PhononMacro::getModeTemp(int mesh, int mode)
27 {
28  FieldVectorMap::iterator it;
29  it=BranchTemperatures.find(mesh);
30  if(it!=BranchTemperatures.end())
31  {
32  FieldVector& FieldVec=*(it->second);
33  if(mode<FieldVec.size())
34  return *FieldVec[mode];
35  else
36  throw CException("Don't have Field for that mode!");
37  }
38  throw CException("Don't have FieldVector for that mesh!");
39 }
40 
41 Field& PhononMacro::getModeFlux(int mesh, int mode)
42 {
43  FieldVectorMap::iterator it;
44  it=BranchFlux.find(mesh);
45  if(it!=BranchFlux.end())
46  {
47  FieldVector& FieldVec=*(it->second);
48  if(mode<FieldVec.size())
49  return *FieldVec[mode];
50  else
51  throw CException("Don't have Field for that mode!");
52  }
53  throw CException("Don't have FieldVector for that mesh!");
54 }
55 
56 Field& PhononMacro::getBandTemp(int mesh, int band)
57 {
58  FieldVectorMap::iterator it;
59  it=BandTemperatures.find(mesh);
60  if(it!=BranchTemperatures.end())
61  {
62  FieldVector& FieldVec=*(it->second);
63  if(band<FieldVec.size())
64  return *FieldVec[band];
65  else
66  throw CException("Band Temp: Don't have Field for that mode!");
67  }
68  throw CException("Band Temp: Don't have FieldVector for that mesh!");
69 }
70 
72 {
73  FieldVectorMap::iterator it;
74  it=BandRelEnergy.find(mesh);
75  if(it!=BandRelEnergy.end())
76  {
77  FieldVector& FieldVec=*(it->second);
78  if(band<FieldVec.size())
79  return *FieldVec[band];
80  else
81  throw CException("Band Relative Energy: Don't have Field for that mode!");
82  }
83  throw CException("Band Relative Energy: Don't have FieldVector for that mesh!");
84 }
85 
86 Field& PhononMacro::getBandFlux(int mesh, int band)
87 {
88  FieldVectorMap::iterator it;
89  it=BandFlux.find(mesh);
90  if(it!=BandFlux.end())
91  {
92  FieldVector& FieldVec=*(it->second);
93  if(band<FieldVec.size())
94  return *FieldVec[band];
95  else
96  throw CException("Band Flux: Don't have Field for that mode!");
97  }
98  throw CException("Band Flux: Don't have FieldVector for that mesh!");
99 }
100 
102 {return *CellColors[level];}
103 
105 {return *plottingCellColors[level];}
Field & getModeFlux(int mesh, int mode)
Definition: PhononMacro.cpp:41
Field & getBandTemp(int mesh, int band)
Definition: PhononMacro.cpp:56
Definition: Field.h:14
vector< FieldPtr > FieldVector
Definition: PhononMacro.h:16
Field & getBandRelEnergy(int mesh, int band)
Definition: PhononMacro.cpp:71
Field & getBandFlux(int mesh, int band)
Definition: PhononMacro.cpp:86
Field & getModeTemp(int mesh, int mode)
Definition: PhononMacro.cpp:26
FieldVector CellColors
Definition: PhononMacro.h:34
FieldVectorMap BandRelEnergy
Definition: PhononMacro.h:32
FieldVector plottingCellColors
Definition: PhononMacro.h:35
FieldVectorMap BandTemperatures
Definition: PhononMacro.h:31
FieldVectorMap BranchFlux
Definition: PhononMacro.h:30
FieldVectorMap BranchTemperatures
Definition: PhononMacro.h:29
FieldVectorMap BandFlux
Definition: PhononMacro.h:33
Field & getColorField(int level)
PhononMacro(const string baseName)
Definition: PhononMacro.cpp:7
Field & getPlotColorField(int level)