svMultiPhysics
Loading...
Searching...
No Matches
nn.h
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef NN_H
5#define NN_H
6
7#include "Simulation.h"
8#include "SolutionStates.h"
9#include "ComMod.h"
10#include "consts.h"
11
12namespace nn {
13
14 void get_gip(const int insd, consts::ElementType eType, const int nG, Vector<double>& w, Array<double>& xi);
15 void get_gip(Simulation* simulation, faceType& face);
16 void get_gip(mshType& mesh);
17
18 void get_gnn(const int insd, consts::ElementType eType, const int eNoN, const int g, Array<double>& xi,
19 Array<double>& N, Array3<double>& Nx);
20 void get_gnn(const int insd, consts::ElementType eType, const int eNoN, Vector<double>& xi, Vector<double>& N,
21 Array<double>& Nx);
22
23 void get_gnn(Simulation* simulation, int gaus_pt, faceType& face);
24 void get_gnn(int gaus_pt, mshType& mesh);
25 void get_gn_nxx(const int insd, const int ind2, consts::ElementType eType, const int eNoN, const int gaus_pt,
26 const Array<double>& xi, Array3<double>& Nxx);
27
28 void get_nn_bnds(const int nsd, consts::ElementType eType, const int eNoN, Array<double>& xib, Array<double>& Nb);
29 void get_nn_bnds(const ComMod& com_mod, mshType& mesh);
30
31 void get_nnx(const int nsd, const consts::ElementType eType, const int eNoN, const Array<double>& xl,
32 const Array<double>& xib, const Array<double>& Nb, const Vector<double>& xp, Vector<double>& xi,
33 Vector<double>& N, Array<double>& Nx);
34
35 void get_xi(const int nsd, consts::ElementType eType, const int eNoN, const Array<double>& xl, const Vector<double>& xp,
36 Vector<double>& xi, bool& flag);
37
38 void gnn(const int eNoN, const int nsd, const int insd, Array<double>& Nxi, Array<double>& x, Array<double>& Nx,
39 double& Jac, Array<double>& ks);
40
41 /**
42 * @brief Return the area-weighted surface normal at a given element and Gauss
43 * point.
44 *
45 * Returns the outward normal at element 'e', Gauss point 'g' of face 'lFa',
46 * weighted by the surface Jacobian: Jac = norm(n) is the Jacobian of the
47 * mapping from the parent surface element to the reference/old/new
48 * configuration.
49 *
50 * For simulations involving structural displacement, this function allows
51 * computing the normal vector in any of the following configurations:
52 * - reference configuration (the mesh is not displaced);
53 * - current configuration (the mesh is displaced by the current displacement
54 * field);
55 * - old configuration (the mesh is displaced by the displacement field from
56 * previous time step).
57 *
58 * @param[in] com_mod The common module.
59 * @param[in] lFa The boundary face for which the normal vector is computed.
60 * @param[in] e The face-local index of the element for which the normal
61 * vector is computed.
62 * @param[in] g The Gauss point index for which the normal vector is computed.
63 * @param[in] Nx The shape function derivatives at the Gauss point. Its shape
64 * (insd x eNoNb) determines the surface's intrinsic dimension and the
65 * number of nodes per face element.
66 * @param[in] solutions The solution states that the displacement fields are
67 * extracted from.
68 * @param[in] cfg The configuration in which the normal vector is computed
69 * (reference, old or current).
70 * @param[in] displacement_index The index of the displacement field in the
71 * solution arrays. This should correspond to the start index of the
72 * equation that solves for the displacement.
73 * @return The area-weighted outward normal vector.
74 */
75 Vector<double> gnnb(const ComMod &com_mod, const faceType &lFa, const int e,
76 const int g, const Array<double> &Nx,
77 const SolutionStates &solutions,
78 consts::MechanicalConfigurationType cfg,
79 const unsigned int displacement_index);
80
81 /**
82 * @brief Return the area-weighted surface normal at a given element and Gauss
83 * point.
84 *
85 * Returns the outward normal at element 'e', Gauss point 'g' of face 'lFa',
86 * weighted by the surface Jacobian: Jac = norm(n) is the Jacobian of the
87 * mapping from the parent surface element to the mesh.
88 *
89 * This is the overload to use in the general case. The other overload adds
90 * the ability to compute the normal in a displaced configuration, which is
91 * only relevant for simulations involving structural displacement.
92 *
93 * @param[in] com_mod The common module.
94 * @param[in] lFa The boundary face for which the normal vector is computed.
95 * @param[in] e The face-local index of the element for which the normal
96 * vector is computed.
97 * @param[in] g The Gauss point index for which the normal vector is computed.
98 * @param[in] Nx The shape function derivatives at the Gauss point.
99 * @param[in] solutions The solution states that the displacement fields are
100 * extracted from.
101 * @return The area-weighted outward normal vector.
102 */
103 Vector<double> gnnb(const ComMod &com_mod, const faceType &lFa, const int e,
104 const int g, const Array<double> &Nx,
105 const SolutionStates &solutions);
106
107 void gnns(const int nsd, const int eNoN, const Array<double>& Nxi, Array<double>& xl, Vector<double>& nV,
108 Array<double>& gCov, Array<double>& gCnv);
109
110 void gn_nxx(const int l, const int eNoN, const int nsd, const int insd, Array<double>& Nxi, Array<double>& Nxi2, Array<double>& lx,
111 Array<double>& Nx, Array<double>& Nxx);
112
113 void select_ele(const ComMod& com_mod, mshType& mesh);
114
115 void select_eleb(Simulation* simulation, mshType& mesh, faceType& face);
116
117};
118
119#endif
120
The Array3 template class implements a simple interface to 3D arrays.
Definition Array3.h:25
The ComMod class duplicates the data structures in the Fortran COMMOD module defined in MOD....
Definition ComMod.h:1597
Definition Simulation.h:19
The Vector template class is used for storing int and double data.
Definition Vector.h:26
The face type containing mesh at boundary.
Definition ComMod.h:469
This is the container for a mesh or NURBS patch, those specific to NURBS are noted.
Definition ComMod.h:878
Holds solution state at old, current, and intermediate time levels.
Definition SolutionStates.h:39