function pbeDefinition = roundingRatioCommon(par)

%% Name and information
pbeDefinition.name = 'commonPbeDefinition';
pbeDefinition.info = ['potash alum crystal with normalized mean width is ' ...
    'abraded while different parameters for the rounding ratio apply'];
pbeDefinition.source = ['Ma et al. 2008: "Morphological Population ' ...
    'Balance for Modeling Crystal Growth in Face Directions"'];

%% sensible parameters
if ~exist('par', 'var'),par = struct();end
if ~isfield(par, 'kAttritionMax')
    par.kAttritionMax = 1;
end
if ~isfield(par, 'attritionSlope')
    par.attritionSlope = -5;
end
if ~isfield(par, 'qGrowth')
    par.qGrowth = 0;
end

%% initial condition
pbeDefinition.dec = obtainCrystalDec('generic_potash_alum', 3);
par.hC = [1 1.2 1.1]';
hrep.A = pbeDefinition.dec.cdef.A;
hrep.h = pbeDefinition.dec.cdef.groupMappingMatrix * par.hC;
% viewPolytope(hrep)
par.hC = par.hC / computeMeanWidthHrep(hrep);

% decomposition data
pbeDefinition.dec = addMeasureDataDec(pbeDefinition.dec, 'volume');
pbeDefinition.dec = addMeasureDataDec(pbeDefinition.dec, 'surface');
pbeDefinition.dec = addMeasureDataDec(pbeDefinition.dec, 'mean width');

% assign to pbeDefinition
pbeDefinition.nDecCoordinate = 3;
pbeDefinition.nExtraCoordinate = 1;
pbeDefinition.seeding.time = 0;
pbeDefinition.seeding.positionMatrix = [par.hC; 0];
pbeDefinition.seeding.numberVector = 1;


%% governing rate and timing
gAttrition = @(t)(-1);
pbeDefinition.timeSpan = [0:0.01:0.99 0.991:0.001:0.999];

%% pivot measures
% they are put outside:
nC = 3;
run partPivotMeasures
%  1 - up
%  2 - kernel volume
%  3 - kernel surface area
%  4 - kernel mean width
%  5 - total volume
%  6 - total surface area
%  7 - total mean width
%  8 - muB1
%  9 - muB2
%  10 - muB3
pbeDefinition.pivotProperty = @(H, up)(...
    [up; ...
     pivotMeasures(H, up)]);

%% set growth dynamics
par.finiteDiff = 2e-8;
par.lamMin = 1e-8;
physicalRateGrowth = @(H, P, y, t)(0*H(1:nC, :));
run partGrowthDynamic

%% bulk properties
% 1 - vol total
% 2 - surf total
% 3 - mw total
% 4 - muB1
% 5 - muB2
% 6 - muB3
pbeDefinition.bulkProperty = @(P, N, x, t)([...
    sum(P(5:10,:), 2) ...
    ]);   

% pbeDefinition.bulkRate = @(y, t)([]);
% pbeDefinition.bulkInitial = bulkInitial;

pbeDefinition.optionStruct.relTol = 1e-7;
pbeDefinition.optionStruct.odeSolver = @ode45;
pbeDefinition.optionStruct.distanceLimit = 1e-6;