Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug in applying DIRECT bc and st for mass transport #41

Merged
merged 1 commit into from
Jun 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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