38 #ifdef OOMPH_HAS_MUMPS
39 linear_solver_pt()=
new MumpsSolver;
45 setElasticModulus(1e6);
47 setSolidCubicMesh(3, 3, 3, -1, 1, -1, 1, -1, 1);
48 pinBoundaries({Boundary::X_MIN, Boundary::X_MAX});
53 logger(
INFO,
"\nElements: %", solid_mesh_pt()->nelement());
54 std::cout <<
"Center Positions:\n";
55 for (
int e = 0; e < solid_mesh_pt()->nelement(); ++e) {
56 ELEMENT* e_pt =
dynamic_cast<ELEMENT*
>(solid_mesh_pt()->element_pt(e));
57 std::cout <<
" " << e <<
": " <<
getXiCenter(e_pt) << std::endl;
60 ELEMENT* e_pt =
dynamic_cast<ELEMENT*
>(solid_mesh_pt()->element_pt(22));
69 logger(
INFO,
"Nodes per element: %", e_pt->nnode());
70 std::cout <<
"Nodal positions element 22:\n";
71 for (
int n = 0;
n < e_pt->nnode(); ++
n) {
73 std::cout <<
" " <<
n <<
": " << n_pt->x(0) <<
' ' << n_pt->x(1) <<
' ' << n_pt->x(2) << std::endl;
77 logger(
INFO,
"Integration points per element: %", e_pt->integral_pt()->nweight());
78 std::cout <<
"Local and global coordinates, weight, Jacobian and shape functions at integration points:\n";
79 unsigned dim = e_pt->nodal_dimension();
80 for (
unsigned ipt = 0; ipt < e_pt->integral_pt()->nweight(); ipt++) {
81 Vector<double> s(dim);
83 for (
unsigned i = 0;
i < dim; ++
i) {
84 s[
i] = e_pt->integral_pt()->knot(ipt,
i);
87 Shape psi(e_pt->nnode(), e_pt->nnodal_position_type());
88 DShape dpsidxi(e_pt->nnode(), e_pt->nnodal_position_type(), dim);
89 double J = e_pt->dshape_lagrangian_at_knot(ipt, psi, dpsidxi);
91 double w = e_pt->integral_pt()->weight(ipt);
93 Vector<double> interpolated_x(dim, 0.0);
94 Vector<double> interpolated_xi(dim, 0.0);
95 std::stringstream psi_ss;
96 for (
int l = 0; l < e_pt->nnode(); ++l) {
97 for (
int k = 0; k < e_pt->nnodal_position_type(); ++k) {
98 for (
int i = 0;
i < dim; ++
i) {
100 interpolated_xi[
i] += e_pt->lagrangian_position_gen(l, k,
i) * psi(l,k);
101 interpolated_x[
i] += e_pt->nodal_position_gen(l, k,
i) * psi(l, k);
103 psi_ss << psi(l, k) <<
' ';
106 std::cout <<
"ipt " << ipt <<
" w " << w <<
" J " << J <<
" s " << s <<
" xi " << interpolated_xi <<
" psi " << psi_ss.str() << std::endl;
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
void removeOldFiles() const
Definition: BaseCoupling.h:68
void setName(std::string name)
Definition: BaseCoupling.h:59
static Vector< double > getXiCenter(ELEMENT *e_pt)
Definition: ElementAnalysis.cpp:110
void coupleBoundary(unsigned b)
Definition: SCoupling.h:681
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51