Go to the documentation of this file.
46 for (
const auto& band: lines) {
47 for (
Index k=0; k<band.NumLines() and (global ? (k==0) :
false); k++) {
52 auto x = band.QuantumIdentityOfLine(k);
53 lower =
x.LowerQuantumId();
54 upper =
x.UpperQuantumId();
62 bool inlower =
false, inupper =
false;
63 for (
Index i = 0; i < n; i++) {
64 if (not inlower and canbeinlower)
65 if (qid[i] == lower) inlower =
true;
66 if (not inupper and canbeinupper)
67 if (qid[i] == upper) inupper =
true;
71 if (not inlower and canbeinlower) qid.push_back(lower);
72 if (not inupper and canbeinupper)
73 if (not(lower == upper)) qid.push_back(upper);
111 const Numeric& convergence_limit,
114 const Index& dampened,
115 const Index& iteration_limit,
120 if (not
nlte_do)
throw std::runtime_error(
"Must be set to do NLTE");
122 throw std::runtime_error(
"Error in NLTE field, it is empty");
129 throw std::runtime_error(
"Must have more than a four levels");
132 throw std::runtime_error(
"Only for 1D atmosphere");
136 throw std::runtime_error(
137 "Bad number of lines... overlapping lines in nlte_level_identifiers?");
151 Matrix SEE(nlevels, nlevels, 0.0);
152 Vector r(nlevels, 0.0),
x(nlevels, 0.0);
153 Numeric max_change = convergence_limit + 1;
156 while (i < iteration_limit and max_change > convergence_limit) {
186 for (
Index ip = 0; ip < np; ip++) {
227 for (
Index il = 0; il < nlevels; il++) {
235 if (i < iteration_limit)
236 out2 <<
"Converged NLTE ratios (within convergence_limit) returned after "
237 << i <<
" iterations\n";
240 <<
"No convergence of NLTE ratios (within convergence_limit) returned even after "
241 << iteration_limit <<
" iterations\n";
252 String tmp_basename = basename, filename;
253 if (basename.length() && basename[basename.length() - 1] !=
'/')
257 filename = tmp_basename +
"qid.xml";
270 filename = tmp_basename +
abs_species[i][0].SpeciesNameMain() +
".xml";
272 if (aogf1.
nelem() not_eq n)
273 throw std::runtime_error(
274 "Mismatch between collision_line_identifiers and some collision_coefficients");
ArrayOfArrayOfGriddedField1 collision_coefficients(Workspace &ws) noexcept
Index atmosphere_dim(Workspace &ws) noexcept
void check_collision_line_identifiers(const ArrayOfQuantumIdentifier &collision_line_identifiers)
Checks that a WSV is OK or throws a run-time error.
Tensor3 z_field(Workspace &ws) noexcept
void nlte_collision_factorsCalcFromCoeffs(Vector &Cij, Vector &Cji, const ArrayOfArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfGriddedField1 &collision_coefficients, const ArrayOfQuantumIdentifier &collision_line_identifiers, const SpeciesAuxData &isotopologue_ratios, const ConstVectorView vmr, const Numeric &T, const Numeric &P)
Gets collisional factors from coefficients.
Class to identify and match lines by their quantum numbers.
Agenda iy_cloudbox_agenda(Workspace &ws) noexcept
Declarations required for the calculation of absorption coefficients.
constexpr QuantumIdentifier UpperQuantumId() const noexcept
Return a quantum identifer as if it wants to match to upper energy level.
bool any_quantumnumbers() const
Check if there are any quantum numbers defined.
Index find_first_unique_in_lower(const ArrayOfIndex &upper, const ArrayOfIndex &lower) noexcept
Finds a unique lower state if one exists or returns index to last element.
Verbosity verbosity(Workspace &ws) noexcept
ArrayOfQuantumIdentifier nlte_level_identifiers(Workspace &ws) noexcept
ArrayOfArrayOfAbsorptionLines abs_lines_per_species(Workspace &ws) noexcept
Matrix line_irradiance(Workspace &ws) noexcept
void nlteOff(Index &nlte_do, EnergyLevelMap &nlte_field, ArrayOfQuantumIdentifier &nlte_level_identifiers, const Verbosity &)
WORKSPACE METHOD: nlteOff.
ArrayOfQuantumIdentifier collision_line_identifiers(Workspace &ws) noexcept
Agenda iy_space_agenda(Workspace &ws) noexcept
Auxiliary data for isotopologues.
Vector createBji(const Vector &Bij, const ArrayOfArrayOfAbsorptionLines &abs_lines)
Create a Bji object.
Vector createBij(const ArrayOfArrayOfAbsorptionLines &abs_lines)
Create a Bij object.
EnergyLevelMap nlte_field(Workspace &ws) noexcept
void line_irradianceCalcForSingleSpeciesNonOverlappingLinesPseudo2D(Workspace &ws, Matrix &line_irradiance, Tensor3 &line_transmission, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const Tensor3 &t_field, const Tensor3 &z_field, const Vector &p_grid, const Vector &refellipsoid, const Tensor3 &surface_props_data, const Agenda &ppath_agenda, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Agenda &propmat_clearsky_agenda, const Numeric &df, const Index &nz, const Index &nf, const Numeric &r, const Verbosity &verbosity)
WORKSPACE METHOD: line_irradianceCalcForSingleSpeciesNonOverlappingLinesPseudo2D.
Index nelem(const Lines &l)
Number of lines.
void ArrayOfQuantumIdentifierFromLines(ArrayOfQuantumIdentifier &qid, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Index &global, const Verbosity &)
WORKSPACE METHOD: ArrayOfQuantumIdentifierFromLines.
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
Vector createAij(const ArrayOfArrayOfAbsorptionLines &abs_lines)
Create a Aij object.
Tensor4 vmr_field(Workspace &ws) noexcept
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Vector p_grid(Workspace &ws) noexcept
Tensor3 surface_props_data(Workspace &ws) noexcept
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
constexpr QuantumIdentifier LowerQuantumId() const noexcept
Return a quantum identifer as if it wants to match to lower energy level.
Vector refellipsoid(Workspace &ws) noexcept
Tensor3 line_transmission(Workspace &ws) noexcept
Agenda iy_surface_agenda(Workspace &ws) noexcept
Index nlte_do(Workspace &ws) noexcept
Agenda ppath_agenda(Workspace &ws) noexcept
void nlte_positions_in_statistical_equilibrium_matrix(ArrayOfIndex &upper, ArrayOfIndex &lower, const ArrayOfArrayOfAbsorptionLines &abs_lines, const EnergyLevelMap &nlte_field)
Finds upper and lower states in SEE Matrix.
Agenda iy_main_agenda(Workspace &ws) noexcept
Deep calculations for NLTE.
void set_constant_statistical_equilibrium_matrix(MatrixView A, VectorView x, const Numeric &sem_ratio, const Index row)
Set a row of the SEE matrix and level distribution vector to constant.
Tensor3 t_field(Workspace &ws) noexcept
void statistical_equilibrium_equation(MatrixView A, ConstVectorView Aij, ConstVectorView Bij, ConstVectorView Bji, ConstVectorView Cij, ConstVectorView Cji, ConstVectorView Jij, const ArrayOfIndex &upper, const ArrayOfIndex &lower)
Sets up the solution matrix for linear statistical equilibrium equation.
SpeciesAuxData isotopologue_ratios(Workspace &ws) noexcept
Agenda propmat_clearsky_agenda(Workspace &ws) noexcept
EnergyLevelMap EnergyLevelMap
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
Index nelem() const
Number of elements.
void nlte_fieldForSingleSpeciesNonOverlappingLines(Workspace &ws, EnergyLevelMap &nlte_field, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfGriddedField1 &collision_coefficients, const ArrayOfQuantumIdentifier &collision_line_identifiers, const SpeciesAuxData &isotopologue_ratios, const Agenda &iy_main_agenda, const Agenda &ppath_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &, const Tensor4 &vmr_field, const Tensor3 &t_field, const Tensor3 &z_field, const Vector &p_grid, const Index &atmosphere_dim, const Vector &refellipsoid, const Tensor3 &surface_props_data, const Index &nlte_do, const Numeric &df, const Numeric &convergence_limit, const Index &nz, const Index &nf, const Index &dampened, const Index &iteration_limit, const Verbosity &verbosity)
WORKSPACE METHOD: nlte_fieldForSingleSpeciesNonOverlappingLines.
void collision_coefficientsFromSplitFiles(ArrayOfArrayOfGriddedField1 &collision_coefficients, ArrayOfQuantumIdentifier &collision_line_identifiers, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: collision_coefficientsFromSplitFiles.
void nlte_fieldRescalePopulationLevels(EnergyLevelMap &nlte_field, const Numeric &scale, const Verbosity &)
WORKSPACE METHOD: nlte_fieldRescalePopulationLevels.
The global header file for ARTS.
void dampened_statistical_equilibrium_equation(MatrixView A, ConstVectorView x, ConstVectorView Aij, ConstVectorView Bij, ConstVectorView Bji, ConstVectorView Cij, ConstVectorView Cji, ConstVectorView Jij, ConstVectorView Lambda, const ArrayOfIndex &upper, const ArrayOfIndex &lower, const Numeric &total_number_count)
Sets up the solution matrix for linear dampened statistical equilibrium equation.
void solve(VectorView w, const CovarianceMatrix &A, ConstVectorView v)