wolffd@0: function pot = scgpot(ddom, cheaddom, ctaildom, node_sizes, scgpotc) wolffd@0: % SCGPOT Make a stable CG potential. wolffd@0: % pot = scgpot(ddom, cheaddom, ctaildom, node_sizes, scgpotc) wolffd@0: % wolffd@0: % ddom is discrete nodes contains in the potential wolffd@0: % cheaddom is head nodes constains in the potential wolffd@0: % ctaildom is tail nodes contains in the potential wolffd@0: % node_sizes(i) is the size of the i'th node. wolffd@0: % scgpotc is list of scgcpot objects. wolffd@0: wolffd@0: pot.ddom = ddom; wolffd@0: pot.cheaddom = cheaddom; wolffd@0: pot.ctaildom = ctaildom; wolffd@0: pot.domain = myunion(ddom, myunion(cheaddom, ctaildom)); wolffd@0: pot.dsizes = node_sizes(pot.ddom); wolffd@0: pot.dsize = prod(node_sizes(pot.ddom)); wolffd@0: pot.cheadsizes = node_sizes(pot.cheaddom); wolffd@0: pot.cheadsize = sum(node_sizes(pot.cheaddom)); wolffd@0: pot.ctailsizes = node_sizes(pot.ctaildom); wolffd@0: pot.ctailsize = sum(node_sizes(pot.ctaildom)); wolffd@0: wolffd@0: if nargin < 5 wolffd@0: scgpotc = cell(1, pot.dsize); wolffd@0: for i=1:pot.dsize wolffd@0: scgpotc{i} = scgcpot(pot.cheadsize, pot.ctailsize); wolffd@0: end wolffd@0: end wolffd@0: pot.scgpotc = scgpotc; wolffd@0: wolffd@0: pot = class(pot, 'scgpot');