PeriDEM 0.3.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 <format>
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(std::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
43
44 //
45 // test quadrature method for triangle
46 //
47 {
48 // test quad data for line element
49 for (size_t i = 1; i < 6; i++)
50 test::testLineElem(i, filepath);
51
52 // test quad data for triangle element
53 for (size_t i = 1; i < 6; i++)
54 test::testTriElem(i, filepath);
55
56 // test quad data for quadrangle element
57 for (size_t i = 1; i < 6; i++)
58 test::testQuadElem(i, filepath);
59
60 // test quad data for triangle element
61 for (size_t i = 1; i < 4; i++)
62 test::testTetElem(i, filepath);
63
64 // test additional time in computing quad points instead of storing it
65 if (false) {
66 for (size_t i = 1; i < 6; i++) {
67 test::testTriElemTime(i, 1000);
68
69 test::testTriElemTime(i, 10000);
70
71 test::testTriElemTime(i, 100000);
72
73 test::testTriElemTime(i, 1000000);
74 }
75 }
76 }
77
78 return EXIT_SUCCESS;
79}
Input command line argument parser.
Definition inputParser.h:28
void testPatchTriDistorted()
Perform test on quadrature points on line elements (NOT IMPLEMENTED)
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 testPatchTet()
Perform test on quadrature points on line elements (NOT IMPLEMENTED)
void testPatchQuad()
Perform test on quadrature points on line elements (NOT IMPLEMENTED)
void testPatchTri()
Perform test on quadrature points on line elements (NOT IMPLEMENTED)
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:96
void print(const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
Prints formatted information.
Definition io.h:171
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(), main(), util::parallel::mpiRank(), util::parallel::mpiSize(), util::io::print(), test::testLineElem(), test::testPatchQuad(), test::testPatchTet(), test::testPatchTri(), test::testPatchTriDistorted(), test::testQuadElem(), test::testTetElem(), test::testTriElem(), and test::testTriElemTime().

Here is the call graph for this function: