WriteWallSurfaceAreaVTKUnitTest.cpp File Reference
#include <Mercury3D.h>
#include <Species/LinearViscoelasticSpecies.h>
#include <Walls/InfiniteWall.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>

Classes

class  AreaVTK
 

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)
122 {
123  setlocale(LC_ALL, "C");
124 
125  {
126  AreaVTK problem("InfiniteWall");
127  problem.solve(argc, argv);
128 
129  double A0 = problem.getTotalsurfaceAreaFromFile(problem.getName() + "Wall_0.vtu");
130  double A1 = problem.getTotalsurfaceAreaFromFile(problem.getName() + "Wall_1.vtu");
131 
132  double checkedArea = 4.0; // calculated from domain size
133  helpers::check(A0, A1, 0, "Surface areas of first object are equal");
134  helpers::check(A0, checkedArea, 1e-3, "Surface area of first object");
135  }
136 
137  {
138  AreaVTK problem("../SelfTests/Walls/Casing.stl");
139  problem.solve(argc, argv);
140 
141  double A0 = problem.getTotalsurfaceAreaFromFile(problem.getName() + "Wall_0.vtu");
142  double A1 = problem.getTotalsurfaceAreaFromFile(problem.getName() + "Wall_1.vtu");
143 
144  double checkedArea = 675075.0; // checked via MeshLab
145  helpers::check(A0, A1, 0, "Surface areas of second object are equal");
146  helpers::check(A0, checkedArea, 1e-1, "Surface area of second object");
147  }
148 
149  return 0;
150 }
Definition: WriteWallSurfaceAreaVTKUnitTest.cpp:11
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37

References helpers::check(), DPMBase::getName(), AreaVTK::getTotalsurfaceAreaFromFile(), and DPMBase::solve().