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 volume of a
11 // 3D body using matrix-free application of a mass + diff operator. Arbitrary
14 // The example has no dependencies, and is designed to be self-contained. For
18 // All libCEED objects use a Ceed device object constructed based on a command
19 // line argument (-ceed).
28 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
31 fn main() -> libceed::Result<()> { in main()
38 fn example_3(options: opt::Opt) -> libceed::Result<()> { in example_3()
68 println!(" Ceed specification [-c] : {}", ceed_spec); in example_3()
69 println!(" Mesh dimension [-d] : {}", dim); in example_3()
70 println!(" Mesh degree [-m] : {}", mesh_degree); in example_3()
71 println!(" Solution degree [-p] : {}", solution_degree); in example_3()
72 println!(" Num. 1D quadr. pts [-q] : {}", num_qpts); in example_3()
73 println!(" Approx. # unknowns [-s] : {}", problem_size); in example_3()
130 // Create a Vector with the mesh coordinates in example_3()
133 // Apply a transformation to the mesh coordinates in example_3()
137 // -- QFunction from user closure in example_3()
159 qdata[i + q * 0] = weights[i] * (j11 * j22 - j21 * j12); in example_3()
161 let qw = weights[i] / (j11 * j22 - j21 * j12); in example_3()
164 qdata[i + q * 3] = -qw * (j11 * j12 + j21 * j22); in example_3()
170 let mut a = [0.0; 9]; in example_3() localVariable
173 a[k * 3 + j] = jacobian[i + q * ((j + 1) % 3 + 3 * ((k + 1) % 3))] in example_3()
175 - jacobian[i + q * ((j + 1) % 3 + 3 * ((k + 2) % 3))] in example_3()
181 * (jacobian[i + q * 0] * a[0 * 3 + 0] in example_3()
182 + jacobian[i + q * 1] * a[0 * 3 + 1] in example_3()
183 + jacobian[i + q * 2] * a[0 * 3 + 2]); in example_3()
185 / (jacobian[i + q * 0] * a[0 * 3 + 0] in example_3()
186 + jacobian[i + q * 1] * a[0 * 3 + 1] in example_3()
187 + jacobian[i + q * 2] * a[0 * 3 + 2]); in example_3()
190 * (a[0 * 3 + 0] * a[0 * 3 + 0] in example_3()
191 + a[0 * 3 + 1] * a[0 * 3 + 1] in example_3()
192 + a[0 * 3 + 2] * a[0 * 3 + 2]); in example_3()
194 * (a[1 * 3 + 0] * a[1 * 3 + 0] in example_3()
195 + a[1 * 3 + 1] * a[1 * 3 + 1] in example_3()
196 + a[1 * 3 + 2] * a[1 * 3 + 2]); in example_3()
198 * (a[2 * 3 + 0] * a[2 * 3 + 0] in example_3()
199 + a[2 * 3 + 1] * a[2 * 3 + 1] in example_3()
200 + a[2 * 3 + 2] * a[2 * 3 + 2]); in example_3()
202 * (a[1 * 3 + 0] * a[2 * 3 + 0] in example_3()
203 + a[1 * 3 + 1] * a[2 * 3 + 1] in example_3()
204 + a[1 * 3 + 2] * a[2 * 3 + 2]); in example_3()
206 * (a[0 * 3 + 0] * a[2 * 3 + 0] in example_3()
207 + a[0 * 3 + 1] * a[2 * 3 + 1] in example_3()
208 + a[0 * 3 + 2] * a[2 * 3 + 2]); in example_3()
210 * (a[0 * 3 + 0] * a[1 * 3 + 0] in example_3()
211 + a[0 * 3 + 1] * a[1 * 3 + 1] in example_3()
212 + a[0 * 3 + 2] * a[1 * 3 + 2]); in example_3()
226 // -- QFunction for use with Operator in example_3()
250 // -- QFunction from user closure in example_3()
312 // -- QFunction for use with Operator in example_3()
342 volume - exact_volume in example_3()
347 _ => 1E-5, in example_3()
349 let error = (volume - exact_volume).abs(); in example_3()
354 "Volume error too large - expected: {:.12e}, actual: {:.12e}", in example_3()
362 // ----------------------------------------------------------------------------
364 // ----------------------------------------------------------------------------
377 problem_size_requested: -1, in example_3_1d()
392 problem_size_requested: -1, in example_3_2d()
407 problem_size_requested: -1, in example_3_3d()
415 // ----------------------------------------------------------------------------