classdef(Hidden) pde3DBCImpl < pde.internal.pdeBCImpl
  %pde3DBCImpl Implement a pdebound function for 3D boundary conditions
  %
  % This undocumented function may be changed or removed in a future release.
  
  %       Copyright 2014-2020 The MathWorks, Inc.
  
  properties(Access=private)
    faceBoundaryConditions;
    points, edges, numPoints, numEdges, time, uN, uxN, uyN, gotTime, gotU;
    numDirichletNodes, dim, sfCalc, dsfCalc, numIntPoints, intRule, rs, numNormalsPerFacet;
  end
  
  methods
    function obj = pde3DBCImpl(myPde,bc,isR2016b,interfaceConditionsPermitted,varargin)
      obj@pde.internal.pdeBCImpl(myPde);
      obj.copyBoundaryConditionsArray(bc,isR2016b);
      if ~isempty(varargin)
          obj.generateBoundaryFacetData(interfaceConditionsPermitted,varargin{:});
      else
          obj.generateBoundaryFacetData(interfaceConditionsPermitted);
      end
      obj.setIntegrationRule;
      obj.numDirichletNodes = 0;
    end
    bmat = getBCMatrices(self,u,time,matlist);
  end % methods
  
  methods(Access=private)
    % Class methods defined outside of this file.
    generateBoundaryFacetData(self,interfaceConditionsPermitted,varargin);
    setIntegrationRule(self);
    copyBoundaryConditionsArray(self,bc,isR2016b);
    setValueBCOnFace(self, bc, dirBoundaryConditions);
    [Qi, Gi] = setNeumannBCOnFace(self, bc);
    setDirichletBCOnFace(self, bci, dirBoundaryConditions);
    rh = callDirichletFuncOnFace(self, bc, nodes, func, faceNormals, t12);
    qg = callNeumannFuncOnFace(self, bc, xyz, sPts, func, faceNormVec, uPoints, t12);
    rMat = callValueFuncOnFace(self, bc, nodes, func, faceNormals);
    faceNormals = calcFaceNormalsAtNodes(self, faces, nodes);
    appRegion = applicationRegion(self,locations, normals);
  end % methods
  
  methods(Static, Access=private)
    function nodes=getNodesForFacets(faces)
      nodes = unique(faces(:));
    end
  end % methods
  
end

