Skip to content

Commit

Permalink
remove stk_classic references from cmake and examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
prwolfe committed Sep 19, 2018
1 parent 7f077af commit 457ff62
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 1,607 deletions.
14 changes: 0 additions & 14 deletions cmake/dependencies/TrilinosPackageDependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1427,20 +1427,6 @@
</EmailAddresses>
<ParentPackage value=""/>
</Package>
<Package name="STKClassic" dir="packages/stk/stk_classic" type="ST">
<LIB_REQUIRED_DEP_PACKAGES value="Shards,Teuchos"/>
<LIB_OPTIONAL_DEP_PACKAGES value="SEACASIoss,FEI,AztecOO,ThreadPool,Zoltan,Intrepid,Sacado"/>
<TEST_REQUIRED_DEP_PACKAGES value="SEACASExodus"/>
<TEST_OPTIONAL_DEP_PACKAGES/>
<LIB_REQUIRED_DEP_TPLS value="Boost"/>
<LIB_OPTIONAL_DEP_TPLS value="BoostLib,OpenNURBS"/>
<TEST_REQUIRED_DEP_TPLS/>
<TEST_OPTIONAL_DEP_TPLS value="gtest"/>
<EmailAddresses>
<Regression address="[email protected]"/>
</EmailAddresses>
<ParentPackage value="STK"/>
</Package>
<Package name="STKUtil" dir="packages/stk/stk_util" type="ST">
<LIB_REQUIRED_DEP_PACKAGES value="SEACASAprepro_lib"/>
<LIB_OPTIONAL_DEP_PACKAGES/>
Expand Down
1 change: 0 additions & 1 deletion packages/stk/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SET(SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS
Classic stk_classic EX OPTIONAL
Util stk_util PT OPTIONAL
Simd stk_simd PT OPTIONAL
Topology stk_topology PT OPTIONAL
Expand Down
189 changes: 0 additions & 189 deletions packages/trilinoscouplings/examples/scaling/example_Poisson_stk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,195 +990,6 @@ int main(int argc, char *argv[]) {
rhsVector, femCoefficients,
TotalErrorResidual, TotalErrorExactSol);


#ifdef OLD_STK_CLASSIC_STUFF

/**********************************************************************************/
/**************************** CALCULATE ERROR *************************************/
/**********************************************************************************/

if (MyPID == 0) {Time.ResetStartTime();}

double L2err = 0.0;
double L2errTot = 0.0;
double H1err = 0.0;
double H1errTot = 0.0;
double Linferr = 0.0;
double LinferrTot = 0.0;

// Import solution onto current processor
// FIXME
int numNodesGlobal = globalMapG.NumGlobalElements();
Epetra_Map solnMap(numNodesGlobal, numNodesGlobal, 0, Comm);
Epetra_Import solnImporter(solnMap, globalMapG);
Epetra_Vector uCoeff(solnMap);
uCoeff.Import(femCoefficients, solnImporter, Insert);

// Define desired workset size
desiredWorksetSize = numElems;
int numWorksetsErr = numElems/desiredWorksetSize;

// When numElems is not divisible by desiredWorksetSize, increase workset count by 1
if(numWorksetsErr*desiredWorksetSize < numElems) numWorksetsErr += 1;

// Get cubature points and weights for error calc (may be different from previous)
Intrepid::DefaultCubatureFactory<double> cubFactoryErr;
int cubDegErr = 3;
RCP<Intrepid::Cubature<double> > cellCubatureErr = cubFactoryErr.create(cellType, cubDegErr);
int cubDimErr = cellCubatureErr->getDimension();
int numCubPointsErr = cellCubatureErr->getNumPoints();
IntrepidFieldContainer cubPointsErr(numCubPointsErr, cubDimErr);
IntrepidFieldContainer cubWeightsErr(numCubPointsErr);
cellCubatureErr->getCubature(cubPointsErr, cubWeightsErr);

// Evaluate basis values and gradients at cubature points
IntrepidFieldContainer uhGVals(numFieldsG, numCubPointsErr);
IntrepidFieldContainer uhGrads(numFieldsG, numCubPointsErr, spaceDim);
HGradBasis->getValues(uhGVals, cubPointsErr, Intrepid::OPERATOR_VALUE);
HGradBasis->getValues(uhGrads, cubPointsErr, Intrepid::OPERATOR_GRAD);

// Loop over worksets
for(int workset = 0; workset < numWorksetsErr; workset++){

// compute cell numbers where the workset starts and ends
int worksetSize = 0;
int worksetBegin = (workset + 0)*desiredWorksetSize;
int worksetEnd = (workset + 1)*desiredWorksetSize;

// when numElems is not divisible by desiredWorksetSize, the last workset ends at numElems
worksetEnd = (worksetEnd <= numElems) ? worksetEnd : numElems;

// now we know the actual workset size and can allocate the array for the cell nodes
worksetSize = worksetEnd - worksetBegin;
IntrepidFieldContainer cellWorksetEr(worksetSize, numNodesPerElem, spaceDim);
IntrepidFieldContainer worksetApproxSolnCoef(worksetSize, numNodesPerElem);

// loop over cells to fill arrays with coordinates and calculation solution coefficient
int cellCounter = 0;
for(int cell = worksetBegin; cell < worksetEnd; cell++){

// Get element entity from id of cell
stk_classic::mesh::Entity * worksetElem = bulkData.get_entity(elementRank,cell+1);

// get nodes attached to this element
const stk_classic::mesh::PairIterRelation worksetNodes = worksetElem->relations(nodeRank);

// loop over nodes and get coordinates to fill workset array
for (size_t i = 0; i < worksetNodes.size(); i++) {
double * coord = stk_classic::mesh::field_data(*coords, *worksetNodes[i].entity());
cellWorksetEr(cellCounter, i, 0) = coord[0];
cellWorksetEr(cellCounter, i, 1) = coord[1];
cellWorksetEr(cellCounter, i, 2) = coord[2];
int rowIndex = worksetNodes[i].entity()->identifier() - 1;
worksetApproxSolnCoef(cellCounter, i) = uCoeff.Values()[rowIndex];
}

cellCounter++;

} // end cell loop

// Containers for Jacobian
IntrepidFieldContainer worksetJacobianE(worksetSize, numCubPointsErr, spaceDim, spaceDim);
IntrepidFieldContainer worksetJacobInvE(worksetSize, numCubPointsErr, spaceDim, spaceDim);
IntrepidFieldContainer worksetJacobDetE(worksetSize, numCubPointsErr);
IntrepidFieldContainer worksetCubWeightsE(worksetSize, numCubPointsErr);

// Containers for basis values and gradients in physical space
IntrepidFieldContainer uhGValsTrans(worksetSize,numFieldsG, numCubPointsErr);
IntrepidFieldContainer uhGradsTrans(worksetSize, numFieldsG, numCubPointsErr, spaceDim);

// compute cell Jacobians, their inverses and their determinants
IntrepidCTools::setJacobian(worksetJacobianE, cubPointsErr, cellWorksetEr, cellType);
IntrepidCTools::setJacobianInv(worksetJacobInvE, worksetJacobianE );
IntrepidCTools::setJacobianDet(worksetJacobDetE, worksetJacobianE );

// map cubature points to physical frame
IntrepidFieldContainer worksetCubPoints(worksetSize, numCubPointsErr, cubDimErr);
IntrepidCTools::mapToPhysicalFrame(worksetCubPoints, cubPointsErr, cellWorksetEr, cellType);

// evaluate exact solution and gradient at cubature points
IntrepidFieldContainer worksetExactSoln(worksetSize, numCubPointsErr);
IntrepidFieldContainer worksetExactSolnGrad(worksetSize, numCubPointsErr, spaceDim);
evaluateExactSolution(worksetExactSoln, worksetCubPoints);
evaluateExactSolutionGrad(worksetExactSolnGrad, worksetCubPoints);

// transform basis values to physical coordinates
IntrepidFSTools::HGRADtransformVALUE<double>(uhGValsTrans, uhGVals);
IntrepidFSTools::HGRADtransformGRAD<double>(uhGradsTrans, worksetJacobInvE, uhGrads);

// compute weighted measure
IntrepidFSTools::computeCellMeasure<double>(worksetCubWeightsE, worksetJacobDetE, cubWeightsErr);

// evaluate the approximate solution and gradient at cubature points
IntrepidFieldContainer worksetApproxSoln(worksetSize, numCubPointsErr);
IntrepidFieldContainer worksetApproxSolnGrad(worksetSize, numCubPointsErr, spaceDim);
IntrepidFSTools::evaluate<double>(worksetApproxSoln, worksetApproxSolnCoef, uhGValsTrans);
IntrepidFSTools::evaluate<double>(worksetApproxSolnGrad, worksetApproxSolnCoef, uhGradsTrans);

// get difference between approximate and exact solutions
IntrepidFieldContainer worksetDeltaSoln(worksetSize, numCubPointsErr);
IntrepidFieldContainer worksetDeltaSolnGrad(worksetSize, numCubPointsErr, spaceDim);
IntrepidRSTools::subtract(worksetDeltaSoln, worksetApproxSoln, worksetExactSoln);
IntrepidRSTools::subtract(worksetDeltaSolnGrad, worksetApproxSolnGrad, worksetExactSolnGrad);

// take absolute values
IntrepidRSTools::absval(worksetDeltaSoln);
IntrepidRSTools::absval(worksetDeltaSolnGrad);

// apply cubature weights to differences in values and grads for use in integration
IntrepidFieldContainer worksetDeltaSolnWeighted(worksetSize, numCubPointsErr);
IntrepidFieldContainer worksetDeltaSolnGradWeighted(worksetSize, numCubPointsErr, spaceDim);
IntrepidFSTools::scalarMultiplyDataData<double>(worksetDeltaSolnWeighted,
worksetCubWeightsE, worksetDeltaSoln);
IntrepidFSTools::scalarMultiplyDataData<double>(worksetDeltaSolnGradWeighted,
worksetCubWeightsE, worksetDeltaSolnGrad);

// integrate to get errors on each element
IntrepidFieldContainer worksetL2err(worksetSize);
IntrepidFieldContainer worksetH1err(worksetSize);
IntrepidFSTools::integrate<double>(worksetL2err, worksetDeltaSoln,
worksetDeltaSolnWeighted, Intrepid::COMP_BLAS);
IntrepidFSTools::integrate<double>(worksetH1err, worksetDeltaSolnGrad,
worksetDeltaSolnGradWeighted, Intrepid::COMP_BLAS);

// loop over cells to get errors for total workset
cellCounter = 0;
for(int cell = worksetBegin; cell < worksetEnd; cell++){

// loop over cubature points
for(int nPt = 0; nPt < numCubPointsErr; nPt++){

Linferr = std::max(Linferr, worksetDeltaSoln(cellCounter,nPt));

}

L2err += worksetL2err(cellCounter);
H1err += worksetH1err(cellCounter);

cellCounter++;

} // end cell loop

} // end loop over worksets


// sum over all processors
Comm.SumAll(&L2err,&L2errTot,1);
Comm.SumAll(&H1err,&H1errTot,1);
Comm.MaxAll(&Linferr,&LinferrTot,1);

if (MyPID == 0) {
std::cout << "\n" << "L2 Error: " << sqrt(L2errTot) <<"\n";
std::cout << "H1 Error: " << sqrt(H1errTot) <<"\n";
std::cout << "LInf Error: " << LinferrTot <<"\n\n";
}


if(MyPID==0) {std::cout << "Calculate error "
<< Time.ElapsedTime() << " s \n"; Time.ResetStartTime();}

#endif //OLD_STK_CLASSIC_STUFF

return 0;

}
Expand Down
Loading

0 comments on commit 457ff62

Please sign in to comment.