9 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
15 #include "../analyses/analyses.h"
39 Node::Node(
int node_id,
int node_sid,
int io_index,
bool node_clone,
IoModel* iomodel,
int node_analysis,
int in_approximation,
bool isamr){
47 this->
clone = node_clone;
52 for(
int k=0;k<3;k++)
for(
int l=0;l<3;l++) this->
coord_system[k][l]=0.0;
93 for(
int i=0;i<this->
gsize;i++){
94 this->
f_set[i] =
true;
95 this->
s_set[i] =
false;
107 _assert_(iomodel->
Data(
"md.stressbalance.referential"));
114 _assert_(iomodel->
Data(
"md.flowequation.vertex_equation"));
122 if(!reCast<int>(iomodel->
Data(
"md.mesh.vertexonbase")[io_index])){
127 if(!reCast<int>(iomodel->
Data(
"md.mesh.vertexonbase")[io_index])){
128 for(
int k=0;k<=1;k++) this->
FreezeDof(k);
153 if(!(reCast<bool>(iomodel->
Data(
"md.mesh.vertexonbase")[io_index]))){
164 if(!(reCast<bool>(iomodel->
Data(
"md.mesh.vertexonsurface")[io_index]))){
196 output->
id = this->
id;
204 for(
int k=0;k<3;k++)
for(
int l=0;l<3;l++) output->
coord_system[k][l]=this->coord_system[k][l];
208 output->
gsize = this->gsize;
209 output->
fsize = this->fsize;
210 output->
ssize = this->ssize;
211 output->
clone = this->clone;
212 output->
active = this->active;
213 output->
freeze = this->freeze;
232 memcpy(output->
f_set,this->f_set,output->
gsize*
sizeof(
bool));
233 memcpy(output->
s_set,this->s_set,output->
gsize*
sizeof(
bool));
234 xMemCpy<IssmDouble>(output->
svalues,this->svalues,output->
gsize);
236 memcpy(output->
gdoflist,this->gdoflist,output->
gsize*
sizeof(
int));
240 memcpy(output->
fdoflist,this->fdoflist,output->
fsize*
sizeof(
int));
244 memcpy(output->
sdoflist,this->sdoflist,output->
ssize*
sizeof(
int));
251 void Node::Marshall(
char** pmarshalled_data,
int* pmarshalled_data_size,
int marshall_direction){
303 for(i=0;i<this->
gsize;i++){
309 for(i=0;i<
gsize;i++){
316 _printf_(
" g_doflist (" << this->gsize <<
"): |");
319 _printf_(
" g_doflist_local (" << this->gsize <<
"): |");
326 _printf_(
" f_doflist_local (" << this->fsize <<
"): |");
333 _printf_(
" s_doflist_local (" << this->ssize <<
"): |");
370 for(
int k=0;k<3;k++)
for(
int l=0;l<3;l++) coord_system_out[3*k+l]=this->
coord_system[k][l];
409 for(i=0;i<this->
gsize;i++){
410 if(
doftype[i]==approximation_enum){
423 for(i=0;i<this->
gsize;i++){
425 if(
doftype[i]==approximation_enum){
439 for(i=0;i<this->
gsize;i++){
441 if(
doftype[i]==approximation_enum){
472 for(i=0;i<this->
gsize;i++){
473 if(
doftype[i]==approximation_enum){
486 for(i=0;i<this->
gsize;i++){
488 if(
doftype[i]==approximation_enum){
502 for(i=0;i<this->
gsize;i++){
504 if(
doftype[i]==approximation_enum){
526 if(setenum==
GsetEnum)
for(i=0;i<this->
gsize;i++) outdoflist[i]=i;
529 for(i=0;i<this->
gsize;i++){
538 for(i=0;i<this->
gsize;i++){
552 for(i=0;i<this->
gsize;i++){
553 if(
doftype[i]==approximation_enum){
554 outdoflist[count]=count;
560 else for(i=0;i<this->
gsize;i++) outdoflist[i]=i;
567 for(i=0;i<this->
gsize;i++){
568 if(
doftype[i]==approximation_enum){
570 outdoflist[count]=count2;
581 for(i=0;i<this->
gsize;i++){
593 for(i=0;i<this->
gsize;i++){
594 if(
doftype[i]==approximation_enum){
596 outdoflist[count]=count2;
606 for(i=0;i<this->
gsize;i++){
637 for(
int i=0;i<this->
gsize;i++){
638 this->
f_set[i] =
true;
639 this->
s_set[i] =
false;
662 values=xNew<IssmDouble>(this->
ssize);
664 for(i=0;i<this->
gsize;i++){
666 values[count]=this->
svalues[i];
667 _assert_(!xIsNan<IssmDouble>(values[count]));
677 xDelete<IssmDouble>(values);
687 for(
int i=0;i<this->
gsize;i++){
688 this->
f_set[i] =
false;
689 this->
s_set[i] =
true;
701 if(this->
f_set[dof] == 0){
702 if(this->
freeze)
_error_(
"Cannot change dof of frozen node");
715 if(this->
f_set[dof] == 1){
759 for(i=0;i<this->
gsize;i++){
760 if(this->
doftype[i]==approximation_enum) numdofs++;
763 else numdofs=this->
gsize;
768 for(i=0;i<this->
gsize;i++){
769 if((this->
doftype[i]==approximation_enum) && (this->
f_set[i])) numdofs++;
772 else numdofs=this->
fsize;
777 for(i=0;i<this->
gsize;i++){
778 if((this->
doftype[i]==approximation_enum) && (this->
s_set[i])) numdofs++;
781 else numdofs=this->
ssize;
834 int* indices = xNew<int>(this->
fsize);
838 for(
int i=0;i<this->
gsize;i++){
850 xDelete<IssmDouble>(values);
851 xDelete<int>(indices);
854 int* indices = xNew<int>(this->
ssize);
858 for(
int i=0;i<this->
gsize;i++){
870 xDelete<IssmDouble>(values);
871 xDelete<int>(indices);
882 int* indices = xNew<int>(this->
fsize);
886 for(
int i=0;i<this->
gsize;i++){
892 indices[count]=this->
fdoflist[count];
898 xDelete<IssmDouble>(values);
899 xDelete<int>(indices);
911 for(
int i=0;i<this->
gsize;i++)
if(
f_set[i])size++;
926 for(
int i=0;i<this->
gsize;i++)
if(
s_set[i])size++;
946 int dofcount=*pdofcount;
952 dofcount+=this->
gsize;
957 dofcount+=this->
fsize;
962 dofcount+=this->
ssize;
1038 int* ndof_list=NULL;
1039 int *doflist = NULL;
1044 ndof_list=xNew<int>(numnodes);
1048 for(i=0;i<numnodes;i++){
1050 numdof+=ndof_list[i];
1055 doflist=xNew<int>(numdof);
1059 for(i=0;i<numnodes;i++){
1060 nodes[i]->
GetDofList(&doflist[count],approximation,setenum);
1061 count+=ndof_list[i];
1067 xDelete<int>(ndof_list);
1074 int i,j,count,numdof,numgdof;
1075 int* ndof_list=NULL;
1076 int* ngdof_list_cumulative=NULL;
1077 int *doflist = NULL;
1081 ndof_list=xNew<int>(numnodes);
1082 ngdof_list_cumulative=xNew<int>(numnodes);
1087 for(i=0;i<numnodes;i++){
1090 ngdof_list_cumulative[i]=numgdof;
1095 numdof +=ndof_list[i];
1100 doflist=xNew<int>(numdof);
1104 for(i=0;i<numnodes;i++){
1106 count+=ndof_list[i];
1111 for(i=0;i<numnodes;i++){
1112 for(j=0;j<ndof_list[i];j++){
1113 doflist[count+j]+=ngdof_list_cumulative[i];
1115 count+=ndof_list[i];
1122 xDelete<int>(ndof_list);
1123 xDelete<int>(ngdof_list_cumulative);
1134 for(
int i=0;i<numnodes;i++){
1138 return numberofdofs;