get correct mesh direction names for dump
This commit is contained in:
parent
d81576cedd
commit
5535a386ff
@ -102,6 +102,14 @@ unsigned int Operator::CalcNyquistNum(double fmax)
|
|||||||
return floor(T0/2/dT);
|
return floor(T0/2/dT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Operator::GetDirName(int ny) const
|
||||||
|
{
|
||||||
|
if (ny==0) return "x";
|
||||||
|
if (ny==1) return "y";
|
||||||
|
if (ny==2) return "z";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
double Operator::GetMeshDelta(int n, const unsigned int* pos, bool dualMesh) const
|
double Operator::GetMeshDelta(int n, const unsigned int* pos, bool dualMesh) const
|
||||||
{
|
{
|
||||||
if ((n<0) || (n>2)) return 0.0;
|
if ((n<0) || (n>2)) return 0.0;
|
||||||
|
@ -67,6 +67,9 @@ public:
|
|||||||
void DumpOperator2File(string filename);
|
void DumpOperator2File(string filename);
|
||||||
void DumpMaterial2File(string filename);
|
void DumpMaterial2File(string filename);
|
||||||
|
|
||||||
|
//! Get the name for the given direction: 0 -> x, 1 -> y, 2 -> z
|
||||||
|
virtual string GetDirName(int ny) const;
|
||||||
|
|
||||||
virtual double GetGridDelta() const {return gridDelta;}
|
virtual double GetGridDelta() const {return gridDelta;}
|
||||||
//! Get the mesh delta times the grid delta for a 3D position
|
//! Get the mesh delta times the grid delta for a 3D position
|
||||||
virtual double GetMeshDelta(int n, const int* pos, bool dualMesh=false) const;
|
virtual double GetMeshDelta(int n, const int* pos, bool dualMesh=false) const;
|
||||||
|
@ -68,6 +68,14 @@ inline unsigned int Operator_Cylinder::GetNumberOfLines(int ny) const
|
|||||||
return numLines[ny];
|
return numLines[ny];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Operator_Cylinder::GetDirName(int ny) const
|
||||||
|
{
|
||||||
|
if (ny==0) return "rho";
|
||||||
|
if (ny==1) return "alpha";
|
||||||
|
if (ny==2) return "z";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
double Operator_Cylinder::GetMeshDelta(int n, int* pos, bool dualMesh) const
|
double Operator_Cylinder::GetMeshDelta(int n, int* pos, bool dualMesh) const
|
||||||
{
|
{
|
||||||
double delta = Operator::GetMeshDelta(n,pos,dualMesh);
|
double delta = Operator::GetMeshDelta(n,pos,dualMesh);
|
||||||
|
@ -35,6 +35,9 @@ public:
|
|||||||
|
|
||||||
virtual unsigned int GetNumberOfLines(int ny) const;
|
virtual unsigned int GetNumberOfLines(int ny) const;
|
||||||
|
|
||||||
|
//! Get the name for the given direction: 0 -> rho, 1 -> alpha, 2 -> z
|
||||||
|
virtual string GetDirName(int ny) const;
|
||||||
|
|
||||||
//! Get the mesh delta times the grid delta for a 3D position, including radius corrected alpha-mesh width
|
//! Get the mesh delta times the grid delta for a 3D position, including radius corrected alpha-mesh width
|
||||||
virtual double GetMeshDelta(int n, int* pos, bool dualMesh=false) const;
|
virtual double GetMeshDelta(int n, int* pos, bool dualMesh=false) const;
|
||||||
|
|
||||||
|
@ -51,7 +51,8 @@ ProcessFields::~ProcessFields()
|
|||||||
void ProcessFields::InitProcess()
|
void ProcessFields::InitProcess()
|
||||||
{
|
{
|
||||||
if (Enabled==false) return;
|
if (Enabled==false) return;
|
||||||
string names[] = {"x","y","z"};
|
//get the correct direction names for all coordinate systems
|
||||||
|
string names[] = {Op->GetDirName(0),Op->GetDirName(1),Op->GetDirName(2)};
|
||||||
if (m_fileType==HDF5_FILETYPE)
|
if (m_fileType==HDF5_FILETYPE)
|
||||||
{
|
{
|
||||||
unsigned int* NrLines;
|
unsigned int* NrLines;
|
||||||
|
@ -11,7 +11,11 @@ end
|
|||||||
mesh = ReadHDF5Mesh(file);
|
mesh = ReadHDF5Mesh(file);
|
||||||
fields = ReadHDF5FieldData(file);
|
fields = ReadHDF5FieldData(file);
|
||||||
|
|
||||||
[X Y Z] = meshgrid(double(mesh.lines{1}),double(mesh.lines{2}),double(mesh.lines{3}));
|
if (mesh.type==0)
|
||||||
|
[X Y Z] = meshgrid(double(mesh.lines{1}),double(mesh.lines{2}),double(mesh.lines{3}));
|
||||||
|
else
|
||||||
|
disp(['PlotHDF5FieldData:: Error: unknown mesh type ' num2str(mesh.type)]);
|
||||||
|
end
|
||||||
|
|
||||||
max_amp = 0;
|
max_amp = 0;
|
||||||
|
|
||||||
|
@ -13,4 +13,10 @@ end
|
|||||||
hdf_mesh.names = names;
|
hdf_mesh.names = names;
|
||||||
for n=1:numel(names)
|
for n=1:numel(names)
|
||||||
hdf_mesh.lines{n} = hdf5read(file,names{n});
|
hdf_mesh.lines{n} = hdf5read(file,names{n});
|
||||||
|
end
|
||||||
|
|
||||||
|
if (strcmp(names{1},'/mesh/rho'))
|
||||||
|
hdf_mesh.type=1;
|
||||||
|
else
|
||||||
|
hdf_mesh.type=0;
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user