make_constraints

PURPOSE ^

MAKE_CONSTRAINTS Computes constraint data for micro problem.

SYNOPSIS ^

function [Constraints]=make_constraints(N, bctype)

DESCRIPTION ^

MAKE_CONSTRAINTS   Computes constraint data for micro problem.
   CONSTRAINTS = MAKE_CONSTRAINTS(N, BCTYPE) 
   depending on BCTYPE, 
   - for periodic boundary conditions, node numbers for identified nodes are
     stored in every row of the matrix CONSTRAINTS
   - for dirichlet boundary conditions, the node numbers on the boundary 
     which will be set to zero are stored in one vector CONSTRAINTS

   N=NMICRO  is the number of degrees of freedom per space dimension in the
   micro domain

   BCTYPE is either "dirichlet" or "periodic" and determines the boundary
   condition of the micro problem.
   
   CONSTRAINTS contains information about the micro boundary problem. The
   format depends on whether dirichlet or periodic boundary conditions are
   used. 


   This function should not be modified.


   The code is available at http://anmc.epfl.ch/ and described in 
   further detail in 

   A. Abdulle and A. Nonnenmacher
   "A short and versatile finite element multiscale code for
   homogenization problems"
   Computer Methods in Applied Mechanics and Engineering,
   http://dx.doi.org/10.1016/j.cma.2009.03.019

   Please cite this article in any publication describing research
   performed using the software.


   Email           : assyr.abdulle@epfl.ch and achim.nonnenmacher@epfl.ch
   Last updated    : 04/29/2009 with MATLAB 7.4

   FE_HMM2D is Copyright (C) 2009 A. Abdulle and A. Nonnenmacher. 
   The software is provided free for non-commercial use unter the terms of 
   the GNU General Public License. See "copyright.m" for full details.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Constraints]=make_constraints(N, bctype)
0002 %MAKE_CONSTRAINTS   Computes constraint data for micro problem.
0003 %   CONSTRAINTS = MAKE_CONSTRAINTS(N, BCTYPE)
0004 %   depending on BCTYPE,
0005 %   - for periodic boundary conditions, node numbers for identified nodes are
0006 %     stored in every row of the matrix CONSTRAINTS
0007 %   - for dirichlet boundary conditions, the node numbers on the boundary
0008 %     which will be set to zero are stored in one vector CONSTRAINTS
0009 %
0010 %   N=NMICRO  is the number of degrees of freedom per space dimension in the
0011 %   micro domain
0012 %
0013 %   BCTYPE is either "dirichlet" or "periodic" and determines the boundary
0014 %   condition of the micro problem.
0015 %
0016 %   CONSTRAINTS contains information about the micro boundary problem. The
0017 %   format depends on whether dirichlet or periodic boundary conditions are
0018 %   used.
0019 %
0020 %
0021 %   This function should not be modified.
0022 %
0023 %
0024 %   The code is available at http://anmc.epfl.ch/ and described in
0025 %   further detail in
0026 %
0027 %   A. Abdulle and A. Nonnenmacher
0028 %   "A short and versatile finite element multiscale code for
0029 %   homogenization problems"
0030 %   Computer Methods in Applied Mechanics and Engineering,
0031 %   http://dx.doi.org/10.1016/j.cma.2009.03.019
0032 %
0033 %   Please cite this article in any publication describing research
0034 %   performed using the software.
0035 %
0036 %
0037 %   Email           : assyr.abdulle@epfl.ch and achim.nonnenmacher@epfl.ch
0038 %   Last updated    : 04/29/2009 with MATLAB 7.4
0039 %
0040 %   FE_HMM2D is Copyright (C) 2009 A. Abdulle and A. Nonnenmacher.
0041 %   The software is provided free for non-commercial use unter the terms of
0042 %   the GNU General Public License. See "copyright.m" for full details.
0043 
0044 %
0045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0046 
0047 
0048 switch(lower(bctype))
0049     case{'periodic'}
0050         % Build periodic boundary condition matrix
0051         % PerConstraints(i,1) and PerConstraints(j,2) specify the nodes that are
0052         % periodic to each other, leaving out the one constraint that are implicitly
0053         % defined by the others already
0054         Constraints(:,1)=[1:N 1:N:N*N-N];
0055         Constraints(:,2)=[(N-1)*N+1:N*N N:N:N*N-N];
0056         
0057     case{'dirichlet'}
0058         % Constraints will contain the boundary nodes
0059         % bottom, top, left, right (not counting same node twice)
0060         Constraints=[1:N N*N-N+1:N*N 1+N:N:N*N-2*N+1 2*N:N:N*N-N];
0061 
0062 end

Generated on Tue 21-Jul-2009 10:55:32 by m2html © 2003