[cantera]: adding patch that adds support for two methods in C++ to fortran, both getMixDiffCoeffs{Mass,Mole}

This commit is contained in:
Nicholas Malaya 2012-06-15 18:53:39 +00:00
parent 724baced8b
commit f353fcbc16
5 changed files with 62 additions and 0 deletions

View file

@ -740,6 +740,16 @@ public:
}
//! Returns a vector of mixture averaged diffusion coefficients
virtual void getMixDiffCoeffsMole(doublereal* const d) {
err("getMixDiffCoeffsMole");
}
//! Returns a vector of mixture averaged diffusion coefficients
virtual void getMixDiffCoeffsMass(doublereal* const d) {
err("getMixDiffCoeffsMass");
}
//! Set model parameters for derived classes
/*!
* This method may be derived in subclasses to set model-specific parameters.

View file

@ -149,6 +149,14 @@ MODULE CANTERA
MODULE PROCEDURE ctrans_getMixDiffCoeffs
END INTERFACE getMixDiffCoeffs
INTERFACE getMixDiffCoeffsMole
MODULE PROCEDURE ctrans_getMixDiffCoeffsMole
END INTERFACE getMixDiffCoeffsMole
INTERFACE getMixDiffCoeffsMass
MODULE PROCEDURE ctrans_getMixDiffCoeffsMass
END INTERFACE getMixDiffCoeffsMass
INTERFACE getMoleFractions
MODULE PROCEDURE ctthermo_getMoleFractions
END INTERFACE getMoleFractions

View file

@ -46,6 +46,20 @@ contains
self%err = trans_getMixDiffCoeffs(self%tran_id, d)
end subroutine ctrans_getMixDiffCoeffs
subroutine ctrans_getMixDiffCoeffsMass(self, d)
implicit none
type(phase_t), intent(inout) :: self
double precision, intent(out) :: d(*)
self%err = trans_getMixDiffCoeffsMass(self%tran_id, d)
end subroutine ctrans_getMixDiffCoeffsMass
subroutine ctrans_getMixDiffCoeffsMole(self, d)
implicit none
type(phase_t), intent(inout) :: self
double precision, intent(out) :: d(*)
self%err = trans_getMixDiffCoeffsMole(self%tran_id, d)
end subroutine ctrans_getMixDiffCoeffsMole
subroutine ctrans_getBinDiffCoeffs(self, ld, d)
implicit none
type(phase_t), intent(inout) :: self

View file

@ -965,6 +965,26 @@ extern "C" {
}
}
status_t trans_getmixdiffcoeffsmass_(const integer* n, doublereal* d)
{
try {
_ftrans(n)->getMixDiffCoeffsMass(d);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}
status_t trans_getmixdiffcoeffsmole_(const integer* n, doublereal* d)
{
try {
_ftrans(n)->getMixDiffCoeffsMole(d);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}
status_t trans_getbindiffcoeffs_(const integer* n, integer* ld, doublereal* d)
{
try {

View file

@ -393,6 +393,16 @@ interface
double precision, intent(out) :: d(*)
end function trans_getMixDiffCoeffs
integer function trans_getMixDiffCoeffsMass(n, d)
integer, intent(in) :: n
double precision, intent(out) :: d(*)
end function trans_getMixDiffCoeffsMass
integer function trans_getMixDiffCoeffsMole(n, d)
integer, intent(in) :: n
double precision, intent(out) :: d(*)
end function trans_getMixDiffCoeffsMole
integer function trans_getBinDiffCoeffs(n, ld, d)
integer, intent(in) :: n
integer, intent(in) :: ld