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

Enable $EPSILON for ST that is is consistent with BCs #120

Merged
merged 4 commits into from
Dec 14, 2018
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
26 changes: 20 additions & 6 deletions FEM/rf_st_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ CSourceTerm::CSourceTerm()
// display_mode = false; //OK
this->TimeInterpolation = 0; // BG
_isConstrainedST = false;
epsilon = -1;
}

// KR: Conversion from GUI-ST-object to CSourceTerm
Expand Down Expand Up @@ -321,6 +322,13 @@ std::ios::pos_type CSourceTerm::Read(std::ifstream* st_file, const GEOLIB::GEOOb
continue;
}

if (line_string.find("$EPSILON") != std::string::npos)
{
in.str(readNonBlankLineFromInputStream(*st_file));
in >> epsilon;
in.clear();
}

// 05.09.2008 WW
if (line_string.find("$DIS_TYPE") != std::string::npos)
{
Expand Down Expand Up @@ -3284,11 +3292,8 @@ void CSourceTermGroup::SetSFC(CSourceTerm* m_st, const int ShiftInNodeVector)
{
GEOLIB::Surface const& sfc(*(dynamic_cast<GEOLIB::Surface const*>(m_st->getGeoObj())));
std::cout << "Surface " << m_st->geo_name << ": " << sfc.getNTriangles() << "\n";
SetSurfaceNodeVector(&sfc, sfc_node_ids);
SetSurfaceNodeVector(&sfc, sfc_node_ids, m_st->epsilon);

/*
SetSurfaceNodeVector(m_sfc, sfc_nod_vector);
*/
sfc_nod_vector.insert(sfc_nod_vector.begin(), sfc_node_ids.begin(), sfc_node_ids.end());
if (m_st->isCoupled())
m_st->SetSurfaceNodeVectorConditional(sfc_nod_vector, sfc_nod_vector_cond);
Expand Down Expand Up @@ -3371,16 +3376,25 @@ void CSourceTerm::SetNOD()
11/2007 JOD
last modification:
**************************************************************************/
void CSourceTermGroup::SetSurfaceNodeVector(Surface* m_sfc, std::vector<long>& sfc_nod_vector)
void CSourceTermGroup::SetSurfaceNodeVector(Surface* m_sfc, std::vector<long>& sfc_nod_vector, const double epsilon)
{
double computed_search_length = m_msh->getSearchLength();
if (epsilon != -1)
m_msh->setSearchLength(epsilon);
const bool for_source = true;
m_msh->GetNODOnSFC(m_sfc, sfc_nod_vector, for_source);
m_msh->setSearchLength(computed_search_length);
}

void CSourceTermGroup::SetSurfaceNodeVector(GEOLIB::Surface const* sfc, std::vector<std::size_t>& sfc_nod_vector)
void CSourceTermGroup::SetSurfaceNodeVector(GEOLIB::Surface const* sfc, std::vector<std::size_t>& sfc_nod_vector, const double epsilon)
{
double computed_search_length = m_msh->getSearchLength();
if (epsilon != -1)
m_msh->setSearchLength(epsilon);
const bool for_source = true;
m_msh->GetNODOnSFC(sfc, sfc_nod_vector, for_source);
m_msh->setSearchLength(computed_search_length);

}

/**************************************************************************
Expand Down
5 changes: 3 additions & 2 deletions FEM/rf_st_new.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class CSourceTerm : public ProcessInfo, public GeoInfo, public DistributionInfo
void DeleteHistoryNodeMemory();

double geo_node_value;
double epsilon;

/**
* is the source term coupled with another source term
Expand Down Expand Up @@ -385,8 +386,8 @@ class CSourceTermGroup
std::vector<double>& ply_nod_val_vector) const;

// JOD
void SetSurfaceNodeVector(Surface* m_sfc, std::vector<long>& sfc_nod_vector);
void SetSurfaceNodeVector(GEOLIB::Surface const* sfc, std::vector<std::size_t>& sfc_nod_vector);
void SetSurfaceNodeVector(Surface* m_sfc, std::vector<long>& sfc_nod_vector, const double epsilon);
void SetSurfaceNodeVector(GEOLIB::Surface const* sfc, std::vector<std::size_t>& sfc_nod_vector, const double epsilon);
void SetSurfaceNodeValueVector(CSourceTerm* m_st,
Surface* m_sfc,
std::vector<long> const& sfc_nod_vector,
Expand Down