Skip to content

Commit

Permalink
Merge pull request #41 from wenqing/fix_DIRECT_mass
Browse files Browse the repository at this point in the history
Fixed a bug in applying DIRECT bc and st for mass transport
  • Loading branch information
norihiro-w authored Jun 23, 2016
2 parents 2370dcd + d11bd30 commit 31b0a80
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
7 changes: 2 additions & 5 deletions FEM/rf_bc_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,17 +888,14 @@ void BCWrite(std::string const& base_file_name)
GeoSys source term function:
02/2009 WW Implementation
**************************************************************************/
inline void CBoundaryCondition::DirectAssign(long ShiftInNodeVector)
inline void CBoundaryCondition::DirectAssign(CRFProcess* m_pcs, long ShiftInNodeVector)
{
std::string line_string;
std::stringstream in;
long n_index;
double n_val;
CRFProcess* m_pcs = NULL;
CBoundaryConditionNode* m_node_value = NULL;

m_pcs = PCSGet(convertProcessTypeToString(this->getProcessType()));

//========================================================================
// File handling
std::ifstream d_file(fname.c_str(), std::ios::in);
Expand Down Expand Up @@ -1142,7 +1139,7 @@ void CBoundaryConditionsGroup::Set(CRFProcess* pcs, int ShiftInNodeVector, const
//-- 23.02.3009. WW
if (bc->getProcessDistributionType() == FiniteElement::DIRECT)
{
bc->DirectAssign(ShiftInNodeVector);
bc->DirectAssign(pcs, ShiftInNodeVector);
++p_bc;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion FEM/rf_bc_new.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class CBoundaryCondition : public ProcessInfo, public GeoInfo, public Distributi
void SurfaceInterpolation(CRFProcess* m_pcs,
std::vector<long>& nodes_on_sfc,
std::vector<double>& node_value_vector);
inline void DirectAssign(long ShiftInNodeVector);
inline void DirectAssign(CRFProcess* m_pcs, long ShiftInNodeVector);
// 19.03.2009. WW
inline void PatchAssign(long ShiftInNodeVector);

Expand Down
8 changes: 3 additions & 5 deletions FEM/rf_st_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,13 +1130,13 @@ void CSourceTermGroup::Set(CRFProcess* m_pcs, const int ShiftInNodeVector, std::
|| source_term->getProcessDistributionType() == FiniteElement::CLIMATE)
{ // NB For climate ST, the source terms (recharge in this case) will also be assigned directly to surface
// nodes
source_term->DirectAssign(ShiftInNodeVector);
source_term->DirectAssign(m_pcs, ShiftInNodeVector);
continue;
}

if (source_term->getProcessDistributionType() == FiniteElement::RECHARGE_DIRECT)
{
source_term->DirectAssign(ShiftInNodeVector);
source_term->DirectAssign(m_pcs, ShiftInNodeVector);
set = true;
}

Expand Down Expand Up @@ -4116,10 +4116,8 @@ void CSourceTerm::SetNOD2MSHNOD(const std::vector<size_t>& nodes, std::vector<si
GeoSys source term function:
02/2009 WW Implementation
**************************************************************************/
void CSourceTerm::DirectAssign(long ShiftInNodeVector)
void CSourceTerm::DirectAssign(CRFProcess* m_pcs, long ShiftInNodeVector)
{
CRFProcess* m_pcs = PCSGet(convertProcessTypeToString(getProcessType()));

if (getProcessDistributionType() == FiniteElement::CLIMATE) // NB for this type of ST, we assign a ST to each node
// on the Mesh surface (land surface)
{
Expand Down
2 changes: 1 addition & 1 deletion FEM/rf_st_new.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CSourceTerm : public ProcessInfo, public GeoInfo, public DistributionInfo
void SetNOD();

// 23.02.2009. WW
void DirectAssign(const long ShiftInNodeVector);
void DirectAssign(CRFProcess* m_pcs, const long ShiftInNodeVector);

// KR / NB

Expand Down

0 comments on commit 31b0a80

Please sign in to comment.