44 using namespace Nektar;
46 int main(
int argc,
char *argv[])
50 cerr <<
"Usage: XmlToVtk meshfile" << endl;
55 "jacobian",
"j",
"Output Jacobian as scalar field");
60 bool jac = vSession->DefinesCmdLineArgument(
"jacobian");
63 string meshfile(argv[argc-1]);
71 for (it = emap.begin(); it != emap.end(); ++it)
73 for (
int i = 0; i < it->second->m_basisKeyVector.size(); ++i)
85 int expdim = graphShPt->GetMeshDimension();
86 Array<OneD, MultiRegions::ExpListSharedPtr> Exp(1);
100 if(vSession->DefinesSolverInfo(
"HOMOGENEOUS"))
102 std::string HomoStr = vSession->GetSolverInfo(
"HOMOGENEOUS");
106 HomoStr ==
"HOMOGENEOUS1D" || HomoStr ==
"Homogeneous1D" ||
107 HomoStr ==
"1D" || HomoStr ==
"Homo1D",
108 "Only 3DH1D supported for XML output currently.");
111 vSession->LoadParameter(
"HomModesZ", nplanes);
119 NekDouble lz = vSession->GetParameter(
"LZ");
123 vSession, Bkey, lz,
false,
false, graphShPt);
145 ASSERTL0(
false,
"Expansion dimension not recognised");
151 string outname(strtok(argv[argc-1],
"."));
153 ofstream outfile(outname.c_str());
155 Exp[0]->WriteVtkHeader(outfile);
160 Array<OneD, NekDouble> tmp;
161 Array<OneD, NekDouble> x0 (Exp[0]->GetNpoints());
162 Array<OneD, NekDouble> x1 (Exp[0]->GetNpoints());
163 Array<OneD, NekDouble> x2 (Exp[0]->GetNpoints());
164 Exp[0]->GetCoords(x0, x1, x2);
167 for(
int i = 0; i < Exp[0]->GetExpSize(); ++i)
172 unsigned int npts = e->GetTotPoints();
177 tmp = Exp[0]->UpdatePhys()
178 + Exp[0]->GetPhys_Offset(i), 1);
183 tmp = Exp[0]->UpdatePhys()
184 + Exp[0]->GetPhys_Offset(i), 1);
187 Exp[0]->WriteVtkPieceHeader(outfile, i);
188 Exp[0]->WriteVtkPieceData (outfile, i,
"Jac");
189 Exp[0]->WriteVtkPieceFooter(outfile, i);
193 =
Vmath::Imin(Exp[0]->GetNpoints(), Exp[0]->GetPhys(), 1);
194 cout <<
"- Minimum Jacobian: "
195 <<
Vmath::Vmin(Exp[0]->GetNpoints(), Exp[0]->GetPhys(), 1)
196 <<
" at coords (" << x0[n] <<
", " << x1[n] <<
", " << x2[n] <<
")"
203 for(
int i = 0; i < Exp[0]->GetExpSize(); ++i)
205 Exp[0]->WriteVtkPieceHeader(outfile, i);
206 Exp[0]->WriteVtkPieceFooter(outfile, i);
210 Exp[0]->WriteVtkFooter(outfile);