Skip to content

Commit

Permalink
#733 Update mesh used in testing to canonical diameter of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mobernabeu committed May 9, 2020
1 parent 26ab5a1 commit f85dac8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions Code/unittests/redblood/LoadDeformedCellTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,14 @@ namespace hemelb

void testIntegration()
{
// Read meshes from disc and correct coordinates
// Read meshes from disc
auto const normal = readVTKMesh(resources::Resource("rbc_ico_720.vtp").Path().c_str());

auto const deformed = readVTKMesh(resources::Resource("992Particles_rank3_26_t992.vtp").Path().c_str());
// The file is stored in lattice units from a simulation with delta_x=2/3um and RBC radius 4um. We want to scale to a radius of 1.0 in lattice units
double scaleInFile = 2e-6 / 3 * 1. / 4e-6;

auto const barycent = barycenter(deformed->vertices);
for (auto &vertex : deformed->vertices)
{
vertex = (vertex - barycent) * scaleInFile + barycent;
}

// Check they are compatible
CPPUNIT_ASSERT(normal->facets == deformed->facets);
CPPUNIT_ASSERT(volume(*normal) > 0.0);
CPPUNIT_ASSERT(volume(deformed->vertices, normal->facets) > 0.0);
std::cout << "VOLS: " << volume(*normal) << " " << volume(deformed->vertices, normal->facets) << std::endl;

auto const & converter = master->GetUnitConverter();
auto const scale = converter.ConvertToLatticeUnits("m", 4e-6);
Expand Down
Loading

0 comments on commit f85dac8

Please sign in to comment.