void DisplacementContinuationSolver::increment_displacement( GRINS::MultiphysicsSystem& system, libMesh::EquationSystems& equation_system, const libMesh::Real displacement ) { // Get DirichetBoundaries vector. libMesh::DirichletBoundaries* d_vector = system.get_dof_map().get_dirichlet_boundaries(); // Get the DirichletBoundary we want libMesh::DirichletBoundary* dirichlet = (*d_vector)[_bc_index]; // Kill the old FunctionBase object and put in our new one. libMesh::FunctionBase<libMesh::Real>* composite_func_ptr = new libMesh::CompositeFunction<libMesh::Real>; libMesh::CompositeFunction<libMesh::Real>& composite_func = libMesh::cast_ref<libMesh::CompositeFunction<libMesh::Real>&>( *composite_func_ptr ); std::vector<VariableIndex> var_idx(1,0); // Hardcoding to Ux displacement component composite_func.attach_subfunction( libMesh::ConstFunction<libMesh::Real>(displacement), var_idx ); // DirichletBoundary now takes ownership of the pointer dirichlet->f.reset(composite_func_ptr); // Need to reinit system equation_system.reinit(); return; }
void DisplacementContinuationSolver::increment_displacement( GRINS::MultiphysicsSystem& system, libMesh::EquationSystems& equation_system, const libMesh::Real displacement ) { // Get DirichetBoundaries vector. libMesh::DirichletBoundaries* d_vector = system.get_dof_map().get_dirichlet_boundaries(); // Get the DirichletBoundary we want libMesh::DirichletBoundary* dirichlet = (*d_vector)[_bc_index]; // Kill the old FunctionBase object and put in our new one. dirichlet->f.reset( new libMesh::ConstFunction<libMesh::Real>( displacement ) ); // Need to reinit system equation_system.reinit(); return; }