Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amdis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aland, Sebastian
amdis
Commits
9a180be2
Commit
9a180be2
authored
Aug 09, 2012
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tutorial extended
parent
071d8abc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
extensions/tutorial.hpp
extensions/tutorial.hpp
+69
-0
No files found.
extensions/tutorial.hpp
View file @
9a180be2
...
...
@@ -872,6 +872,75 @@ int main(int argc, char* argv[])
The solution is shown in the next pictures. On the left one can see the mesh locally refined on the boundary of a circle:
\image html elliptImplicit.png "Implicit Dirichlet condition at the boundary of a circle" width=300px
\subsection manual_dirichlet_bc Dirichlet boundary condition with mesh indicators
How to solve the problems of AMDiS with Dirichlet condition, with the priority of one condition over the other? How to enforce the essential
boundary conditions independent of the boundary number set in the macro-mesh? The answer is to use manual Dirichlet boundary conditions, also
defined in ExtendedProblemStat.h. There you do not (necessarily) describe the boundary by a boundary number, but by a boundary indicator.
A mesh- or boundary indicator is an AbstractFunction, that return true if the coordinate, where it is evaluated, lies on the desired boundary,
and false otherwise. (Probably it would be better here to use the struct MeshIndictor that has exactly the desired structure). Optionally you can give
also a boundary number so that the combination of both describes the boundary part for the Dirichlet condition:
\code
template<typename ValueContainer>
void addManualDirichletBC(AbstractFunction<bool, WorldVector<double> >* meshIndicator,
int row, int col,
ValueContainer &values);
template<typename ValueContainer>
void addManualDirichletBC(BoundaryType nr, AbstractFunction<bool, WorldVector<double> >* meshIndicator,
int row, int col,
ValueContainer &values);
\endcode
In the next example we want to enforce a Dirichlet boundary condition on the left boundary, that has the x-coordinate 0.0:
\code
struct LeftBoundary : AbstractFunction< bool, WorldVector<double> >
{
bool operator()(const WorldVector<double>& x) const
{
return x[0] < DBL_TOL;
}
};
int main(int argc, char* argv[])
{
AMDiS::init(argc, argv);
// ===== create and init the scalar problem =====
ExtendedProblemStat ellipt("ellipt");
ellipt.initialize(INIT_ALL);
// === create adapt info ===
AdaptInfo adaptInfo("ellipt->adapt", ellipt.getNumComponents());
AdaptStationary adapt("ellipt->adapt", ellipt, adaptInfo);
// ===== create matrix operator =====
Operator matrixOperator(ellipt.getFeSpace());
matrixOperator.addTerm(new Simple_SOT);
ellipt.addMatrixOperator(matrixOperator, 0, 0);
// ===== create rhs operator =====
Operator rhsOperator(ellipt.getFeSpace());
rhsOperator.addTerm(new Simple_ZOT(1.0));
ellipt.addVectorOperator(rhsOperator, 0);
// ===== add boundary conditions =====
double one = 1.0;
ellipt.addManualDirichletBC(new LeftBoundary, 0, 0, one);
// ===== start simulation =====
adapt.adapt();
ellipt.writeFiles(adaptInfo, true);
AMDiS::finalize();
}
\endcode
\image html elliptManual.png "Manual Dirichlet condition at the left boundary of the domain" width=300px
*/
#endif // AMDIS_EXTENSIONS_TUTORIAL_INCLUDE
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment