1! This software is Copyright (c) 2012-2015 The Regents of the 2! University of California. All Rights Reserved. 3! 4! Permission to copy and modify this software and its documentation 5! for educational, research and non-profit purposes, without fee, 6! and without a written agreement is hereby granted, provided that 7! the above copyright notice, this paragraph and the following three 8! paragraphs appear in all copies. 9! 10! Permission to make commercial use of this software may be obtained 11! by contacting: 12! 13! Technology Transfer Office 14! 9500 Gilman Drive, Mail Code 0910 15! University of California 16! La Jolla, CA 92093-0910 17! (858) 534-5815 18! invent@ucsd.edu 19! 20! This software program and documentation are copyrighted by The 21! Regents of the University of California. The software program and 22! documentation are supplied "as is", without any accompanying 23! services from The Regents. The Regents does not warrant that the 24! operation of the program will be uninterrupted or error-free. The 25! end-user understands that the program was developed for research 26! purposes and is advised not to rely exclusively on the program for 27! any reason. 28! 29! IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY 30! PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL 31! DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS 32! SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 33! CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34! THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY 35! WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 36! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE 37! SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE 38! UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE 39! MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 40 41 SUBROUTINE ADDBCMUL(op_Type, nFaces, dof, nNo, mynNo, commu, face, 42 2 X, Y) 43 44 INCLUDE "svLS_STD.h" 45 46 INTEGER, INTENT(IN) :: op_type, nFaces, dof, nNo, mynNo 47 TYPE(svLS_commuType), INTENT(IN) :: commu 48 TYPE(svLS_faceType), INTENT(IN) :: face(nFaces) 49 REAL*8, INTENT(IN) :: X(dof, nNo) 50 REAL*8, INTENT(INOUT) :: Y(dof, nNo) 51 52 INTEGER faIn, i, a, Ac, nsd 53 REAL*8 S, DOTV 54 REAL*8, ALLOCATABLE :: v(:,:), coef(:) 55 56 ALLOCATE(coef(nFaces)) 57 58 IF (op_Type .EQ. BCOP_TYPE_ADD) THEN 59 coef = face%res 60 ELSE IF(op_Type .EQ. BCOP_TYPE_PRE) THEN 61 coef = -face%res/(1D0 + face%res*face%nS) 62 ELSE 63 PRINT *, "op_Type is not defined" 64 STOP 65 END IF 66 67 DO faIn=1, nFaces 68 nsd = MIN(face(faIn)%dof,dof) 69 IF (face(faIn)%coupledFlag) THEN 70 IF (face(faIn)%sharedFlag) THEN 71 IF (.NOT.ALLOCATED(v)) ALLOCATE(v(dof,nNo)) 72 v = 0D0 73 DO a=1, face(faIn)%nNo 74 Ac = face(faIn)%glob(a) 75 DO i=1, nsd 76 v(i,Ac) = face(faIn)%valM(i,a) 77 END DO 78 END DO 79 S = coef(faIn)*DOTV(dof, mynNo, commu, v, X) 80 DO a=1, face(faIn)%nNo 81 Ac = face(faIn)%glob(a) 82 DO i=1, nsd 83 Y(i,Ac) = Y(i,Ac) + v(i,Ac)*S 84 END DO 85 END DO 86 ELSE 87 S = 0D0 88 DO a=1, face(faIn)%nNo 89 Ac = face(faIn)%glob(a) 90 DO i=1, nsd 91 S = S + face(faIn)%valM(i,a)*X(i,Ac) 92 END DO 93 END DO 94 S = coef(faIn)*S 95 DO a=1, face(faIn)%nNo 96 Ac = face(faIn)%glob(a) 97 DO i=1, nsd 98 Y(i,Ac) = Y(i,Ac) + face(faIn)%valM(i,a)*S 99 END DO 100 END DO 101 END IF 102 END IF 103 END DO 104 105 RETURN 106 END SUBROUTINE ADDBCMUL 107