PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
testFe.cpp File Reference
#include "testFeLib.h"
#include <PeriDEMConfig.h>
#include <iostream>
#include "util/io.h"
#include "util/parallelUtil.h"
#include <fmt/format.h>
Include dependency graph for testFe.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 18 of file testFe.cpp.

18 {
19
20 // init parallel
21 util::parallel::initMpi(argc, argv);
23 util::io::print(fmt::format("Initialized MPI. MPI size = {}, MPI rank = {}\n", mpiSize, mpiRank));
25
26 util::io::InputParser input(argc, argv);
27
28 if (input.cmdOptionExists("-h") or !input.cmdOptionExists("-i")) {
29 // print help
30 std::cout << argv[0] << " (Version " << MAJOR_VERSION << "."
31 << MINOR_VERSION << "." << UPDATE_VERSION
32 << ") -i <data-filepath>" << std::endl;
33 exit(EXIT_FAILURE);
34 }
35
36 // read input file
37 std::string filepath = input.getCmdOption("-i");
38
39 //
40 // test quadrature method for triangle
41 //
42 {
43 // test quad data for line element
44 for (size_t i = 1; i < 6; i++)
45 test::testLineElem(i, filepath);
46
47 // test quad data for triangle element
48 for (size_t i = 1; i < 6; i++)
49 test::testTriElem(i, filepath);
50
51 // test quad data for quadrangle element
52 for (size_t i = 1; i < 6; i++)
53 test::testQuadElem(i, filepath);
54
55 // test quad data for triangle element
56 for (size_t i = 1; i < 4; i++)
57 test::testTetElem(i, filepath);
58
59 // test additional time in computing quad points instead of storing it
60 if (false) {
61 for (size_t i = 1; i < 6; i++) {
62 test::testTriElemTime(i, 1000);
63
64 test::testTriElemTime(i, 10000);
65
66 test::testTriElemTime(i, 100000);
67
68 test::testTriElemTime(i, 1000000);
69 }
70 }
71 }
72
73 return EXIT_SUCCESS;
74}
size_t const MINOR_VERSION
size_t const UPDATE_VERSION
size_t const MAJOR_VERSION
Input command line argument parser.
Definition io.h:355
void testTriElemTime(size_t n, size_t N)
Computes the time needed when quad data for elements are stored and when they are computed as and whe...
void testLineElem(size_t n, std::string filepath)
Perform test on quadrature points on line elements (NOT IMPLEMENTED)
void testTetElem(size_t n, std::string filepath)
Perform test on quadrature points on tetrahedral elements.
void testQuadElem(size_t n, std::string filepath)
Perform test on quadrature points on quadrangle elements.
void testTriElem(size_t n, std::string filepath)
Perform test on quadrature points on triangle elements.
std::string printStr(const T &msg, int nt=print_default_tab)
Returns formatted string for output.
Definition io.h:54
void print(const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
Prints formatted information.
Definition io.h:108
const MpiStatus * getMpiStatus()
Returns pointer to MpiStatus struct.
void initMpi(int argc=0, char *argv[]=nullptr)
Initializes MPI and also creates MpiStatus struct.
int mpiSize()
Get size (number) of processors.
int mpiRank()
get rank (id) of this processor

References util::io::InputParser::cmdOptionExists(), util::io::InputParser::getCmdOption(), util::parallel::getMpiStatus(), util::parallel::initMpi(), MAJOR_VERSION, MINOR_VERSION, util::parallel::mpiRank(), util::parallel::mpiSize(), util::io::print(), test::testLineElem(), test::testQuadElem(), test::testTetElem(), test::testTriElem(), test::testTriElemTime(), and UPDATE_VERSION.

Here is the call graph for this function: