Changeset 4954
- Timestamp:
- 08/03/10 20:59:13 (15 years ago)
- Location:
- issm/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
r3959 r4954 21 21 /*Merge f set back into n set: */ 22 22 u_n=NewVec(nodesets->GetNSize()); 23 VecMerge(u_n,uf,nodesets->GetPV_F(),nodesets->GetFSize());23 if(uf) VecMerge(u_n,uf,nodesets->GetPV_F(),nodesets->GetFSize()); 24 24 25 25 /*merge single point constraints into n set: */ -
issm/trunk/src/c/modules/Reduceloadfromgtofx/Reduceloadfromgtofx.cpp
r3959 r4954 64 64 if (nodesets->GetSSize()){ 65 65 66 VecPartition(&pf, pn, nodesets->GetPV_F(),nodesets->GetFSize()); 66 if(nodesets->GetFSize()){ 67 VecPartition(&pf, pn, nodesets->GetPV_F(),nodesets->GetFSize()); 67 68 68 /*pf = pf - Kfs * y_s;*/69 MatGetLocalSize(Kfs,&Kfsm,&Kfsn);70 Kfsy_s=NewVecFromLocalSize(Kfsm);71 if (flag_ys0){69 /*pf = pf - Kfs * y_s;*/ 70 MatGetLocalSize(Kfs,&Kfsm,&Kfsn); 71 Kfsy_s=NewVecFromLocalSize(Kfsm); 72 if (flag_ys0){ 72 73 73 /*Create y_s0, full of 0: */74 VecDuplicate(y_s,&y_s0);75 VecSet(y_s0,0.0);76 VecAssemblyBegin(y_s0);77 VecAssemblyEnd(y_s0);74 /*Create y_s0, full of 0: */ 75 VecDuplicate(y_s,&y_s0); 76 VecSet(y_s0,0.0); 77 VecAssemblyBegin(y_s0); 78 VecAssemblyEnd(y_s0); 78 79 79 MatMultPatch(Kfs,y_s0,Kfsy_s); 80 MatMultPatch(Kfs,y_s0,Kfsy_s); 81 } 82 else{ 83 MatMultPatch(Kfs,y_s,Kfsy_s); 84 } 85 86 a=-1; 87 VecAXPY(pf,a,Kfsy_s); 80 88 } 81 89 else{ 82 MatMultPatch(Kfs,y_s,Kfsy_s);90 pf=NULL; 83 91 } 84 85 a=-1;86 VecAXPY(pf,a,Kfsy_s);87 92 } 88 93 else{ -
issm/trunk/src/c/modules/Reducematrixfromgtofx/Reducematrixfromgtofx.cpp
r3332 r4954 19 19 //Reduce matrix from n-size to f-size 20 20 if(nodesets->GetSSize()){ 21 22 MatPartition(&Kff, Knn, nodesets->GetPV_F(),nodesets->GetFSize(),nodesets->GetPV_F(),nodesets->GetFSize());23 MatPartition(&Kfs, Knn, nodesets->GetPV_F(),nodesets->GetFSize(),nodesets->GetPV_S(),nodesets->GetSSize());24 21 22 if(nodesets->GetFSize()){ 23 MatPartition(&Kff, Knn, nodesets->GetPV_F(),nodesets->GetFSize(),nodesets->GetPV_F(),nodesets->GetFSize()); 24 MatPartition(&Kfs, Knn, nodesets->GetPV_F(),nodesets->GetFSize(),nodesets->GetPV_S(),nodesets->GetSSize()); 25 } 25 26 } 26 27 else{ -
issm/trunk/src/c/modules/Solverx/Solverx.cpp
r3913 r4954 29 29 PetscTruth flag; 30 30 int solver_type; 31 32 /*First, check that f-set is not NULL, ie model is fully constrained: */ 33 if(!Kff){ 34 *puf=NULL; 35 return; 36 } 31 37 32 38 /*If initial guess for solution exists, use it to create uf, otherwise, -
issm/trunk/src/c/solutions/convergence.cpp
r3913 r4954 31 31 double yts; 32 32 33 /*Check arguments*/ 34 ISSMASSERT(Kff && pf && uf && old_uf); 33 /*If uf is NULL in input, f-set is nil, model is fully constrained, therefore converged from 34 * the get go: */ 35 if(!uf){ 36 *pconverged=1; 37 return; 38 } 35 39 36 40 /*get convergence options*/ -
issm/trunk/src/m/classes/public/ismodelselfconsistent.m
r4891 r4954 188 188 %DIAGNOSTIC{{{1 189 189 if md.analysis_type==DiagnosticSolutionEnum, 190 191 %CHECK THAT WE ARE NOT FULLY CONSTRAINED192 if isempty(find(~md.spcvelocity(:,1:2))),193 error(['model not consistent: model ' md.name ' is totally constrained horizontally, no need to solve!']);194 end195 if (md.dim==3),196 if isempty(find(~md.spcvelocity(:,3))),197 error(['model not consistent: model ' md.name ' is totally constrained vertically, no need to solve!']);198 end199 end200 190 201 191 %HUTTER ON ICESHELF WARNING -
issm/trunk/src/m/solutions/convergence.m
r4778 r4954 1 1 function converged=convergence(K_ff,p_f,u_f,u_f_old,parameters) 2 3 %before we start, check that u_f actually holds values, otherwise, we are done converging 4 if isempty(u_f), converged=true; return; end 2 5 3 6 %Get convergence options -
issm/trunk/src/m/solvers/solver_diagnostic_nonlinear.m
r4839 r4954 34 34 displaystring(femmodel.parameters.Verbose,'%s',' Generating penalty matrices:'); 35 35 [K_gg , p_g, kmax]=PenaltySystemMatrices(K_gg_nopenalty,p_g_nopenalty,femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters); 36 36 37 37 38 displaystring(femmodel.parameters.Verbose,'%s',' reducing matrix from g to f set'); 38 39 [K_ff, K_fs] = Reducematrixfromgtof( K_gg, femmodel.Gmn, femmodel.nodesets); 39 40 40 41 displaystring(femmodel.parameters.Verbose,'%s',' reduce load from g size to f size'); 41 42 p_f = Reduceloadfromgtof( p_g, femmodel.Gmn, K_fs, femmodel.ys, femmodel.nodesets); 42 43 43 44 displaystring(femmodel.parameters.Verbose,'%s',' solving'); 44 45 uf=Solver(K_ff,p_f,old_uf,femmodel.parameters); … … 54 55 55 56 displaystring(femmodel.parameters.Verbose,'%s%i',' number of unstable constraints: ',num_unstable_constraints); 56 57 57 58 %Figure out if convergence have been reached 58 59 converged=convergence(K_ff,p_f,uf,old_uf,femmodel.parameters); -
issm/trunk/test/Verification/test01_IceShelfIceFrontM2d/Square.par
r3757 r4954 2 2 3 3 %dynamics 4 md.verbose= 0;4 md.verbose=1; 5 5 md.dt=1; %1 year 6 6 md.ndt=md.dt*10; … … 36 36 md.time=50; 37 37 md.waitonlock=30; 38 39 %spc all velocities 40 md.spcvelocity(:,1:3)=1; 41 md.spcvelocity(:,4)=0; 42 md.spcvelocity(:,5)=100; 43 md.spcvelocity(:,6)=0;
Note:
See TracChangeset
for help on using the changeset viewer.