Skip to content

Commit

Permalink
Merge pull request #107 from Thomas-TK/debug_master
Browse files Browse the repository at this point in the history
$EPSILON in the bc-file can replace the automatically calculated search length
  • Loading branch information
norihiro-w authored Aug 21, 2018
2 parents fe05142 + 0d0a179 commit b29d826
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions FEM/rf_bc_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ CBoundaryCondition::CBoundaryCondition() : GeoInfo(), geo_name(""), _curve_index
// FCT
conditional = false;
time_dep_interpol = false;
epsilon = 1e-9; // NW
epsilon = -1; // NW
time_contr_curve = -1; // WX
bcExcav = -1; // WX
MatGr = -1; // WX
Expand Down Expand Up @@ -1378,7 +1378,12 @@ void CBoundaryConditionsGroup::Set(CRFProcess* pcs, int ShiftInNodeVector, const
// debug_out.close();
//#endif
std::vector<size_t> msh_nod_vec;
double computed_search_length = m_msh->getSearchLength();
if (bc->epsilon != -1)
m_msh->setSearchLength(bc->epsilon);
m_msh->GetNODOnSFC(sfc, msh_nod_vec);
m_msh->setSearchLength(computed_search_length);

#ifndef NDEBUG
#ifdef DEBUGMESHNODESEARCH
{
Expand Down Expand Up @@ -1797,8 +1802,10 @@ void CBoundaryCondition::SurfaceInterpolation(CRFProcess* m_pcs,
// Interpolation of polygon values to nodes_on_sfc
int nPointsPly = 0;
double Area1, Area2;
double Tol = 1e-9;
// NW. Default tolerance is 1e-9 but it can be changed in a BC file.
double Tol = this->epsilon;
if (this->epsilon != -1)
Tol = this->epsilon;
bool Passed;
double gC[3], p1[3], p2[3], vn[3], unit[3], NTri[3];
//
Expand Down
7 changes: 4 additions & 3 deletions MSH/msh_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ void CFEMesh::ConstructGrid()

// computeSearchLength();
computeMinEdgeLength();
setSearchLength(_min_edge_length / 2);
setSearchLength(0.375 * _min_edge_length / 2);
constructMeshGrid();
}

Expand Down Expand Up @@ -1738,9 +1738,10 @@ void CFEMesh::GetNODOnSFC(const GEOLIB::Surface* sfc,
const size_t nodes_in_usage((size_t)NodesInUsage());
for (size_t j(0); j < nodes_in_usage; j++)
{
if (sfc->isPntInBV((nod_vector[j])->getData(), _search_length * 0.375))
// Multiplicator * 0.375 should only be used if _search_length was calculated automatically.
if (sfc->isPntInBV((nod_vector[j])->getData(), _search_length))
{
if (sfc->isPntInSfc((nod_vector[j])->getData(), _search_length * 0.375))
if (sfc->isPntInSfc((nod_vector[j])->getData(), _search_length))
{
msh_nod_vector.push_back(nod_vector[j]->GetIndex());
}
Expand Down

0 comments on commit b29d826

Please sign in to comment.