119 "ProcessDisplacement needs bnd parameter with a single id.");
121 string toFile =
m_config[
"to"].as<
string>();
125 cout <<
"ProcessDisplacement: you must provide a file" << endl;
129 bool useVertexIds =
m_config[
"usevertexids"].as<
bool>();
131 vector<string> files;
132 files.push_back(toFile);
139 int bndCondId =
m_config[
"bnd"].as<
int>();
143 if (bndGraph->GetMeshDimension() == 1)
145 m_f->m_exp.push_back(
m_f->AppendExpList(0,
"v"));
146 m_f->m_variables.push_back(
"v");
149 m_f->m_exp[0]->GetBndCondExpansions()[bndCondId];
151 m_f->m_exp[1]->GetBndCondExpansions()[bndCondId];
153 map<int, int> bndCondIds;
154 for (
int i = 0; i < bndCondExpU->GetExpSize(); ++i)
156 bndCondIds[bndCondExpU->GetExp(i)->GetGeom()->GetGlobalID()] = i;
161 auto mIt = bndCondIds.find(
id);
163 if (mIt == bndCondIds.end())
165 cout <<
"Warning: couldn't find element " <<
id << endl;
180 bndCondExpU->GetExp(e)->GetBasis(0)->GetBasisKey(), to);
182 const int offset = bndCondExpU->GetPhys_Offset(e);
183 const int nq = toSeg->GetTotPoints();
187 bndCondExpU->GetExp(e)->GetCoords(xC, yC);
188 toSeg->GetCoords(xL, yL);
191 tmp = bndCondExpU->UpdatePhys() + offset, 1);
193 tmp = bndCondExpV->UpdatePhys() + offset, 1);
197 bndCondExpU->FwdTransBndConstrained(bndCondExpU->GetPhys(),
198 bndCondExpU->UpdateCoeffs());
199 bndCondExpV->FwdTransBndConstrained(bndCondExpV->GetPhys(),
200 bndCondExpV->UpdateCoeffs());
202 else if (bndGraph->GetMeshDimension() == 2)
204 m_f->m_exp.push_back(
m_f->AppendExpList(0,
"v"));
205 m_f->m_exp.push_back(
m_f->AppendExpList(0,
"w"));
206 m_f->m_variables.push_back(
"v");
207 m_f->m_variables.push_back(
"w");
210 m_f->m_exp[0]->GetBndCondExpansions()[bndCondId];
212 m_f->m_exp[1]->GetBndCondExpansions()[bndCondId];
214 m_f->m_exp[2]->GetBndCondExpansions()[bndCondId];
216 map<int, int> bndCondIds;
217 for (
int i = 0; i < bndCondExpU->GetExpSize(); ++i)
219 bndCondIds[bndCondExpU->GetExp(i)->GetGeom()->GetGlobalID()] = i;
226 for (
int i = 0; i < bndCondExpU->GetExpSize(); ++i)
230 bndCondExpU->GetExp(i)->GetGeom());
233 vertexFaceMap[t] = i;
243 TriFaceIDs t(tri->GetVid(0), tri->GetVid(1), tri->GetVid(2));
245 auto tIt = vertexFaceMap.find(t);
246 e = tIt == vertexFaceMap.end() ? -1 : tIt->second;
250 auto mIt = bndCondIds.find(
id);
251 e = mIt == bndCondIds.end() ? -1 : mIt->second;
256 cout <<
"Warning: couldn't find element " <<
id << endl;
269 bndCondExpU->GetExp(e)->GetBasis(0)->GetBasisKey(),
270 bndCondExpV->GetExp(e)->GetBasis(1)->GetBasisKey(), to);
272 const int offset = bndCondExpU->GetPhys_Offset(e);
273 const int nq = toSeg->GetTotPoints();
278 bndCondExpU->GetExp(e)->GetCoords(xC, yC, zC);
279 toSeg->GetCoords(xL, yL, zL);
282 tmp = bndCondExpU->UpdatePhys() + offset, 1);
284 tmp = bndCondExpV->UpdatePhys() + offset, 1);
286 tmp = bndCondExpW->UpdatePhys() + offset, 1);
290 bndCondExpU->FwdTransBndConstrained(bndCondExpU->GetPhys(),
291 bndCondExpU->UpdateCoeffs());
292 bndCondExpV->FwdTransBndConstrained(bndCondExpV->GetPhys(),
293 bndCondExpV->UpdateCoeffs());
294 bndCondExpW->FwdTransBndConstrained(bndCondExpW->GetPhys(),
295 bndCondExpW->UpdateCoeffs());
int GetVid(int i) const
Returns global id of vertex i of this object.
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true, SpatialDomains::MeshGraphSharedPtr partitionedGraph=nullptr)
std::shared_ptr< MeshGraph > MeshGraphSharedPtr