Lines Matching +full:- +full:f
1 // SPDX-FileCopyrightText: Copyright (c) 2017-2024, HONEE contributors.
2 // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause
18 // -- ROTATION (default)
26 // increases to (1.-r/rc), then 0. everywhere else
36 // -- TRANSLATION
44 // increases to (1.-r/rc), then 0. everywhere else
62 // This helper function provides the exact, time-dependent solution and IC formulation for 2D advec…
66 const CeedScalar rc = context->rc; in Exact_AdvectionGeneric()
67 const CeedScalar lx = context->lx; in Exact_AdvectionGeneric()
68 const CeedScalar ly = context->ly; in Exact_AdvectionGeneric()
69 const CeedScalar lz = dim == 2 ? 0. : context->lz; in Exact_AdvectionGeneric()
70 const CeedScalar *wind = context->wind; in Exact_AdvectionGeneric()
78 switch (context->wind_type) { in Exact_AdvectionGeneric()
81 q[1] = -(y - center[1]); in Exact_AdvectionGeneric()
82 q[2] = (x - center[0]); in Exact_AdvectionGeneric()
99 switch (context->initial_condition_type) { in Exact_AdvectionGeneric()
102 CeedScalar r = sqrt(Square(x - x0[0]) + Square(y - x0[1]) + Square(z - x0[2])); in Exact_AdvectionGeneric()
103 switch (context->bubble_continuity_type) { in Exact_AdvectionGeneric()
106 q[4] = r <= rc ? (1. - r / rc) : 0.; in Exact_AdvectionGeneric()
110 q[4] = ((r <= rc) && (y < center[1])) ? (1. - r / rc) : 0.; in Exact_AdvectionGeneric()
114 … q[4] = ((r <= rc) && (y < center[1])) ? (1. - r / rc) * fmin(1.0, (center[1] - y) / 1.25) : 0.; in Exact_AdvectionGeneric()
124 CeedScalar r = sqrt(Square(x - center[0]) + Square(y - center[1])); in Exact_AdvectionGeneric()
125 CeedScalar half_width = context->lx / 2; in Exact_AdvectionGeneric()
131 CeedScalar inflow_to_point[3] = {x - context->lx / 2, y, 0}; in Exact_AdvectionGeneric()
137 …x < boundary_threshold && wind[0] < boundary_threshold) || // outflow at -x boundary in Exact_AdvectionGeneric()
138 …y < boundary_threshold && wind[1] < boundary_threshold) || // outflow at -y boundary in Exact_AdvectionGeneric()
139 …(x > context->lx - boundary_threshold && wind[0] > boundary_threshold) || // outflow at +x bounda… in Exact_AdvectionGeneric()
140 …(y > context->ly - boundary_threshold && wind[1] > boundary_threshold) // outflow at +y bounda… in Exact_AdvectionGeneric()
147 CeedScalar theta = context->wave_frequency * DotN(X, wind, dim) + context->wave_phase; in Exact_AdvectionGeneric()
148 switch (context->wave_type) { in Exact_AdvectionGeneric()
153 q[4] = sin(theta) > 100 * CEED_EPSILON ? 1 : -1; in Exact_AdvectionGeneric()
161 if ((x < boundary_threshold) || (y > ly - boundary_threshold)) { in Exact_AdvectionGeneric()
166 CeedScalar bl_height = ly * context->bl_height_factor; in Exact_AdvectionGeneric()
204 Exact_AdvectionGeneric(2, context->time, x, 5, q, ctx); in ICsAdvection2d()
241 switch (context->stabilization_tau) { in Tau()
246 return context->CtauS / sqrt(DotN(uX, uX, dim)); in Tau()
255 …return 1 / sqrt(Square(2 * context->Ctau_t / context->dt) + DotN(s.Y.velocity, gij_uj, dim) * Squa… in Tau()
256 … Square(context->diffusion_coeff) * DotN(gijd_mat, gijd_mat, dim * dim) * Square(context->Ctau_d)); in Tau()
273 …const CeedScalar(*divFdiff) = context->divFdiff_method != DIV_DIFF_FLUX_PROJ_NONE ? in[5]… in IFunction_AdvectionGeneric()
291 for (CeedInt f = 0; f < 4; f++) { in IFunction_AdvectionGeneric() local
292 for (CeedInt j = 0; j < dim; j++) grad_v[j][f][i] = 0; // No Change in density or momentum in IFunction_AdvectionGeneric()
293 v[f][i] = wdetJ * q_dot[f][i]; // K Mass/transient term in IFunction_AdvectionGeneric()
307 if (context->strong_form) { // Strong Galerkin convection term: v div(E u) in IFunction_AdvectionGeneric()
309 } else { // Weak Galerkin convection term: -dv \cdot (E u) in IFunction_AdvectionGeneric()
310 for (CeedInt j = 0; j < dim; j++) grad_v[j][4][i] = -wdetJ * s.U.E_total * uX[j]; in IFunction_AdvectionGeneric()
316 for (CeedInt i = 0; i < dim; i++) Fe[i] = -context->diffusion_coeff * grad_s[i].U.E_total; in IFunction_AdvectionGeneric()
318 for (CeedInt k = 0; k < dim; k++) grad_v[k][4][i] -= wdetJ * Fe_dXdx[k]; in IFunction_AdvectionGeneric()
323 switch (context->stabilization) { in IFunction_AdvectionGeneric()
330 … CeedScalar divFdiff_i = context->divFdiff_method != DIV_DIFF_FLUX_PROJ_NONE ? divFdiff[i] : 0.; in IFunction_AdvectionGeneric()
364 for (CeedInt f = 0; f < 4; f++) { in MassFunction_AdvectionGeneric() local
365 for (CeedInt j = 0; j < dim; j++) grad_v[j][f][i] = 0; // No Change in density or momentum in MassFunction_AdvectionGeneric()
366 v[f][i] = wdetJ * q_dot[f][i]; // K Mass/transient term in MassFunction_AdvectionGeneric()
377 switch (context->stabilization) { in MassFunction_AdvectionGeneric()
408 …const CeedScalar(*divFdiff) = context->divFdiff_method != DIV_DIFF_FLUX_PROJ_NONE ? in[4] : N… in RHSFunction_AdvectionGeneric()
426 for (CeedInt f = 0; f < 4; f++) { in RHSFunction_AdvectionGeneric() local
427 for (CeedInt j = 0; j < dim; j++) grad_v[j][f][i] = 0; // No Change in density or momentum in RHSFunction_AdvectionGeneric()
428 v[f][i] = 0.; in RHSFunction_AdvectionGeneric()
442 if (context->strong_form) { // Strong Galerkin convection term: v div(E u) in RHSFunction_AdvectionGeneric()
443 v[4][i] = -wdetJ * strong_conv; in RHSFunction_AdvectionGeneric()
445 } else { // Weak Galerkin convection term: -dv \cdot (E u) in RHSFunction_AdvectionGeneric()
453 for (CeedInt i = 0; i < dim; i++) Fe[i] = -context->diffusion_coeff * grad_s[i].U.E_total; in RHSFunction_AdvectionGeneric()
460 switch (context->stabilization) { in RHSFunction_AdvectionGeneric()
465 … CeedScalar divFdiff_i = context->divFdiff_method != DIV_DIFF_FLUX_PROJ_NONE ? divFdiff[i] : 0.; in RHSFunction_AdvectionGeneric()
466 grad_v[j][4][i] -= wdetJ * TauS * (strong_conv + divFdiff_i) * uX[j]; in RHSFunction_AdvectionGeneric()
502 const CeedScalar E_wind = context->E_wind; in Advection_InOutFlowGeneric()
503 const CeedScalar strong_form = context->strong_form; in Advection_InOutFlowGeneric()
504 const bool is_implicit = context->implicit; in Advection_InOutFlowGeneric()
513 wdetJb *= is_implicit ? -1. : 1.; in Advection_InOutFlowGeneric()
523 v[4][i] = -(1 - strong_form) * wdetJb * E * u_normal; in Advection_InOutFlowGeneric()
525 v[4][i] = -(1 - strong_form) * wdetJb * E_wind * u_normal; in Advection_InOutFlowGeneric()
558 ScaleN(F_diff, -context->diffusion_coeff, dim); in DivDiffusiveFluxVolumeRHS_AdvDif_Generic()
563 for (CeedInt k = 0; k < dim; k++) Grad_v[k][i] = -wdetJ * F_diff_dXdx[k]; in DivDiffusiveFluxVolumeRHS_AdvDif_Generic()
595 ScaleN(F_diff, -context->diffusion_coeff, dim); in DivDiffusiveFluxBoundaryRHS_AdvDif_Generic()
630 ScaleN(F_diff, -context->diffusion_coeff, dim); in DiffusiveFluxRHS_AdvDif_Generic()