[Trilinos-Users] fei::MatrixGraph::initSlaveConstraint(…)

Rijk de Rooij R.deRooij at tudelft.nl
Tue Nov 19 02:30:49 MST 2013


Dear Trilinos user,

I have a question regarding the fei::MatrixGraph::initSlaveConstraint(…) function of the FEI package.
When I run this function I get a segmentation fault, error 139.
My program is as follows:

I have 3 nodes (nodeType = 0), and 2 elements. Each of the two elements is connected to 2 nodes.
Each node has a displacement field of size 6 (fieldID= 0).

My code for applying the slaveconstraint is:

int numIDs = 2;
     int* nodeTypes= new int[2]; nodeTypes[0]= 0; nodeTypes[1] = 0;
     int* nodeIDs  = new int[2]; nodeIDs[0] = 0; nodeIDs[1] = 1;
     int* fieldIDs = new int[2]; fieldIDs[0] = 0; fieldIDs[1] = 0;
     int offsetOfSlave = 0;
     int offsetIntoSlaveField = 0;

     double* weights = new double[12];
     for(int i=0; i<12; i++) weights[i] = 0;
     weights[0] = 1;
     weights[6] = -1;

     double rhsValue = 0.0;

     int ierr = matrixGraph->initSlaveConstraint(2,
                                       nodeTypes,
                                       nodeIDs,
                                       fieldIDs,
                                       offsetOfSlave,
                                       offsetIntoSlaveField,
                                       weights,
                                       rhsValue);

     delete [] fieldIDs;
     delete [] nodeTypes;
     delete [] nodeIDs;
     delete [] weights;


This codes basically relates the first dof of the first node to the first dof of the second node. When I compile and run, this gives ierr=0, as it should.
However, when running matrixGraph->initComplete(), the segmentation error occurs. (When I do not initialize the abovementioned slave constraint, this segmentation error does not occur).
Please note that I run the program on two processes, but the complete assembly is performed on process 0. The fei_log files for the two processes are:

Process 0:

VecSpc: defineFields {0,6}
VecSpc: defineIDTypes {0 }
VecSpc: defineIDTypes {2 }
MatGraph_StiffnessMatrix: initConnectivityBlock symm, blkID=0, num=2, patternID=0
MatGraph_StiffnessMatrix: initConnectivity blkID=0, connID=0
VecSpc: addDOFs*, fID=0, idT=0 {0 1 }
MatGraph_StiffnessMatrix: initConnectivity blkID=0, connID=1
VecSpc: addDOFs*, fID=0, idT=0 {1 2 }
MatGraph_StiffnessMatrix: initSlaveConstraint crID=0, slaveID=0 { (0,0) (1,0) }
VecSpc: addDOFs, fID=0, idT=0 {0 }
VecSpc: addDOFs, fID=0, idT=0 {1 }
MatGraph_StiffnessMatrix: initComplete
VecSpc: initComplete
#   setting ID 2's owner to proc 0
VecSpc: #synchronizeSharedRecords num-field-masks: 1
VecSpc: #     maskID[0]: 1001
VecSpc:   firstLocalOffset_: 0, lastLocalOffset_: 17
#  D_ (pre-removeCouplings):
num rows: 1
0: (6,-1)

And process 1:

VecSpc: defineFields {0,6}
VecSpc: defineIDTypes {0 }
VecSpc: defineIDTypes {2 }
MatGraph_StiffnessMatrix: initComplete
VecSpc: initComplete
VecSpc: #synchronizeSharedRecords num-field-masks: 0
VecSpc:   firstLocalOffset_: 18, lastLocalOffset_: 17
#  D_ (pre-removeCouplings):
num rows: 1
0: (6,-1)
#  D_:
num rows: 1
0: (6,-1)

>From these log files it seems that the segmentation error occurs on process 0, and my codes stops to run in the file fei_MatrixGraph_Impl2.cpp somewhere in between the lines 1425 and 1438.

Could you please give me any insight in why the segmentation error occurs and how to fix it?
If you need any additional information about the program, please tell me.

Kind regards,

Rijk de Rooij



-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20131119/9de79cff/attachment.html 


More information about the Trilinos-Users mailing list