951 for (
int i = 1; i <
m_layer; i++)
953 m_layerT[i] = m_layerT[i - 1] + a * pow(
m_prog, i) *
m_bl;
958 cout <<
"First layer height " << m_layerT[0] << endl;
970 for (it =
m_mesh->m_vertexSet.begin(); it !=
m_mesh->m_vertexSet.end();
973 vector<pair<int, CADSurfSharedPtr> > ss = (*it)->GetCADSurfs();
974 vector<unsigned int> surfs;
975 for (
int i = 0; i < ss.size(); i++)
977 surfs.push_back(ss[i].first);
979 sort(surfs.begin(), surfs.end());
980 vector<unsigned int> inter, diff;
983 surfs.end(), back_inserter(inter));
984 set_symmetric_difference(inter.begin(), inter.end(), surfs.begin(),
985 surfs.end(), back_inserter(diff));
988 if (inter.size() > 0)
993 bln->stopped =
false;
1002 ASSERTL0(diff.size() <= 1,
"not setup for curve bl refinement");
1003 symSurfs.insert(diff[0]);
1004 bln->symsurf = diff[0];
1019 for (
int i = 0; i <
m_mesh->m_element[2].size(); i++)
1023 m_mesh->m_element[2][i]->m_parentCAD->GetId());
1031 vector<NodeSharedPtr> ns =
m_mesh->m_element[2][i]->GetVertexList();
1032 for (
int j = 0; j < ns.size(); j++)
1036 m_mesh->m_element[2][i]->m_parentCAD->GetId());
1044 bit->second->N =
GetNormal(bit->second->els);
1046 if (
Visability(bit->second->els, bit->second->N) < 0.0)
1048 cerr <<
"failed " << bit->first->m_x <<
" " << bit->first->m_y
1049 <<
" " << bit->first->m_z <<
" "
1050 <<
Visability(bit->second->els, bit->second->N) << endl;
1054 Array<OneD, NekDouble> loc = bit->first->GetLoc();
1055 for (
int k = 0; k < 3; k++)
1057 loc[k] += bit->second->N[k] * m_layerT[0];
1060 bit->second->pNode = boost::shared_ptr<Node>(
1061 new Node(
m_mesh->m_numNodes++, loc[0], loc[1], loc[2]));
1062 bit->second->bl = 0;
1065 m_symSurfs = vector<unsigned int>(symSurfs.begin(), symSurfs.end());
1071 if (!bit->second->onSym)
1076 Array<OneD, NekDouble> uv(2);
1077 Array<OneD, NekDouble> loc = bit->second->pNode->GetLoc();
1078 m_mesh->m_cad->GetSurf(bit->second->symsurf)->ProjectTo(loc, uv);
1080 Array<OneD, NekDouble> nl =
1081 m_mesh->m_cad->GetSurf(bit->second->symsurf)->P(uv);
1083 Array<OneD, NekDouble> N(3);
1084 N[0] = nl[0] - bit->first->m_x;
1085 N[1] = nl[1] - bit->first->m_y;
1086 N[2] = nl[2] - bit->first->m_z;
1088 NekDouble mag = sqrt(N[0] * N[0] + N[1] * N[1] + N[2] * N[2]);
1094 bit->second->AlignNode(m_layerT[0]);
1102 added.insert(bit->first->m_id);
1103 for (
int i = 0; i < bit->second->els.size(); i++)
1105 vector<NodeSharedPtr> ns = bit->second->els[i]->GetVertexList();
1106 for (
int j = 0; j < ns.size(); j++)
1109 if (t == added.end())
1117 for (
int l = 0; l < 10; l++)
1121 if (bit->first->GetNumCADSurf() > 1)
1126 Array<OneD, NekDouble> sumV(3, 0.0);
1127 vector<blInfoSharedPtr> data =
m_nToNInfo[bit->first];
1129 for (
int i = 0; i < data.size(); i++)
1131 NekDouble d = bit->first->Distance(data[i]->oNode);
1133 sumV[0] += data[i]->N[0] / d;
1134 sumV[1] += data[i]->N[1] / d;
1135 sumV[2] += data[i]->N[2] / d;
1141 sqrt(sumV[0] * sumV[0] + sumV[1] * sumV[1] + sumV[2] * sumV[2]);
1146 Array<OneD, NekDouble> N(3);
1148 N[0] = (1.0 - 0.8) * bit->second->N[0] + 0.8 * sumV[0];
1149 N[1] = (1.0 - 0.8) * bit->second->N[1] + 0.8 * sumV[1];
1150 N[2] = (1.0 - 0.8) * bit->second->N[2] + 0.8 * sumV[2];
1152 mag = sqrt(N[0] * N[0] + N[1] * N[1] + N[2] * N[2]);
1158 bit->second->AlignNode(m_layerT[0]);
1176 ASSERTL0(failed == 0,
"some normals failed to generate");
1180 Array<OneD, NekDouble> u1, v1, w1;
1183 LibUtilities::NodalUtilPrism nodalPrism(1, u1, v1, w1);
1185 NekMatrix<NekDouble> Vandermonde = *nodalPrism.GetVandermonde();
1186 NekMatrix<NekDouble> VandermondeI = Vandermonde;
1187 VandermondeI.Invert();
1189 m_deriv[0] = *nodalPrism.GetVandermondeForDeriv(0) * VandermondeI;
1190 m_deriv[1] = *nodalPrism.GetVandermondeForDeriv(1) * VandermondeI;
1191 m_deriv[2] = *nodalPrism.GetVandermondeForDeriv(2) * VandermondeI;
#define ASSERTL0(condition, msg)
Array< OneD, NekDouble > GetNormal(std::vector< ElementSharedPtr > tris)
std::vector< unsigned int > m_symSurfs
list of surfaces to be remeshed due to the boundary layer
MeshSharedPtr m_mesh
mesh object containing surface mesh
NekDouble Visability(std::vector< ElementSharedPtr > tris, Array< OneD, NekDouble > N)
Array< OneD, NekDouble > m_layerT
NekDouble m_bl
thickness of the boundary layer
std::map< NodeSharedPtr, blInfoSharedPtr > m_blData
data structure used to store and develop bl information
NekMatrix< NekDouble > m_deriv[3]
PointsManagerT & PointsManager(void)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
std::map< NodeSharedPtr, std::vector< blInfoSharedPtr > > m_nToNInfo
boost::shared_ptr< blInfo > blInfoSharedPtr
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
3D electrostatically spaced points on a Prism
std::vector< unsigned int > m_blsurfs
List of surfaces onto which boundary layers are placed.