void setConstantDensity(double rho) { _rho=rho; }
void setDensityField(Field densityField) { _densityField=densityField; _densityFieldSet=true;}
- void setLameCoefficient(double lambda, double mu) { _lambda = lambda; _mu = mu;}
+ void setLameCoefficients(double lambda, double mu) { _lambda = lambda; _mu = mu;}
void setYoungAndPoissonModuli(double E, double nu) { _lambda = E*nu/(1+nu)/(1-2*nu); _mu = E/2/(1+nu);}
void setGravity(Vector gravite ) { _gravity=gravite; }
void setMesh(const Mesh &M);
- void setFileName(string fileName){
- _fileName = fileName;
- }
+ void setFileName(string fileName){ _fileName = fileName; }
bool solveStationaryProblem();
Field getOutputDisplacementField();
PCSetType(_pc, _pctype);
//Checking whether all boundary conditions are Neumann boundary condition
- //if(_FECalculation) _onlyNeumannBC = _NdirichletNodes==0;
if(!_neumannValuesSet)//Boundary conditions set via LimitField structure
{
- map<string, LimitFieldStationaryDiffusion>::iterator it = _limitField.begin();
- while(it != _limitField.end() and (it->second).bcType == NeumannStationaryDiffusion)
+ map<string, LimitFieldLinearElasticity>::iterator it = _limitField.begin();
+ while(it != _limitField.end() and (it->second).bcType == NeumannLinearElasticity)
it++;
_onlyNeumannBC = (it == _limitField.end() && _limitField.size()>0);//what if _limitField.size()==0 ???
}
else
_onlyNeumannBC = _neumannBoundaryValues.size()==_mesh.getBoundaryFaceIds().size();
- //Checking whether all boundaries are Neumann boundaries
- map<string, LimitFieldLinearElasticity>::iterator it = _limitField.begin();
- while(it != _limitField.end() and (it->second).bcType == NeumannLinearElasticity)
- it++;
- _onlyNeumannBC = (it == _limitField.end() && _limitField.size()>0);
//If only Neumann BC, then matrix is singular and solution should be sought in space of mean zero vectors
if(_onlyNeumannBC)
{
{
j_int=unknownNodeIndex(Fi.getNodeId(j), _dirichletNodeIds);//indice du noeud j en tant que noeud inconnu
if( _neumannValuesSet )
- coeff =Fi.getMeasure()/_Ndim*_neumannBoundaryValues[Fi.getNodeId(j)];
+ coeff =Fi.getMeasure()/(_Ndim+1)*_neumannBoundaryValues[Fi.getNodeId(j)];
else
- coeff =Fi.getMeasure()/_Ndim*_limitField[_mesh.getNode(Fi.getNodeId(j)).getGroupName()].normalForce;
+ coeff =Fi.getMeasure()/(_Ndim+1)*_limitField[_mesh.getNode(Fi.getNodeId(j)).getGroupName()].normalForce;
VecSetValue(_b, j_int, coeff, ADD_VALUES);
}
}
Cell Cell1,Cell2;
string nameOfGroup;
double inv_dxi, inv_dxj;
- double barycenterDistance;
+ double barycenterDistance,coeff;
Vector normale(_Ndim);
double dn;
PetscInt idm, idn;
{
nameOfGroup = Fj.getGroupName();
- if (_limitField[nameOfGroup].bcType==NeumannLinearElasticity){//Nothing to do
+ if (_limitField[nameOfGroup].bcType==NeumannLinearElasticity){
+ if( _neumannValuesSet )
+ coeff =Fi.getMeasure()*_neumannBoundaryValues[j];
+ else
+ coeff =Fi.getMeasure()*_limitField[nameOfGroup].normalForce;
+ VecSetValue(_b,idm, coeff, ADD_VALUES);
}
else if(_limitField[nameOfGroup].bcType==DirichletLinearElasticity){
barycenterDistance=Cell1.getBarryCenter().distance(Fj.getBarryCenter());