Go to the source code of this file.
◆ assemble_laplace()
void assemble_laplace |
( |
EquationSystems & |
es, |
|
|
const std::string & |
system_name |
|
) |
| |
Definition at line 670 of file adaptivity_ex3.C.
676 #ifdef LIBMESH_ENABLE_AMR
679 libmesh_assert_equal_to (system_name,
"Laplace");
685 PerfLog perf_log (
"Matrix Assembly",
false);
704 FEType fe_type = dof_map.variable_type(0);
710 std::unique_ptr<FEBase> fe (FEBase::build(mesh_dim, fe_type));
711 std::unique_ptr<FEBase> fe_face (FEBase::build(mesh_dim, fe_type));
718 fe->attach_quadrature_rule (qrule.get());
719 fe_face->attach_quadrature_rule (qface.get());
725 const std::vector<Real> & JxW = fe->get_JxW();
730 const std::vector<Point> & q_point = fe->get_xyz();
733 const std::vector<std::vector<Real>> & phi = fe->get_phi();
737 const std::vector<std::vector<RealGradient>> & dphi = fe->get_dphi();
749 std::vector<dof_id_type> dof_indices;
765 perf_log.push(
"elem init");
771 dof_map.dof_indices (elem, dof_indices);
779 const unsigned int n_dofs =
780 cast_int<unsigned int>(dof_indices.size());
788 Ke.
resize (n_dofs, n_dofs);
795 perf_log.pop(
"elem init");
803 perf_log.push (
"Ke");
805 std::vector<dof_id_type> dof_indices_u;
806 dof_map.dof_indices (elem, dof_indices_u, 0);
807 const unsigned int n_u_dofs = dof_indices_u.size();
808 libmesh_assert_equal_to (n_u_dofs, phi.size());
809 libmesh_assert_equal_to (n_u_dofs, dphi.size());
811 for (
unsigned int v=0; v !=
n_vars; ++v)
814 Kuu.reposition (v*n_u_dofs, v*n_u_dofs, n_u_dofs, n_u_dofs);
816 for (
unsigned int qp=0; qp<qrule->n_points(); qp++)
817 for (
unsigned int i=0; i != n_u_dofs; i++)
818 for (
unsigned int j=0; j != n_u_dofs; j++)
819 Kuu(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]);
825 Fu.reposition (v*n_u_dofs, n_u_dofs);
827 for (
unsigned int qp=0; qp<qrule->n_points(); qp++)
829 Real x = q_point[qp](0);
832 for (
unsigned int i=0; i != n_u_dofs; ++i)
833 Fu(i) += JxW[qp]*phi[i][qp]*f;
847 LOG_SCOPE_WITH(
"matrix insertion",
"", perf_log);
851 dof_map.heterogenously_constrain_element_matrix_and_vector(Ke, Fe, dof_indices);
859 #endif // #ifdef LIBMESH_ENABLE_AMR
References libMesh::MeshBase::active_local_element_ptr_range(), libMesh::SparseMatrix< T >::add_matrix(), libMesh::NumericVector< T >::add_vector(), libMesh::FEGenericBase< OutputType >::build(), libMesh::FEType::default_quadrature_rule(), libMesh::System::get_dof_map(), libMesh::EquationSystems::get_mesh(), libMesh::EquationSystems::get_system(), libMesh::libmesh_ignore(), libMesh::ImplicitSystem::matrix, mesh, libMesh::MeshBase::mesh_dimension(), n_vars, libMesh::PerfLog::pop(), std::pow(), libMesh::PerfLog::push(), libMesh::Real, libMesh::DenseSubVector< T >::reposition(), libMesh::DenseSubMatrix< T >::reposition(), libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::ExplicitSystem::rhs, singularity, and std::sqrt().
Referenced by main().
◆ exact_derivative()
Definition at line 604 of file adaptivity_ex3.C.
614 const Real y =
dim > 1 ? p(1) : 0.;
619 libmesh_assert_not_equal_to (x, 0.);
622 const Real tt = 2./3.;
623 const Real ot = 1./3.;
626 const Real r2 = x*x + y*y;
630 Real theta = atan2(y, x);
637 gradu(0) = tt*x*
pow(r2,-tt)*sin(tt*theta) -
pow(r2,ot)*cos(tt*theta)*tt/(1.+y*y/x/x)*y/x/x;
641 gradu(1) = tt*y*
pow(r2,-tt)*sin(tt*theta) +
pow(r2,ot)*cos(tt*theta)*tt/(1.+y*y/x/x)*1./x;
648 const Real z = (
dim > 2) ? p(2) : 0;
650 gradu(0) = -sin(x) * exp(y) * (1. - z);
652 gradu(1) = cos(x) * exp(y) * (1. - z);
654 gradu(2) = -cos(x) * exp(y);
References dim, libMesh::pi, std::pow(), libMesh::Real, and singularity.
Referenced by main().
◆ exact_solution()
Number exact_solution |
( |
const Point & |
p, |
|
|
const Parameters & |
, |
|
|
const std::string & |
, |
|
|
const std::string & |
|
|
) |
| |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 122 of file adaptivity_ex3.C.
129 "--enable-petsc, --enable-trilinos, or --enable-eigen");
132 libmesh_example_requires(
sizeof(
Real) > 4,
"--disable-singleprecision");
135 #ifndef LIBMESH_ENABLE_AMR
136 libmesh_example_requires(
false,
"--enable-amr");
140 GetPot input_file(
"adaptivity_ex3.in");
143 input_file.parse_command_line(argc, argv);
146 const unsigned int max_r_steps = input_file(
"max_r_steps", 3);
147 const unsigned int max_r_level = input_file(
"max_r_level", 3);
148 const Real refine_percentage = input_file(
"refine_percentage", 0.5);
149 const Real coarsen_percentage = input_file(
"coarsen_percentage", 0.5);
150 const unsigned int uniform_refine = input_file(
"uniform_refine",0);
151 const std::string refine_type = input_file(
"refinement_type",
"h");
152 const std::string approx_type = input_file(
"approx_type",
"LAGRANGE");
153 const unsigned int approx_order = input_file(
"approx_order", 1);
155 const std::string element_type = input_file(
"element_type",
"tensor");
156 const int extra_error_quadrature = input_file(
"extra_error_quadrature", 0);
157 const int max_linear_iterations = input_file(
"max_linear_iterations", 5000);
159 #ifdef LIBMESH_HAVE_EXODUS_API
160 const bool output_intermediate = input_file(
"output_intermediate",
false);
166 #if !defined(LIBMESH_ENABLE_SECOND_DERIVATIVES)
167 libmesh_example_requires(approx_type !=
"HERMITE",
"--enable-second");
170 dim = input_file(
"dimension", 2);
171 const std::string indicator_type = input_file(
"indicator_type",
"kelly");
175 libmesh_example_requires(
dim <= LIBMESH_DIM,
"2D/3D support");
179 std::string approx_name =
"";
180 if (element_type ==
"tensor")
182 if (approx_order == 1)
183 approx_name +=
"linear";
184 else if (approx_order == 2)
185 approx_name +=
"quadratic";
186 else if (approx_order == 3)
187 approx_name +=
"cubic";
188 else if (approx_order == 4)
189 approx_name +=
"quartic";
191 std::string output_file = approx_name;
193 output_file += refine_type;
194 if (uniform_refine == 0)
195 output_file +=
"_adaptive.m";
197 output_file +=
"_uniform.m";
199 std::ofstream
out (output_file.c_str());
200 out <<
"% dofs L2-error H1-error" << std::endl;
201 out <<
"e = [" << std::endl;
221 if (refine_type ==
"hp")
233 if (element_type ==
"simplex")
239 if (approx_order > 1 || refine_type !=
"h")
244 mesh_refinement.refine_fraction() = refine_percentage;
245 mesh_refinement.coarsen_fraction() = coarsen_percentage;
246 mesh_refinement.max_h_level() = max_r_level;
252 system.
add_variable(
"u", static_cast<Order>(approx_order),
253 Utility::string_to_enum<FEFamily>(approx_type));
255 std::vector<unsigned int> all_vars(1, u_var);
258 for (
unsigned int var_num=1; var_num <
n_vars; ++var_num)
260 std::ostringstream var_name;
261 var_name <<
"u" << var_num;
262 unsigned int next_var =
264 static_cast<Order>(approx_order),
265 Utility::string_to_enum<FEFamily>(approx_type));
266 all_vars.push_back(next_var);
274 std::set<boundary_id_type> all_bdys { 0 };
282 equation_systems.init();
285 equation_systems.parameters.set<
unsigned int>(
"linear solver maximum iterations")
286 = max_linear_iterations;
289 equation_systems.parameters.set<
Real>(
"linear solver tolerance") =
293 equation_systems.print_info();
301 exact_sol.extra_quadrature_order(extra_error_quadrature);
304 exact_sol.compute_error(
"Laplace",
"u");
308 << exact_sol.l2_error(
"Laplace",
"u")
311 << exact_sol.h1_error(
"Laplace",
"u")
315 for (
unsigned int r_step=0; r_step<max_r_steps; r_step++)
317 libMesh::out <<
"Beginning Solve " << r_step << std::endl;
323 << equation_systems.n_active_dofs()
324 <<
" degrees of freedom."
329 <<
", final residual: "
333 #ifdef LIBMESH_HAVE_EXODUS_API
336 if (output_intermediate)
338 std::ostringstream outfile;
339 outfile <<
"lshaped_" << r_step <<
".e";
343 #endif // #ifdef LIBMESH_HAVE_EXODUS_API
346 exact_sol.compute_error(
"Laplace",
"u");
350 << exact_sol.l2_error(
"Laplace",
"u")
353 << exact_sol.h1_error(
"Laplace",
"u")
362 Real mean_disc_error = disc_error.
mean();
364 libMesh::out <<
"Mean discontinuity error = " << mean_disc_error << std::endl;
367 #ifdef LIBMESH_ENABLE_PETSC
368 libmesh_assert_less (mean_disc_error, 1e-14);
373 out << equation_systems.n_active_dofs() <<
" "
374 << exact_sol.l2_error(
"Laplace",
"u") <<
" "
375 << exact_sol.h1_error(
"Laplace",
"u") << std::endl;
378 if (r_step+1 != max_r_steps)
382 if (uniform_refine == 0)
389 if (indicator_type ==
"exact")
416 else if (indicator_type ==
"patch")
425 else if (indicator_type ==
"uniform")
435 libmesh_assert_equal_to (indicator_type,
"kelly");
454 std::ostringstream ss;
456 #ifdef LIBMESH_HAVE_EXODUS_API
457 # ifdef LIBMESH_HAVE_NEMESIS_API
458 std::string error_output =
"error_" + ss.str() +
".n";
460 std::string error_output =
"error_" + ss.str() +
".e";
463 std::string error_output =
"error_" + ss.str() +
".gmv";
474 mesh_refinement.flag_elements_by_error_fraction (error);
478 if (refine_type ==
"p")
479 mesh_refinement.switch_h_to_p_refinement();
482 else if (refine_type ==
"matchedhp")
483 mesh_refinement.add_p_to_h_refinement();
486 else if (refine_type ==
"hp")
493 else if (refine_type ==
"singularhp")
503 else if (refine_type !=
"h")
504 libmesh_error_msg(
"Unknown refinement_type = " << refine_type);
508 mesh_refinement.refine_and_coarsen_elements();
511 else if (uniform_refine == 1)
513 if (refine_type ==
"h" || refine_type ==
"hp" ||
514 refine_type ==
"matchedhp")
515 mesh_refinement.uniformly_refine(1);
516 if (refine_type ==
"p" || refine_type ==
"hp" ||
517 refine_type ==
"matchedhp")
518 mesh_refinement.uniformly_p_refine(1);
526 equation_systems.reinit ();
530 #ifdef LIBMESH_HAVE_EXODUS_API
536 #endif // #ifdef LIBMESH_HAVE_EXODUS_API
539 out <<
"];" << std::endl;
540 out <<
"hold on" << std::endl;
541 out <<
"plot(e(:,1), e(:,2), 'bo-');" << std::endl;
542 out <<
"plot(e(:,1), e(:,3), 'ro-');" << std::endl;
545 out <<
"xlabel('dofs');" << std::endl;
546 out <<
"title('" << approx_name <<
" elements');" << std::endl;
547 out <<
"legend('L2-error', 'H1-error');" << std::endl;
552 #endif // #ifndef LIBMESH_ENABLE_AMR
References libMesh::DofMap::add_algebraic_ghosting_functor(), libMesh::DofMap::add_dirichlet_boundary(), libMesh::MeshRefinement::add_p_to_h_refinement(), libMesh::System::add_variable(), libMesh::MeshBase::all_second_order(), libMesh::MeshTools::Modification::all_tri(), assemble_laplace(), libMesh::System::attach_assemble_function(), libMesh::ExactErrorEstimator::attach_exact_deriv(), libMesh::ExactSolution::attach_exact_deriv(), libMesh::ExactErrorEstimator::attach_exact_value(), libMesh::ExactSolution::attach_exact_value(), libMesh::MeshTools::Generation::build_line(), libMesh::MeshRefinement::coarsen_fraction(), libMesh::ExactSolution::compute_error(), libMesh::default_solver_package(), dim, libMesh::UniformRefinementEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), exact_derivative(), exact_grad(), exact_solution(), libMesh::ExactSolution::extra_quadrature_order(), libMesh::LinearImplicitSystem::final_linear_residual(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::System::get_dof_map(), libMesh::ExactSolution::h1_error(), libMesh::TriangleWrapper::init(), libMesh::INVALID_SOLVER_PACKAGE, libMesh::ExactSolution::l2_error(), libMesh::libmesh_assert(), libMesh::MeshRefinement::max_h_level(), libMesh::ErrorVector::mean(), mesh, libMesh::LinearImplicitSystem::n_linear_iterations(), n_vars, libMesh::out, libMesh::ErrorVector::plot_error(), std::pow(), libMesh::MeshBase::read(), libMesh::Real, libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_fraction(), libMesh::HPSingularity::select_refinement(), libMesh::HPCoarsenTest::select_refinement(), libMesh::HPSingularity::singular_points, singularity, libMesh::LinearImplicitSystem::solve(), libMesh::MeshRefinement::switch_h_to_p_refinement(), libMesh::TOLERANCE, libMesh::MeshRefinement::uniformly_p_refine(), libMesh::MeshRefinement::uniformly_refine(), libMesh::JumpErrorEstimator::use_unweighted_quadrature_rules, and libMesh::MeshOutput< MT >::write_equation_systems().
◆ dim
Definition at line 113 of file adaptivity_ex3.C.
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::FEMContext::_do_elem_position_set(), libMesh::DofMap::_dof_indices(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::DofMap::_node_dof_indices(), assemble(), LinearElasticity::assemble(), assemble_1D(), AssembleOptimization::assemble_A_and_F(), assemble_biharmonic(), assemble_cd(), assemble_elasticity(), assemble_ellipticdg(), assemble_helmholtz(), assemble_mass(), assemble_matrices(), assemble_poisson(), assemble_SchroedingerEquation(), assemble_shell(), assemble_stokes(), assemble_wave(), libMesh::FEMContext::attach_quadrature_rules(), libMesh::FEGenericBase< FEOutputType< T >::type >::build(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::FEGenericBase< FEOutputType< T >::type >::build_InfFE(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::System::calculate_norm(), libMesh::JumpErrorEstimator::coarse_n_flux_faces_increment(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::FEMap::compute_affine_map(), libMesh::FEInterface::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), libMesh::FEMap::compute_face_map(), libMesh::FEXYZ< Dim >::compute_face_values(), compute_jacobian(), libMesh::FEMap::compute_map(), libMesh::FEMap::compute_null_map(), compute_residual(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::FEXYZ< Dim >::compute_shape_functions(), libMesh::FEMap::compute_single_point_map(), LinearElasticityWithContact::compute_stresses(), LinearElasticity::compute_stresses(), compute_stresses(), LargeDeformationElasticity::compute_stresses(), libMesh::DofMap::constrain_p_dofs(), libMesh::InfFERadial::decay(), libMesh::FEType::default_quadrature_rule(), libMesh::MeshBase::detect_interior_parents(), libMesh::MeshFunction::discontinuous_gradient(), libMesh::MeshFunction::discontinuous_value(), libMesh::FEMContext::elem_fe_reinit(), libMesh::FEMContext::elem_position_get(), NavierSystem::element_constraint(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), exact_derivative(), exact_solution(), libMesh::ElemInternal::find_interior_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), NavierSystem::forcing(), libMesh::FEMContext::get_element_fe(), libMesh::FEMContext::get_element_qrule(), libMesh::FEMContext::get_side_fe(), libMesh::FEMContext::get_side_qrule(), libMesh::QGrundmann_Moller::gm_rule(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::FEInterface::ifem_compute_data(), libMesh::FEInterface::ifem_inverse_map(), libMesh::FEInterface::ifem_map(), libMesh::FEInterface::ifem_n_dofs(), libMesh::FEInterface::ifem_n_dofs_at_node(), libMesh::FEInterface::ifem_n_dofs_per_elem(), libMesh::FEInterface::ifem_n_shape_functions(), libMesh::FEInterface::ifem_nodal_soln(), libMesh::FEInterface::ifem_shape(), libMesh::FEInterface::ifem_shape_deriv(), libMesh::LaplacianErrorEstimator::init_context(), libMesh::DiscontinuityMeasure::init_context(), libMesh::KellyErrorEstimator::init_context(), libMesh::OldSolutionBase< Output, point_output >::init_context(), NavierSystem::init_data(), SolidSystem::init_data(), libMesh::FEMContext::init_internal_data(), libMesh::RBEIMAssembly::initialize_fe(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::InfFEMap::inverse_map(), libMesh::FEMap::inverse_map(), libMesh::FEInterface::inverse_map(), LaplaceYoung::jacobian(), LargeDeformationElasticity::jacobian(), libMesh::VectorOfNodesAdaptor::kdtree_get_pt(), libMesh::InverseDistanceInterpolation< KDDim >::PointListAdaptor< KDDim >::kdtree_get_pt(), main(), libMesh::InfFEMap::map(), libMesh::FEMap::map(), libMesh::FEInterface::map(), libMesh::HCurlFETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_d2phi(), libMesh::FEMap::map_deriv(), libMesh::H1FETransformation< OutputShape >::map_div(), libMesh::H1FETransformation< OutputShape >::map_dphi(), libMesh::H1FETransformation< OutputShape >::map_phi(), libMesh::HCurlFETransformation< OutputShape >::map_phi(), NavierSystem::mass_residual(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), libMesh::FEInterface::n_dofs_per_elem(), libMesh::FEInterface::n_shape_functions(), libMesh::FEInterface::nodal_soln(), libMesh::DofMap::old_dof_indices(), OverlappingCouplingFunctor::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::MeshFunction::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SortAndCopy::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::System::point_gradient(), NavierSystem::postprocess(), process_cmd_line(), libMesh::QGauss::QGauss(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::DofMap::reinit(), libMesh::JumpErrorEstimator::reinit_sides(), LaplaceYoung::residual(), LargeDeformationElasticity::residual(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::FEMap::resize_quadrature_map_vectors(), SolidSystem::save_initial_mesh(), libMesh::HPCoarsenTest::select_refinement(), ElemTest< elem_type >::setUp(), setup(), libMesh::FEInterface::shape(), libMesh::FEInterface::shape_deriv(), libMesh::FEInterface::shape_second_deriv(), libMesh::Side< SideType, ParentType >::Side(), NavierSystem::side_constraint(), libMesh::FEMContext::side_fe_reinit(), libMesh::SideEdge< EdgeType, ParentType >::SideEdge(), libMesh::PatchRecoveryErrorEstimator::specpoly(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::SubFunctor(), SlitMeshRefinedSystemTest::testRestart(), InfFERadialTest::testSingleOrder(), SlitMeshRefinedSystemTest::testSystem(), libMesh::FEType::unweighted_quadrature_rule(), libMesh::FEMContext::use_default_quadrature_rules(), libMesh::FEMContext::use_unweighted_quadrature_rules(), libMesh::ExodusII_IO::write_as_dimension(), libMesh::ExodusII_IO_Helper::write_as_dimension(), libMesh::EnsightIO::write_scalar_ascii(), and libMesh::EnsightIO::write_vector_ascii().
◆ n_vars
Definition at line 116 of file adaptivity_ex3.C.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::DofMap::allgather_recursive_constraints(), assemble_laplace(), libMesh::WrappedFunction< Output >::component(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointResidualErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::ErrorEstimator::estimate_errors(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::LaplacianErrorEstimator::init_context(), libMesh::DiscontinuityMeasure::init_context(), libMesh::KellyErrorEstimator::init_context(), libMesh::RadialBasisInterpolation< KDDim, RBF >::interpolate_field_data(), main(), libMesh::WrappedFunction< Output >::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::RadialBasisInterpolation< KDDim, RBF >::prepare_for_use(), libMesh::System::project_vector(), libMesh::System::projection_matrix(), libMesh::JumpErrorEstimator::reinit_sides(), libMesh::HPCoarsenTest::select_refinement(), libMesh::MEDITIO::write_ascii(), libMesh::GMVIO::write_ascii_new_impl(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::UCDIO::write_header(), libMesh::GmshIO::write_post(), and libMesh::GnuPlotIO::write_solution().
◆ singularity
void plot_error(const std::string &filename, const MeshBase &mesh) const
Plots a data file, of a type determined by looking at the file extension in filename,...
void add_algebraic_ghosting_functor(GhostingFunctor &evaluable_functor, bool to_mesh=true)
Adds a functor which can specify algebraic ghosting requirements for use with distributed vectors.
This class handles the computation of the L2 and/or H1 error for the Systems in the EquationSystems o...
Gradient exact_grad(const Point &, const Parameters &, const std::string &, const std::string &)
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
const MeshBase & get_mesh() const
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false)=0
Interfaces for reading/writing a mesh to/from a file.
NumericVector< Number > * rhs
The system matrix.
This class implements the Patch Recovery error indicator.
virtual void all_second_order(const bool full_ordered=true)=0
Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements...
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Adds a copy of the specified Dirichlet boundary to the system.
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
This function uses the derived class's jump error estimate formula to estimate the error on each cell...
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
Defines a dense submatrix for use in Finite Element-type computations.
void attach_exact_deriv(unsigned int sys_num, FunctionBase< Gradient > *g)
Clone and attach an arbitrary functor which computes the exact gradient of the system sys_num solutio...
This class uses a user-provided list of singularity locations to choose between h refining and p elev...
const T_sys & get_system(const std::string &name) const
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
static const Real TOLERANCE
Gradient exact_derivative(const Point &p, const Parameters &, const std::string &, const std::string &)
virtual void solve() override
Assembles & solves the linear system A*x=b.
SolverPackage default_solver_package()
unsigned int mesh_dimension() const
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
void resize(const unsigned int new_m, const unsigned int new_n)
Resize the matrix.
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
Implements (adaptive) mesh refinement algorithms for a MeshBase.
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
This function uses the exact solution function to estimate the error on each cell.
This class implements the Kelly error indicator which is based on the flux jumps between elements.
void attach_assemble_function(void fptr(EquationSystems &es, const std::string &name))
Register a user function to use in assembling the system matrix and RHS.
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i].
This is the MeshBase class.
Wrap a libMesh-style function pointer into a FunctionBase object.
void libmesh_ignore(const Args &...)
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
The PerfLog class allows monitoring of specific events.
A Point defines a location in LIBMESH_DIM dimensional Real space.
SparseMatrix< Number > * matrix
The system matrix.
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
double pow(double a, int b)
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
This function uses the Patch Recovery error estimate to estimate the error on each cell.
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
This class adds coupling (for use in send_list construction) between active elements and all descenda...
This is the EquationSystems class.
unsigned int n_linear_iterations() const
virtual void write_equation_systems(const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
This method implements writing a mesh with data to a specified file where the data is taken from the ...
void resize(const unsigned int n)
Resize the vector.
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols)=0
Add the full matrix dm to the SparseMatrix.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
This class handles the numbering of degrees of freedom on a mesh.
virtual Real mean() const override
void attach_exact_value(unsigned int sys_num, FunctionBase< Number > *f)
Clone and attach an arbitrary functor which computes the exact value of the system sys_num solution a...
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
This class implements an "error estimator" based on the difference between the approximate and exact ...
Number exact_solution(const Point &p, const Parameters &, const std::string &, const std::string &)
bool use_unweighted_quadrature_rules
This boolean flag allows you to use "unweighted" quadrature rules (sized to exactly integrate unweigh...
std::list< Point > singular_points
This list, to be filled by the user, should include all singular points in the solution.
Real final_linear_residual() const
const DofMap & get_dof_map() const
This class measures discontinuities between elements for debugging purposes.
This class uses the error estimate given by different types of derefinement (h coarsening or p reduct...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
void assemble_laplace(EquationSystems &es, const std::string &system_name)
virtual void select_refinement(System &system)
This pure virtual function must be redefined in derived classes to take a mesh flagged for h refineme...
virtual void select_refinement(System &system) override
This pure virtual function must be redefined in derived classes to take a mesh flagged for h refineme...