add.c.svn-base 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Copyright 2010 Intel Corporation
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. //---------------------------------------------------------------------
  17. //---------------------------------------------------------------------
  18. #include "header.h"
  19. void add() {
  20. //---------------------------------------------------------------------
  21. //---------------------------------------------------------------------
  22. //---------------------------------------------------------------------
  23. // addition of update to the vector u
  24. //---------------------------------------------------------------------
  25. int c, i, j, k, m;
  26. for (c = 1; c <= ncells; c++) {
  27. for (k = start(3,c); k <= cell_size(3,c)-end(3,c)-1; k++) {
  28. for (j = start(2,c); j <= cell_size(2,c)-end(2,c)-1; j++) {
  29. for (i = start(1,c); i <= cell_size(1,c)-end(1,c)-1; i++) {
  30. for (m = 1; m <= 5; m++) {
  31. u(m,i,j,k,c) = u(m,i,j,k,c) + rhs(m,i,j,k,c);
  32. }
  33. }
  34. }
  35. }
  36. }
  37. return;
  38. }