예제 #1
0
파일: FEM.cpp 프로젝트: CATSPDEs/CATSPDEs
SymmetricContainer<double> FEM::computeLocalRobinMatrix(BoundaryConditions const & BCs,
                                                        array<Node, 2>& nodes,
                                                        double length) {
	SymmetricContainer<double> r(2);
	r(0, 0) = length * ( 3. * BCs.RobinCoefficient(nodes[0]) +      BCs.RobinCoefficient(nodes[1]) ) / 12.;
	r(0, 1) = length * (      BCs.RobinCoefficient(nodes[0]) +      BCs.RobinCoefficient(nodes[1]) ) / 12.;
	r(1, 1) = length * (      BCs.RobinCoefficient(nodes[0]) + 3. * BCs.RobinCoefficient(nodes[1]) ) / 12.;
	return r;
}
예제 #2
0
파일: FEM.cpp 프로젝트: CATSPDEs/CATSPDEs
array<double, 2> FEM::computeLocalRobinVector(BoundaryConditions const & BCs,
                                              array<Node, 2>& nodes,
                                              double length) {
	array<double, 2> r;
	return (r = {
		4. * BCs.NeumannValue(nodes[0]) + 2. * BCs.NeumannValue(nodes[1]) +
		BCs.DirichletCondition(nodes[0]) * ( 3. * BCs.RobinCoefficient(nodes[0]) + BCs.RobinCoefficient(nodes[1]) ) +
		BCs.DirichletCondition(nodes[1]) * ( BCs.RobinCoefficient(nodes[0]) + BCs.RobinCoefficient(nodes[1]) ),
		2. * BCs.NeumannValue(nodes[0]) + 4. * BCs.NeumannValue(nodes[1]) +
		BCs.DirichletCondition(nodes[0]) * ( BCs.RobinCoefficient(nodes[0]) + BCs.RobinCoefficient(nodes[1]) ) +
		BCs.DirichletCondition(nodes[1]) * ( BCs.RobinCoefficient(nodes[0]) + 3. * BCs.RobinCoefficient(nodes[1]) )
	}) *= length / 12.;
}