PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
baseElem.cpp
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2024 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0. (See accompanying
8 * file LICENSE)
9 */
10
11#include "baseElem.h"
12#include "util/feElementDefs.h" // global definition of elements
13#include <iostream> // for std::cerr
14
15fe::BaseElem::BaseElem(size_t order, size_t element_type)
16 : d_quadOrder(order), d_elemType(element_type),
17 d_numQuadPts(util::vtk_map_element_to_num_nodes[element_type]){};
18
19std::vector<double>
21 const std::vector<util::Point> &nodes) {
22 std::cerr << "Error: For element type = " << d_elemType << " the map from "
23 << "element to reference element is not available.\n"
24 << "Therefore, shape function evaluation at any arbitrary point "
25 "in the element is not possible.\n";
26 exit(1);
27}
28
29std::vector<std::vector<double>>
31 const std::vector<util::Point> &nodes) {
32 std::cerr << "Error: For element type = " << d_elemType << " the map from "
33 << "element to reference element is not available.\n"
34 << "Therefore, derivatives of shape function at any "
35 "arbitrary point in the element can not be computed.\n";
36 exit(1);
37}
38
41 const std::vector<util::Point> &nodes) {
42 std::cerr << "Error: For element type = " << d_elemType << " the map from "
43 << "element to reference element is not available.\n";
44 exit(1);
45}
46
48
49 std::cerr << "Error: init() of BaseElem must be implemented in inheriting "
50 "class.\n";
51 exit(1);
52}
virtual util::Point mapPointToRefElem(const util::Point &p, const std::vector< util::Point > &nodes)
Maps point p in a given element to the reference element and returns the mapped point.
Definition baseElem.cpp:40
BaseElem(size_t order, size_t element_type)
Constructor.
Definition baseElem.cpp:15
virtual std::vector< std::vector< double > > getDerShapes(const util::Point &p, const std::vector< util::Point > &nodes)
Returns the values of derivative of shape function at point p.
Definition baseElem.cpp:30
virtual std::vector< double > getShapes(const util::Point &p, const std::vector< util::Point > &nodes)
Returns the values of shape function at point p.
Definition baseElem.cpp:20
virtual void init()=0
Compute the quadrature points.
Definition baseElem.cpp:47
Collection of methods useful in simulation.
A structure to represent 3d vectors.
Definition point.h:30