Skip to content

Commit

Permalink
IO: Fixed Issues in IO_Image_Read
Browse files Browse the repository at this point in the history
  • Loading branch information
M. Sallermann authored and M. Sallermann committed Aug 19, 2021
1 parent 185eda5 commit 8d72540
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions core/src/Spirit/IO.cpp
Expand Up @@ -261,22 +261,21 @@ try
{
Log( Utility::Log_Level::Warning, Utility::Log_Sender::API, fmt::format(
"OVF file \"{}\": segment {}/{}. `n_cells` from ovf file ({},{},{}) is different from previous value ({},{},{}).",
filename, idx_image_infile+1, file.n_segments, segment.N, image->nos, segment.n_cells[0], segment.n_cells[1], segment.n_cells[2], geometry.n_cells[0], geometry.n_cells[1], geometry.n_cells[2]),
filename, idx_image_infile+1, file.n_segments, segment.n_cells[0], segment.n_cells[1], segment.n_cells[2], geometry.n_cells[0], geometry.n_cells[1], geometry.n_cells[2]),
idx_image_inchain, idx_chain );
}

bool different_n_cell_atoms = false;
if(segment.ncellpoints != geometry.n_cell_atoms)
{
different_n_cell_atoms = true;
// geometry.n_cell_atoms = segment.ncellpoints;
}

if(different_n_cell_atoms)
{
Log( Utility::Log_Level::Warning, Utility::Log_Sender::API, fmt::format(
"OVF file \"{}\": segment {}/{}. `n_cell_atoms` from ovf file ({}) is different from previous value ({}).",
filename, idx_image_infile+1, file.n_segments, segment.N, image->nos, segment.ncellpoints, geometry.n_cell_atoms),
filename, idx_image_infile+1, file.n_segments, segment.ncellpoints, geometry.n_cell_atoms),
idx_image_inchain, idx_chain );
}

Expand Down Expand Up @@ -338,7 +337,9 @@ try
old_geometry.cell_composition, old_geometry.lattice_constant,
old_geometry.pinning, old_geometry.defects);

image->Unlock(); // We have to unlock the image to avoid a deadlock in Helper_State_Set_Geometry
Utility::Helper_State_Set_Geometry(state, old_geometry, new_geometry);
image->Lock();
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/io/OVF_File.cpp
Expand Up @@ -38,7 +38,7 @@ OVF_Segment::OVF_Segment( const Data::Spin_System & system )
this->step_size[2] = geometry.lattice_constant * geometry.bravais_vectors[2][2] * 0.1;

// Atomistic extension
for(int i=0; i<2; i++)
for(int i=0; i<3; i++)
{
this->bravaisa[i] = geometry.lattice_constant * geometry.bravais_vectors[0][i];
this->bravaisb[i] = geometry.lattice_constant * geometry.bravais_vectors[1][i];
Expand Down

0 comments on commit 8d72540

Please sign in to comment.