|
@@ -199,7 +199,7 @@ namespace Lemma {
|
199
|
199
|
|
200
|
200
|
|
201
|
201
|
|
202
|
|
- void FEM4EllipticPDE::Solve( const std::string& resfile) {
|
|
202
|
+ void FEM4EllipticPDE::Solve( const std::string& resfile ) {
|
203
|
203
|
ConstructAMatrix();
|
204
|
204
|
//ConstructLoadVector();
|
205
|
205
|
|
|
@@ -213,10 +213,10 @@ namespace Lemma {
|
213
|
213
|
Eigen::ConjugateGradient< Eigen::SparseMatrix<Real> > cg(A);
|
214
|
214
|
|
215
|
215
|
//Eigen::BiCGSTAB<Eigen::SparseMatrix<Real> > cg(A);
|
216
|
|
- cg.setMaxIterations(3000);
|
217
|
|
- cg.setTolerance(1e-28);
|
|
216
|
+ //cg.setMaxIterations(3000);
|
|
217
|
+ //cg.setTolerance(1e-28);
|
218
|
218
|
|
219
|
|
- std::cout << " rows\tcols\n";
|
|
219
|
+ std::cout << " rows\tcols\n";
|
220
|
220
|
std::cout << "A: " << A.rows() << "\t" << A.cols() << std::endl;
|
221
|
221
|
std::cout << "g: " << g.rows() << "\t" << g.cols() << std::endl;
|
222
|
222
|
|
|
@@ -265,8 +265,8 @@ namespace Lemma {
|
265
|
265
|
A.resize(vtkGrid->GetNumberOfPoints(), vtkGrid->GetNumberOfPoints());
|
266
|
266
|
std::vector< Eigen::Triplet<Real> > coeffs;
|
267
|
267
|
|
268
|
|
- if ( !vtkGrid->GetPointData()->GetScalars("vtkValidPointMask") ) {
|
269
|
|
- throw std::runtime_error("No vtkValidPointMask");
|
|
268
|
+ if ( !vtkGrid->GetPointData()->GetScalars("HomogeneousDirichlet") ) {
|
|
269
|
+ throw std::runtime_error("No HomogeneousDirichlet boundary conditions in input file.");
|
270
|
270
|
}
|
271
|
271
|
|
272
|
272
|
if ( !vtkGrid->GetCellData()->GetScalars("G") && !vtkGrid->GetPointData()->GetScalars("G") ) {
|
|
@@ -325,7 +325,7 @@ namespace Lemma {
|
325
|
325
|
/* homogeneous Dirichlet boundary */
|
326
|
326
|
if (jj == ii) {
|
327
|
327
|
// Apply Homogeneous Dirichlet Boundary conditions
|
328
|
|
- Real bb = vtkGrid->GetPointData()->GetScalars("vtkValidPointMask")->GetTuple(ID[ii])[0];
|
|
328
|
+ Real bb = vtkGrid->GetPointData()->GetScalars("HomogeneousDirichlet")->GetTuple(ID[ii])[0];
|
329
|
329
|
Real bdry = (1./(BndryH*BndryH))*BndrySigma*bb; // + sum;
|
330
|
330
|
//Real bdry = GradPhi.col(ii).tail<3>().dot(GradPhi.col(ii).tail<3>())*BndrySigma*bb; // + sum;
|
331
|
331
|
coeffs.push_back( Eigen::Triplet<Real> ( ID[ii], ID[jj], bdry + GradPhi.col(ii).tail<3>().dot(GradPhi.col(jj).tail<3>() ) * V * sigma_bar ) );
|