#include <adolc/adolc.h>
#include <iostream>
Go to the source code of this file.
◆ main()
- Examples
- add_blockset.cpp, add_cubit_meshsets.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_check_approx_in_3d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, matrix_function.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, petsc_smart_ptr_objects.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, seepage.cpp, shallow_wave.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_broken_space.cpp, test_cache_on_entities.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, and wave_equation.cpp.
Definition at line 46 of file adol-c_atom.cpp.
46 {
49
50
51
52
53
54 double** X;
55 double** Y;
58 X[0][0] = 0.5;
59 X[0][1] = 1.0;
62 double** Z;
64
66
67 trace_on(tag);
68 x <<= X[0][0];
70 y >>= Y[0][0];
71 trace_off();
72
73 double u[1];
74 u[0]=1;
76 { forward(tag,1,1,
i,
i+1,X,Y);
78 cout << Y[0][
i] <<
" - " << y.value() <<
" = " << Y[0][
i]-y.value()
79 << " (should be 0)\n";
80 else {
81 Z[0][
i] = Z[0][
i-1]/
i;
82 cout << Y[0][
i] <<
" - " << Z[0][
i] <<
" = " << Y[0][
i]-Z[0][
i]
83 << " (should be 0)\n";
84 }
85 reverse(tag,1,1,
i,u,Z);
86 }
87
88 return 0;
89}
adouble power(adouble x, int n)
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
◆ power()
Definition at line 25 of file adol-c_atom.cpp.
25 {
27
31 z *= z;
33 z *= x;
34 return z;
35 }
36 else {
38 return z;
39 else
41 }
42}