| ceed-qfunction.c (5ba4e83e9b1c3504427ca38afe780fb47d34b172) | ceed-qfunction.c (990fdeb6bb8fc9af2da4472bdc0d1f57da5da0e5) |
|---|---|
| 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8#include <ceed/ceed.h> --- 129 unchanged lines hidden (view full) --- 138 int ierr; 139 const char *inout = in ? "Input" : "Output"; 140 char *field_name; 141 ierr = CeedQFunctionFieldGetName(field, &field_name); CeedChk(ierr); 142 CeedInt size; 143 ierr = CeedQFunctionFieldGetSize(field, &size); CeedChk(ierr); 144 CeedEvalMode eval_mode; 145 ierr = CeedQFunctionFieldGetEvalMode(field, &eval_mode); CeedChk(ierr); | 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8#include <ceed/ceed.h> --- 129 unchanged lines hidden (view full) --- 138 int ierr; 139 const char *inout = in ? "Input" : "Output"; 140 char *field_name; 141 ierr = CeedQFunctionFieldGetName(field, &field_name); CeedChk(ierr); 142 CeedInt size; 143 ierr = CeedQFunctionFieldGetSize(field, &size); CeedChk(ierr); 144 CeedEvalMode eval_mode; 145 ierr = CeedQFunctionFieldGetEvalMode(field, &eval_mode); CeedChk(ierr); |
| 146 fprintf(stream, " %s field %d:\n" | 146 fprintf(stream, " %s field %" CeedInt_FMT ":\n" |
| 147 " Name: \"%s\"\n" | 147 " Name: \"%s\"\n" |
| 148 " Size: %d\n" | 148 " Size: %" CeedInt_FMT "\n" |
| 149 " EvalMode: \"%s\"\n", 150 inout, field_number, field_name, size, CeedEvalModes[eval_mode]); 151 return CEED_ERROR_SUCCESS; 152} 153 154/** 155 @brief Set flag to determine if Fortran interface is used 156 --- 812 unchanged lines hidden (view full) --- 969**/ 970int CeedQFunctionView(CeedQFunction qf, FILE *stream) { 971 int ierr; 972 973 fprintf(stream, "%sCeedQFunction - %s\n", 974 qf->is_gallery ? "Gallery " : "User ", 975 qf->is_gallery ? qf->gallery_name : qf->kernel_name); 976 | 149 " EvalMode: \"%s\"\n", 150 inout, field_number, field_name, size, CeedEvalModes[eval_mode]); 151 return CEED_ERROR_SUCCESS; 152} 153 154/** 155 @brief Set flag to determine if Fortran interface is used 156 --- 812 unchanged lines hidden (view full) --- 969**/ 970int CeedQFunctionView(CeedQFunction qf, FILE *stream) { 971 int ierr; 972 973 fprintf(stream, "%sCeedQFunction - %s\n", 974 qf->is_gallery ? "Gallery " : "User ", 975 qf->is_gallery ? qf->gallery_name : qf->kernel_name); 976 |
| 977 fprintf(stream, " %d input field%s:\n", qf->num_input_fields, | 977 fprintf(stream, " %" CeedInt_FMT " input field%s:\n", qf->num_input_fields, |
| 978 qf->num_input_fields>1 ? "s" : ""); 979 for (CeedInt i=0; i<qf->num_input_fields; i++) { 980 ierr = CeedQFunctionFieldView(qf->input_fields[i], i, 1, stream); 981 CeedChk(ierr); 982 } 983 | 978 qf->num_input_fields>1 ? "s" : ""); 979 for (CeedInt i=0; i<qf->num_input_fields; i++) { 980 ierr = CeedQFunctionFieldView(qf->input_fields[i], i, 1, stream); 981 CeedChk(ierr); 982 } 983 |
| 984 fprintf(stream, " %d output field%s:\n", qf->num_output_fields, | 984 fprintf(stream, " %" CeedInt_FMT " output field%s:\n", qf->num_output_fields, |
| 985 qf->num_output_fields>1 ? "s" : ""); 986 for (CeedInt i=0; i<qf->num_output_fields; i++) { 987 ierr = CeedQFunctionFieldView(qf->output_fields[i], i, 0, stream); 988 CeedChk(ierr); 989 } 990 return CEED_ERROR_SUCCESS; 991} 992 --- 33 unchanged lines hidden (view full) --- 1026 if (!qf->Apply) 1027 // LCOV_EXCL_START 1028 return CeedError(qf->ceed, CEED_ERROR_UNSUPPORTED, 1029 "Backend does not support QFunctionApply"); 1030 // LCOV_EXCL_STOP 1031 if (Q % qf->vec_length) 1032 // LCOV_EXCL_START 1033 return CeedError(qf->ceed, CEED_ERROR_DIMENSION, | 985 qf->num_output_fields>1 ? "s" : ""); 986 for (CeedInt i=0; i<qf->num_output_fields; i++) { 987 ierr = CeedQFunctionFieldView(qf->output_fields[i], i, 0, stream); 988 CeedChk(ierr); 989 } 990 return CEED_ERROR_SUCCESS; 991} 992 --- 33 unchanged lines hidden (view full) --- 1026 if (!qf->Apply) 1027 // LCOV_EXCL_START 1028 return CeedError(qf->ceed, CEED_ERROR_UNSUPPORTED, 1029 "Backend does not support QFunctionApply"); 1030 // LCOV_EXCL_STOP 1031 if (Q % qf->vec_length) 1032 // LCOV_EXCL_START 1033 return CeedError(qf->ceed, CEED_ERROR_DIMENSION, |
| 1034 "Number of quadrature points %d must be a " 1035 "multiple of %d", Q, qf->vec_length); | 1034 "Number of quadrature points %" CeedInt_FMT " must be a " 1035 "multiple of %" CeedInt_FMT, Q, qf->vec_length); |
| 1036 // LCOV_EXCL_STOP 1037 qf->is_immutable = true; 1038 ierr = qf->Apply(qf, Q, u, v); CeedChk(ierr); 1039 return CEED_ERROR_SUCCESS; 1040} 1041 1042/** 1043 @brief Destroy a CeedQFunction --- 39 unchanged lines hidden --- | 1036 // LCOV_EXCL_STOP 1037 qf->is_immutable = true; 1038 ierr = qf->Apply(qf, Q, u, v); CeedChk(ierr); 1039 return CEED_ERROR_SUCCESS; 1040} 1041 1042/** 1043 @brief Destroy a CeedQFunction --- 39 unchanged lines hidden --- |