25 #include "libmesh/function_base.h" 26 #include "libmesh/numeric_vector.h" 27 #include "libmesh/exodusII_io.h" 32 public libMesh::FunctionBase<Real> {
39 libmesh_assert_less_equal(mode_num, 5);
43 virtual std::unique_ptr<libMesh::FunctionBase<Real> >
clone ()
const {
46 return std::unique_ptr<libMesh::FunctionBase<Real> >(rval);
50 virtual Real operator()
51 (
const libMesh::Point& p,
const Real time) {libmesh_assert(
false);}
56 libMesh::DenseVector<Real>& output) {
75 output(1) = (cos(th) * p(1) - sin(th) * p(2)) - p(1);
76 output(2) = (sin(th) * p(1) + cos(th) * p(2)) - p(2);
87 output(0) = ( cos(th) * p(0) + sin(th) * p(2)) - p(0);
88 output(2) = (-sin(th) * p(0) + cos(th) * p(2)) - p(2);
99 output(0) = (cos(th) * p(0) - sin(th) * p(1)) - p(0);
100 output(1) = (sin(th) * p(0) + cos(th) * p(1)) - p(1);
127 libMesh::NonlinearImplicitSystem::ComputeVectorSubspace() {
130 _nm[0] =
"x_translation_mode";
131 _nm[1] =
"y_translation_mode";
132 _nm[2] =
"z_translation_mode";
133 _nm[3] =
"tx_rotation_mode";
134 _nm[4] =
"ty_rotation_mode";
135 _nm[5] =
"tz_rotation_mode";
143 libMesh::NonlinearImplicitSystem& s) {
149 libmesh_assert_equal_to(sp.size(), 0);
155 std::vector<std::string> nm(6);
156 nm[0] =
"x_translation_mode";
157 nm[1] =
"y_translation_mode";
158 nm[2] =
"z_translation_mode";
159 nm[3] =
"tx_rotation_mode";
160 nm[4] =
"ty_rotation_mode";
161 nm[5] =
"tz_rotation_mode";
165 for (
unsigned int i=0; i<nm.size(); i++) {
167 sp[i] = &s.add_vector(nm[i]);
This class implements a system for solution of nonlinear systems.
virtual Real operator()(const libMesh::Point &p, const Real time)
std::vector< std::string > _nm
StructuralModes(const unsigned int mode_num)
virtual std::unique_ptr< libMesh::FunctionBase< Real > > clone() const
const unsigned int _mode
mode number: 0 = rigid-body translation in x 1 = rigid-body translation in y 2 = rigid-body translati...
StructuralNearNullVectorSpace()
default constructor
void project_vector_without_dirichlet(libMesh::NumericVector< Real > &new_vector, libMesh::FunctionBase< Real > &f) const
virtual void operator()(std::vector< libMesh::NumericVector< Real > * > &sp, libMesh::NonlinearImplicitSystem &s)
This function will be called to compute the subspace basis (e.g., nullspace or nearnullspace).