Lines Matching +full:- +full:a

1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
4 // SPDX-License-Identifier: BSD-2-Clause
10 // This example illustrates a simple usage of libCEED to compute the surface
11 // area of a 3D body using matrix-free application of a diffusion operator.
15 // The example has no dependencies, and is designed to be self-contained. For
19 // All libCEED objects use a Ceed device object constructed based on a command
20 // line argument (-ceed).
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
32 fn main() -> libceed::Result<()> { in main()
39 fn example_2(options: opt::Opt) -> libceed::Result<()> { in example_2()
70 println!(" Ceed specification [-c] : {}", ceed_spec); in example_2()
71 println!(" Mesh dimension [-d] : {}", dim); in example_2()
72 println!(" Mesh degree [-m] : {}", mesh_degree); in example_2()
73 println!(" Solution degree [-p] : {}", solution_degree); in example_2()
74 println!(" Num. 1D quadr. pts [-q] : {}", num_qpts); in example_2()
75 println!(" Approx. # unknowns [-s] : {}", problem_size); in example_2()
77 " QFunction source [-g] : {}", in example_2()
135 // Create a Vector with the mesh coordinates in example_2()
138 // Apply a transformation to the mesh coordinates in example_2()
142 // -- QFunction from user closure in example_2()
158 let qw = weights[i] / (j11 * j22 - j21 * j12); in example_2()
161 qdata[i + q * 2] = -qw * (j11 * j12 + j21 * j22); in example_2()
167 let mut a = [0.0; 9]; in example_2() localVariable
170 a[k * 3 + j] = jacobian[i + q * ((j + 1) % 3 + 3 * ((k + 1) % 3))] in example_2()
172 - jacobian[i + q * ((j + 1) % 3 + 3 * ((k + 2) % 3))] in example_2()
177 / (jacobian[i + q * 0] * a[0 * 3 + 0] in example_2()
178 + jacobian[i + q * 1] * a[0 * 3 + 1] in example_2()
179 + jacobian[i + q * 2] * a[0 * 3 + 2]); in example_2()
181 * (a[0 * 3 + 0] * a[0 * 3 + 0] in example_2()
182 + a[0 * 3 + 1] * a[0 * 3 + 1] in example_2()
183 + a[0 * 3 + 2] * a[0 * 3 + 2]); in example_2()
185 * (a[1 * 3 + 0] * a[1 * 3 + 0] in example_2()
186 + a[1 * 3 + 1] * a[1 * 3 + 1] in example_2()
187 + a[1 * 3 + 2] * a[1 * 3 + 2]); in example_2()
189 * (a[2 * 3 + 0] * a[2 * 3 + 0] in example_2()
190 + a[2 * 3 + 1] * a[2 * 3 + 1] in example_2()
191 + a[2 * 3 + 2] * a[2 * 3 + 2]); in example_2()
193 * (a[1 * 3 + 0] * a[2 * 3 + 0] in example_2()
194 + a[1 * 3 + 1] * a[2 * 3 + 1] in example_2()
195 + a[1 * 3 + 2] * a[2 * 3 + 2]); in example_2()
197 * (a[0 * 3 + 0] * a[2 * 3 + 0] in example_2()
198 + a[0 * 3 + 1] * a[2 * 3 + 1] in example_2()
199 + a[0 * 3 + 2] * a[2 * 3 + 2]); in example_2()
201 * (a[0 * 3 + 0] * a[1 * 3 + 0] in example_2()
202 + a[0 * 3 + 1] * a[1 * 3 + 1] in example_2()
203 + a[0 * 3 + 2] * a[1 * 3 + 2]); in example_2()
217 // -- QFunction from gallery in example_2()
222 // -- QFunction for use with Operator in example_2()
250 // -- QFunction from user closure in example_2()
298 // -- QFunction from gallery in example_2()
303 // -- QFunction for use with Operator in example_2()
340 println!("Surface area error : {:.12e}", area - exact_area); in example_2()
344 _ => 1E-1, in example_2()
346 let error = (area - exact_area).abs(); in example_2()
351 "Volume error too large - expected: {:.12e}, actual: {:.12e}", in example_2()
359 // ----------------------------------------------------------------------------
361 // ----------------------------------------------------------------------------
374 problem_size_requested: -1, in example_2_1d()
390 problem_size_requested: -1, in example_2_2d()
406 problem_size_requested: -1, in example_2_3d()
422 problem_size_requested: -1, in example_2_1d_gallery()
438 problem_size_requested: -1, in example_2_2d_gallery()
454 problem_size_requested: -1, in example_2_3d_gallery()
463 // ----------------------------------------------------------------------------