iLand
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Attributes | List of all members
CNPair Class Reference

CNPair stores a duple of carbon and nitrogen (kg/ha) use addBiomass(biomass, cnratio) to add biomass; use operators (+, +=, *, *=) for simple operations. More...

#include <snag.h>

Inheritance diagram for CNPair:
CNPool

Public Member Functions

 CNPair ()
 
 CNPair (const double c, const double n)
 
bool isEmpty () const
 returns true if pool is empty More...
 
bool isValid () const
 return true if pool is valid (content of C or N >=0) More...
 
double CN ()
 current CN ratio More...
 
void clear ()
 
double biomass () const
 retrieve the amount of biomass (kg/ha). Uses the global C-fraciton. Soil pools are in t/ha!!! More...
 
void addBiomass (const double biomass, const double CNratio)
 add biomass to the pool (kg dry mass/ha); CNratio is used to calculate the N-Content, the global C-Fraction of biomass is used to calculate the amount of carbon of 'biomass'. More...
 
void operator+= (const CNPair &s)
 add contents of a pool More...
 
void operator*= (const double factor)
 Multiply pool with 'factor'. More...
 
const CNPair operator+ (const CNPair &p2) const
 return the sum of two pools More...
 
const CNPair operator- (const CNPair &p2) const
 return the difference of two pools More...
 
const CNPair operator* (const double factor) const
 return the pool multiplied with 'factor' More...
 

Static Public Member Functions

static void setCFraction (const double fraction)
 set the global fraction of carbon of biomass More...
 

Public Attributes

double C
 
double N
 

Static Protected Attributes

static double biomassCFraction = biomassCFraction
 

Detailed Description

CNPair stores a duple of carbon and nitrogen (kg/ha) use addBiomass(biomass, cnratio) to add biomass; use operators (+, +=, *, *=) for simple operations.

Constructor & Destructor Documentation

◆ CNPair() [1/2]

CNPair::CNPair ( )
inline

◆ CNPair() [2/2]

CNPair::CNPair ( const double  c,
const double  n 
)
inline

Member Function Documentation

◆ addBiomass()

void CNPair::addBiomass ( const double  biomass,
const double  CNratio 
)
inline

add biomass to the pool (kg dry mass/ha); CNratio is used to calculate the N-Content, the global C-Fraction of biomass is used to calculate the amount of carbon of 'biomass'.

◆ biomass()

double CNPair::biomass ( ) const
inline

retrieve the amount of biomass (kg/ha). Uses the global C-fraciton. Soil pools are in t/ha!!!

◆ clear()

void CNPair::clear ( )
inline

◆ CN()

double CNPair::CN ( )
inline

current CN ratio

◆ isEmpty()

bool CNPair::isEmpty ( ) const
inline

returns true if pool is empty

◆ isValid()

bool CNPair::isValid ( ) const
inline

return true if pool is valid (content of C or N >=0)

◆ operator*()

const CNPair CNPair::operator* ( const double  factor) const
inline

return the pool multiplied with 'factor'

◆ operator*=()

void CNPair::operator*= ( const double  factor)
inline

Multiply pool with 'factor'.

◆ operator+()

const CNPair CNPair::operator+ ( const CNPair p2) const
inline

return the sum of two pools

◆ operator+=()

void CNPair::operator+= ( const CNPair s)
inline

add contents of a pool

◆ operator-()

const CNPair CNPair::operator- ( const CNPair p2) const
inline

return the difference of two pools

◆ setCFraction()

static void CNPair::setCFraction ( const double  fraction)
inlinestatic

set the global fraction of carbon of biomass

Member Data Documentation

◆ biomassCFraction

double CNPair::biomassCFraction = biomassCFraction
staticprotected

◆ C

double CNPair::C

◆ N

double CNPair::N

The documentation for this class was generated from the following files: