CPML_ini_elastic.c 1.66 KB
Newer Older
Simone Butzer's avatar
Simone Butzer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
/*------------------------------------------------------------------------
 * Copyright (C) 2015 For the list of authors, see file AUTHORS.
 *
 * This file is part of IFOS3D.
 * 
 * IFOS3D is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 2.0 of the License only.
 * 
 * IFOS3D is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with IFOS3D. See file COPYING and/or 
 * <http://www.gnu.org/licenses/gpl-2.0.html>.
--------------------------------------------------------------------------*/

/*------------------------------------------------------------------------
 *  Definition of CPML boundary domains for each submodel
 *  ----------------------------------------------------------------------*/

#include "fd.h"

void CPML_ini_elastic(int * xb, int * yb, int * zb){


	extern int NX, NY, NZ, POS[4], NPROCX, NPROCY, NPROCZ, FW, FREE_SURF;

        xb[0]=1; 
	xb[1]=NX;
	yb[0]=1; 
	yb[1]=NY;
	zb[0]=1;
        zb[1]=NZ;


/* PML domain in x-direction*/

	if (POS[1]==0){
	xb[0]=FW+1;
	}

        if (POS[1]==NPROCX-1){
        xb[1]=NX-FW;
	}


/* PML domain in y-direction*/

        if (POS[2]==0 && FREE_SURF==0){
	yb[0]=FW+1;
	}

        if (POS[2]==NPROCY-1){
	yb[1]=NY-FW;
	}


/* PML domain in z-direction*/

        if (POS[3]==0){
	zb[0]=FW+1;
	}

        if (POS[3]==NPROCZ-1){
	zb[1]=NZ-FW;
	}

}