45 lines
1.9 KiB
Matlab
45 lines
1.9 KiB
Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%Function: specify contact geometry entities
|
|
%
|
|
%input: Problem=0:test problem of two blocks
|
|
% 1:Hertz problem
|
|
% Slave_or_Master= 0:slave segment
|
|
% 1:master segment
|
|
%
|
|
%output: p,n,Xi,P,W=NURBS parameters for the output segment(in 2D, it's a curve)
|
|
% n_q=number of integral points within one element segment
|
|
% patch=the patch number that the segement attached to
|
|
% Global_ID=global ids of the control points on the curve
|
|
% normal_type= 1:normal is 90 anti-clockise to tangent of the curve
|
|
% 2:normal is 90 clockwise to tangent of the curve
|
|
%
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
function [ P, patch, Global_DOF_ID] = Contact_Geometry(Slave_or_Master, dis_1, dis_2)
|
|
global Nx Ny
|
|
switch Slave_or_Master
|
|
%in problem 0, slave segment is the upper smaller block
|
|
% which patch=2
|
|
case 0
|
|
patch=2;
|
|
[P2,E2,~,~] = Geometry(patch, dis_1, dis_2);
|
|
P=P2(1:Nx+1, 1:2);%接触面的节点坐标,前五个
|
|
Global_Node_ID=[1:(Nx+1)]+(Nx+1)*(Ny+1);
|
|
Global_DOF_ID=[2*(Global_Node_ID(1)-1)+1:2*(Global_Node_ID(end)-1)+2];%接触点对应全局坐标中的索引
|
|
case 1
|
|
patch=1;
|
|
[P1,E1,~,~] = Geometry(patch, dis_1, dis_2);
|
|
P=P1((Nx+1)*Ny+1:(Nx+1)*(Ny+1), 1:2);%接触面的节点,后五个
|
|
Global_Node_ID=[(Nx+1)*Ny+1:(Nx+1)*(Ny+1)];
|
|
Global_DOF_ID=[2*(Global_Node_ID(1)-1)+1:2*(Global_Node_ID(end)-1)+2];;%接触点对应全局刚度矩阵中的索引
|
|
|
|
otherwise
|
|
error('Contact_Geometry:slave_or_master can only be chose between 0 or 1');
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|