Swift-Kuery-PostgreSQL
PostgreSQL plugin for Swift-Kuery framework
Summary
PostgreSQL plugin for the Swift-Kuery framework. It enables you to use Swift-Kuery to manipulate data in PostgreSQL database.
PostgreSQL client installation
To use Swift-Kuery-PostgreSQL you must have the appropriate PostgreSQL C-language client installed.
macOS
$ brew install postgresql
Linux
$ sudo apt-get install libpq-dev
Using Swift-Kuery-PostgreSQL
First create an instance of Swift-Kuery-PostgreSQL
by calling:
let connection = PostgreSQLConnection(host: host, port: port, options: [ConnectionOptions]?)
Where: - host and port are the host and the port of PostgreSQL - ConnectionOptions an optional set of: * options - command-line options to be sent to the server * databaseName - the database name * userName - the user name * password - the user password * connectionTimeout - maximum wait for connection in seconds. Zero or not specified means wait indefinitely.
For more information please see PostgreSQL manual.
Alternatively, call:
swift
let connection = PostgreSQLConnection(url: URL(string: "Postgres://\(username):\(password)@\(host):\(port)")!))
To establish a connection call:
PostgreSQLConnection.connect(onCompletion: (QueryError?) -> ())
You now have a connection that can be used to execute SQL queries created using Swift-Kuery.
Getting Started with Swift-Kuery-PostgreSQL locally
Install PostgreSQL server
Mac
brew install postgresql
Ubuntu Linux
sudo apt-get install postgresql postgresql-contrib
Make sure you have the database running. This installation should have also installed two applications we need, namely (createdb and psql) which will be used as clients to your locally running PostgreSQL.
Create a database
Let’s create a database called school
:
createdb school
Create the tables
Now, let’s create a couple tables we will need.
We will use the interactive session so open up the client to the database we created:
$ psql school
psql (9.5.4)
Type "help" for help.
school=#
First, create the student table:
CREATE TABLE student (
studentId BIGSERIAL PRIMARY KEY,
name varchar(100) NOT NULL CHECK (name <> '')
);
And now, create the grades table:
CREATE TABLE grades (
key BIGSERIAL PRIMARY KEY,
studentId integer NOT NULL,
course varchar(40) NOT NULL,
grade integer
);
Populate the tables
First the students table:
INSERT INTO student VALUES (1, 'Tommy Watson');
INSERT INTO student VALUES (2, 'Fred Flintstone');
And then the grades table:
INSERT INTO grades (studentId, course, grade) VALUES (1, 'How to build your first computer', 99);
INSERT INTO grades (studentId, course, grade) VALUES (2, 'How to work at a rock quarry', 71);
Use Swift-Kuery
Now we are set to connect to our database from Swift and use Swift-Kuery to query our data into our Swift application.
Create simple Swift executable
First create a directory for our project and then initialize it.
$ mkdir swift-kuery-play
$ cd swift-kuery-play
$ swift package init --type executable
Creating executable package: swift-kuery-play
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/main.swift
Creating Tests/
$
Now, add Swift-Kuery as a dependency for our project. Edit Package.swift to contain:
import PackageDescription
let package = Package(
name: "swift-kuery-play",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 1, minor: 7),
.Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1, minor: 7),
.Package(url: "https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL", majorVersion: 0, minor: 10)
]
)
Now, let’s edit your main.swift file to contain:
import SwiftKuery
import SwiftKueryPostgreSQL
import Kitura
import Foundation
import HeliumLogger
HeliumLogger.use()
let router = Router()
class Grades : Table {
let tableName = "grades"
let key = Column("key")
let course = Column("course")
let grade = Column("grade")
let studentId = Column("studentId")
}
let grades = Grades()
let connection = PostgreSQLConnection(host: "localhost", port: 5432, options: [.databaseName("school")])
func grades(_ callback:@escaping (String)->Void) -> Void {
connection.connect() { error in
if let error = error {
callback("Error is \(error)")
return
}
else {
// Build and execute your query here.
// First build query
let query = Select(grades.course, grades.grade, from: grades)
connection.execute(query: query) { result in
if let resultSet = result.asResultSet {
var retString = ""
for title in resultSet.titles {
// The column names of the result.
retString.append("\(title.padding(toLength: 35, withPad: " ", startingAt: 0))")
}
retString.append("\n")
for row in resultSet.rows {
for value in row {
if let value = value {
let valueString = String(describing: value)
retString.append("\(valueString.padding(toLength: 35, withPad: " ", startingAt: 0))")
}
}
retString.append("\n")
}
callback(retString)
}
else if let queryError = result.asError {
// Something went wrong.
callback("Something went wrong \(queryError)")
}
}
}
}
}
router.get("/") {
request, response, next in
grades() {
resp in
response.send(resp)
next()
}
}
// Use port 8080 unless overridden by environment variable
let port = Int(ProcessInfo.processInfo.environment["PORT"] ?? "8080") ?? 8080
Kitura.addHTTPServer(onPort: port, with: router)
Kitura.run()
Now build the program and run it:
$ swift build
$ .build/debug/swift-kuery-play
Now open a web page to http://localhost:8080 and you should see:
course grade
How to build your first computer 99
How to work at a rock quarry 71
Now we can change our query line and see different results.
Change the line:
let query = Select(grades.course, grades.grade, from: grades)
to
let query = Select(grades.course, grades.grade, from: grades)
.where(grades.grade > 80)
and we should only see grades greater than 80:
course grade
How to build your first computer 99
Another possibility is to use QueryResult.asRows
that returns the result as an array of dictionaries where each dictionary represents a row of the result with the column title as the key.
Change your grades
function as following:
func grades(_ callback:@escaping (String)->Void) -> Void {
connection.connect() { error in
if let error = error {
callback("Error is \(error)")
return
}
else {
let query = Select(grades.course, grades.grade, from: grades)
connection.execute(query: query) { result in
if let rows = result.asRows {
var retString = ""
for row in rows {
for (title, value) in row {
retString.append("\(title): \(value! as! String) ")
}
retString.append("\n")
}
callback("\(retString)")
}
else if let queryError = result.asError {
callback("Something went wrong \(queryError)")
}
}
}
}
}
At http://localhost:8080 you should see:
grade: 99 course: How to build your first computer
grade: 71 course: How to work at a rock quarry
License
This library is licensed under Apache 2.0. Full license text is available in LICENSE.


| Class |
Description |
|
AddOp
|
Adds files to the index. |
|
ApplyOp
|
Apply a patch to the index. |
|
BranchAddOp
|
Adds a branch to the repository. |
|
BranchChangeOp
|
Changes a branch's start point and/or upstream branch. |
|
BranchListOp
|
Lists branches in the repository. |
|
BranchRemoveOp
|
Removes one or more branches from the repository. |
|
BranchStatusOp
|
Gets the tracking status of a branch. |
|
CheckoutOp
|
Checks out a branch to the working tree. |
|
CleanOp
|
Remove untracked files from the working tree. |
|
CloneOp
|
Clones an existing repository. |
|
CommitOp
|
Commits staged changes to the repository. |
|
DescribeOp
|
Find the nearest tag reachable. |
|
FetchOp
|
Fetch changes from remotes. |
|
InitOp
|
Initializes a new repository. |
|
LogOp
|
Gets a log of commits in the repository. |
|
LsRemoteOp
|
List references in a remote repository. |
|
MergeOp
|
Merges changes from a single head. |
|
OpenOp
|
Opens an existing repository. |
|
PullOp
|
Pulls changes from the remote on the current branch. |
|
PushOp
|
Push changes to a remote repository. |
|
RemoteAddOp
|
Adds a remote to the repository. |
|
RemoteListOp
|
Lists remotes in the repository. |
|
ResetOp
|
Reset changes in the repository. |
|
RevertOp
|
Revert one or more commits. |
|
RmOp
|
Remove files from the index and (optionally) delete them from the working tree.
|
|
ShowOp
|
Show changes made in a commit.
|
|
StatusOp
|
Gets the current status of the repository. |
|
TagAddOp
|
Adds a tag to the repository. |
|
TagListOp
|
Lists tags in the repository. |
|
TagRemoveOp
|
Removes one or more tags from the repository. |


 Most people interested in doing something like that are gonna be pretty cool to start with. Then you get to ride with them."
"The Pony's a great place to bring the family for a weeked of good skiing and great vibes."
"Had a killer time hangin with all the guys and girls on the bus. Great nights and even better days"


Stone Cold Steve Austin reacts to CM Punk's return
by Abhilash MendheWWE Hall of Famer Stone Cold Steve Austin appeared on the State of Combat podcast earlier this week and discussed a bunch of topics. Austin opened up on former WWE Champion CM Punk working for WWE Backstage.
After he made his shocking appearance on WWE Backstage last week, CM Punk appeared on the show as a special contributor and analyst on this week's edition. The Straight Edge Superstar gave his opinion on Seth Rollins' challenge, and the blue Universal title, among other things.
Also Read: Mandy Rose's father has a request for Otis
Steve Austin discussed Punk's return and shared his views on Punk working for the FS1 show. Austin isn't sure whether this is going to lead to an in-ring return, but he loves the fact that Punk is finally back after splitting with WWE on bad terms.
"I don’t know if it leads to anything more, I guess speculation, to be determined, we’ll find out. Just the fact that he’s returned to be doing business with WWE, I love, because I don’t know, they split up on bad terms, and now they’re back in business together.
"It’s a breath of fresh air because the guy brings a great perspective, great insight, and great opinion on all things sports entertainment.”
We want to know what you think of the matches that you see on TV! Go to our WWE page here and rate and comment what you thought of them!


Python module for interacting with the V3D visualization program.
The v3d python module enables control of the V3D biomedical volume
visualization program from the python programming language. The v3d
module exposes the V3D plug-in API; thus most things that can be done
from a V3D plug-in can also be done interactively from the V3D python
console.
|
|
AspectRatioMode
|
|
|
FillRule
|
|
|
Image4DSimple
Volume image with dimensions X, Y, Z, and time.
|
|
|
ImagePixelType
|
|
|
ImageWindow
A primary TriView window in the V3D interface.
|
|
|
LocationSimple
|
|
|
NeuronSWC
|
|
|
NeuronTree
|
|
|
PxLocationMarkerShape
|
|
|
PxLocationUsefulness
|
|
|
QPoint
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
QPolygon
|
|
|
QRect
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
QSize
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
QVector_QPoint
|
|
|
QWidget
|
|
|
RGB16i
|
|
|
RGB32f
|
|
|
RGB32i
|
|
|
RGB8
|
|
|
RGBA8
|
|
|
TimePackType
|
|
|
TriviewControl
|
|
|
V3DPluginArgItem
|
|
|
V3DPluginArg_double3x3
|
|
|
V3D_GlobalSetting
General settings for the V3D program.
|
|
|
View3DControl
|
|
|
XYZ
|
|
|
c_array_float_3
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
c_array_int_3
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
c_array_less__double_comma__3__greater_
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
c_array_short_3
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
c_array_uint_3
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
c_array_uint_4
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
double3x3
Light wrapper for C-arrays, to make them easier to expose in
python.
|
|
|
IgnoreAspectRatio = v3d.AspectRatioMode.IgnoreAspectRatio
|
|
|
KeepAspectRatio = v3d.AspectRatioMode.KeepAspectRatio
|
|
|
KeepAspectRatioByExpanding = v3d.AspectRatioMode.KeepAspectRat...
|
|
|
OddEvenFill = v3d.FillRule.OddEvenFill
|
|
|
TIME_PACK_C = v3d.TimePackType.TIME_PACK_C
|
|
|
TIME_PACK_NONE = v3d.TimePackType.TIME_PACK_NONE
|
|
|
TIME_PACK_Z = v3d.TimePackType.TIME_PACK_Z
|
|
|
V3D_FLOAT32 = v3d.ImagePixelType.V3D_FLOAT32
|
|
|
V3D_UINT16 = v3d.ImagePixelType.V3D_UINT16
|
|
|
V3D_UINT8 = v3d.ImagePixelType.V3D_UINT8
|
|
|
V3D_UNKNOWN = v3d.ImagePixelType.V3D_UNKNOWN
|
|
|
WindingFill = v3d.FillRule.WindingFill
|
|
|
__package__ = None
|
|
|
pxCircleX = v3d.PxLocationMarkerShape.pxCircleX
|
|
|
pxCircleY = v3d.PxLocationMarkerShape.pxCircleY
|
|
|
pxCircleZ = v3d.PxLocationMarkerShape.pxCircleZ
|
|
|
pxCube = v3d.PxLocationMarkerShape.pxCube
|
|
|
pxDot = v3d.PxLocationMarkerShape.pxDot
|
|
|
pxLineX = v3d.PxLocationMarkerShape.pxLineX
|
|
|
pxLineY = v3d.PxLocationMarkerShape.pxLineY
|
|
|
pxLineZ = v3d.PxLocationMarkerShape.pxLineZ
|
|
|
pxLocaNotUseful = v3d.PxLocationUsefulness.pxLocaNotUseful
|
|
|
pxLocaUnsure = v3d.PxLocationUsefulness.pxLocaUnsure
|
|
|
pxLocaUseful = v3d.PxLocationUsefulness.pxLocaUseful
|
|
|
pxSphere = v3d.PxLocationMarkerShape.pxSphere
|
|
|
pxSquareX = v3d.PxLocationMarkerShape.pxSquareX
|
|
|
pxSquareY = v3d.PxLocationMarkerShape.pxSquareY
|
|
|
pxSquareZ = v3d.PxLocationMarkerShape.pxSquareZ
|
|
|
pxTemp = v3d.PxLocationUsefulness.pxTemp
|
|
|
pxTriangle = v3d.PxLocationMarkerShape.pxTriangle
|
|
|
pxUnknown = v3d.PxLocationUsefulness.pxUnknown
|
|
|
pxUnset = v3d.PxLocationMarkerShape.pxUnset
|


The Naked Experience
We're Not Telling You
What to Think.
We're Telling You
What to Think About.
Words and text that are meaningful to people.


New South Wales
New South Wales is full of cycling destinations for both the experienced and inexperienced cyclist.
From the Blue Mountains to Broken Hill, New South Wales has something for everyone.
Why not cycle across the Sydney Harbour Bridge?
New South Wales is full of cycling destinations for both the experienced and inexperienced cyclist.
From the Blue Mountains to Broken Hill, New South Wales has something for everyone.
Why not cycle across the Sydney Harbour Bridge?


<%= t("Thank you for choosing Calipso. You're awesome!") %> <%= t("It looks like this is your first time using Calipso in this " + "environment, so here's what we'll do:") %>


Powerful and flexible as JavaScript is, with a plethora of built-in functions, it is still necessary to use additional code for simple things that cannot be achieved natively or with CSS, such as animations, event handling, and Ajax.
This is my new website


--- layout: api title: "v2.2.1 JavaScript Library: L.Point" categories: api version: v2.2.1 permalink: /api/v2.2.1/l-point/ ---
Represents a point with x and y coordinates in pixels.
var point = L.point(200, 300);
All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
map.panBy([200, 300]);
map.panBy(L.point(200, 300));
| Factory | Description |
|---|---|
L.point(
|
Creates a Point object with the given x and y coordinates. If optional round is set to true , rounds the x and y values. |
| Property | Type | Description |
|---|---|---|
x |
Number |
The x coordinate. |
y |
Number |
The y coordinate. |
| Method | Returns | Description |
|---|---|---|
add(
|
Point |
Returns the result of addition of the current and the given points. |
subtract(
|
Point |
Returns the result of subtraction of the given point from the current. |
multiplyBy(
|
Point |
Returns the result of multiplication of the current point by the given number. |
divideBy(
|
Point |
Returns the result of division of the current point by the given number. If optional round is set to true , returns a rounded result. |
distanceTo(
|
Number |
Returns the distance between the current and the given points. |
clone() |
Point |
Returns a copy of the current point. |
round() |
Point |
Returns a copy of the current point with rounded coordinates. |
floor() |
Point |
Returns a copy of the current point with floored coordinates (rounded down). |
equals(
|
Boolean |
Returns true if the given point has the same coordinates. |
contains(
|
Boolean |
Returns true if the both coordinates of the given point are less than the corresponding current point coordinates (in absolute values). |
toString() |
String |
Returns a string representation of the point for debugging purposes. |


Linuxtrack allows you to use a web-camera, wiimote or any of the supported NP devices (currently TrackIR2 to 5, SmartNav3 and SmartNav4) as a head-tracking device, facilitating view control in simulators (flight, racing) or any other type of software.
Among applications utilizing Linuxtrack are for example X-Plane flight simulator, Flight Gear flight simulator, and any TrackIR enabled game running in Wine (Condor soaring simulator, Il-2, Falcon 4, ...).
If you want to know more, see the following pages:
Should you encounter a bug, please take a few minutes and file a bug report at the project page - it will allow me to fix the bug that is bothering you, and it also helps to improve Linuxtrack itself. Also any comments, ideas for improvement and constructive criticism is very welcome!


Created dbxlint, an in-house Go lint engine to eventually replace linting provided by third-party PHP solution Arcanist. dbxlint reads linter configurations (Bazel targets, flags, etc.), SSH into remote DevBoxes if necessary, and runs Bazel-built and local linters in parallel. Compiled to binary and packaged in SQFS. Currently integrated into Arcanist until transition from Phabricator; used by 800+ engineers during code review process.
May 2021 - August 2021
Hack Week 2021 Grand Prize Winner and most upvoted project of the year. Reimagines photos at Dropbox as Albums (1-many) in addition to Files (1-1). Developed data model for album entities, user-album associations, album-user associations, and album-file associations within Edgestore (object-relational mapping wrapper). Projected ready to ship by end of Q3 for all Dropbox users.
July 2021
Maintained Rails codebase for a repository hosting 22 TB of I/O storage traces with 300 monthly downloads and 500 citations over ten years.
June 2020 - August 2020
A HackMIT 2020 project. Want to watch lectures with other students but don’t have friends in your class? Looking for study buddies to hold each other accountable? Collaborative remote learning has never been easier!
September 2020
The very first foray into frontend design. Created with vanilla JS, HTML, CSS, and Bootstrap. Features some of Kip's projects and works in development.
June 2020 - Present
An implementation of a dynamic image cropping algorithms. Seam carving removes the "least energy seam," which is a path of continuous pixels where the difference in luminosity between pixels in the path and neighbour pixels are minimised.
March 2019
The classic snake game where the snake's latest obsession is spam! A Java applet that allows users to control the snake manually, reverse the snake, or even start AI mode, which uses BFS to find a path to the nearest spam.
May 2019


Analysis #{{image.analysis.id}}
Filename:
{{image.original_filename}}
Timestamp: {{image.analysis.image_datetime}}
Status:
{% if image.analysis %}
{% if image.analysis.status == 'ASTROMETRY_PENDING' %}
Stage 1 - Astrometry: performing analysis
{% elif image.analysis.status == 'PHOTOMETRY_PENDING' %}
Stage 2 - Photometry: performing analysis
{% elif image.analysis.status == 'REVIEW_PENDING' %}
Stage 3 - Review: analysis complete, review pending
{% elif image.analysis.status == 'REVIEW_COMPLETE' %}
Stage 4 - Reduction: analysis reviewed, reduction pending
{% elif image.analysis.status == 'REDUCTION_COMPLETE' %}
Stage 4 - Reduction: complete
{% elif image.analysis.status == 'ADDED_TO_LIGHT_CURVE' %}
Stage 5 - Added to light curve
{% endif %}
{% elif image.submission %}
{% if image.submission.status == 'FAILED_TO_SUBMIT' %}
Stage 1 - Astrometry: service failed, try upload image again
{% elif image.submission.status == 'FAILED_TO_PROCESS' %}
Stage 1 - Astrometry: failed to solve image
{% elif image.submission.status == 'SUBMITTED' %}
Stage 1 - Astrometry: solving
{% endif %}
{% else %}
Stage 0: Uploaded, astrometry starting...
{% endif %}
{% if image.analysis.notes %}
Note:
{{image.analysis.notes}}
{% endif %}
{% if image.analysis.original_display_url %}
{% endif %}


How to make an Electromagnet
1. Strip 1 inch of insulation from each side of the wire.
2. lace the horseshoe magnet on its side on a flat surface.
3. Use a small piece of electrical tape to tape the metal part of one end of the wire to the negative terminal of the battery.
4. Pass the wire between the legs of the horseshoe magnet.
5. Holding the insulated part of the wire, touch the open end of the wire to the positive terminal of the battery. Which direction is the electric current flowing? Why should you hold the wire insulation instead of the metal? Record your observations.
6. Flip the magnet over and repeat the experiment. What changes, if anything? Record your observations.
How Does a Compass Work?
1.
2. Take one bamboo skewer or chopstick and place it on top of your upside down glass. Make sure one end of the skewer is hanging over the edge of the glass.
3. Tape your bamboo skewer in place.
4. Take a look at your small bar magnet. If it doesn’t have its ends labeled, mark one end so you know which is which.
5. Tie a string around the middle of the Small Bar Magnet. Tie the other end of that string to the end of the skewer hanging over the edge of the drinking glass.
6. Put the assembled Compass in one corner of a sheet of graph paper. Trace a circle around the bottom of the glass.
7. Keeping the bottom of the glass in the circle you drew, turn the compass so the small bar magnet hangs near one edge of the graph paper.
8. Use your marker to make a mark on the graph paper under the spot where the skewer meets the edge of the glass. Make another mark underneath the end of the skewer.
9. Connect these marks to indicate the direction that the skewer is pointing in.
10. Wait for the Small Bar Magnet to stop moving. Once it’s still, draw an arrow underneath the bar magnet in the direction the magnet’s mark is facing.
11. Without moving the paper, rotate your compass so that the skewer points in a new direction.


Toggle navigation
SD7th
Calendar
Resources
Coming soon
Help
Contact
Search Themes
Coming soon
SD7th EQ


Welcome to the clan: Raiders for the Nine. Here you can get information for the clan, Bungie events, updates and raid times.


Some of my favorite Nintendo games, mostly from childhood (though I certainly played a lot of Ice Hockey in college).


NEWGRP
Section: User Commands (1)Updated: 07/24/2009
Index Return to Main Contents
NAME
newgrp - log in to a new groupSYNOPSIS
- newgrp [-] [group]
DESCRIPTION
newgrp changes the current real group ID to the named group, or to the default group listed in /etc/passwd if no group name is given. newgrp also tries to add the group to the user groupset. If not root, the user will be prompted for a password if she does not have a password (in /etc/shadow if this user has an entry in the shadowed password file, or in /etc/passwd otherwise) and the group does, or if the user is not listed as a member and the group has a password. The user will be denied access if the group password is empty and the user is not listed as a member.
If there is an entry for this group in /etc/gshadow, then the list of members and the password of this group will be taken from this file, otherwise, the entry in /etc/group is considered.
CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool:
SYSLOG_SG_ENAB (boolean)
- Enable "syslog" logging of sg activity.
FILES
/etc/passwd
- User account information.
/etc/shadow
- Secure user account information.
/etc/group
- Group account information.
/etc/gshadow
- Secure group account information.
SEE ALSO
id(1), login(1), su(1), sg(1), gpasswd(1), group(5), gshadow(5).
Index
This document was created by man2html, using the manual pages.
Time: 05:29:06 GMT, December 24, 2015


Log in
Sign Up
A living and constantly changing graph of aggregate performing arts events
Query
SPARQL
Custom Query
Your events not showing?
Sign up to add your website and manage your metadata!


|
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
A scheme for BDF2 time integration. More...
#include <bdf2_turbulent_scheme.h>
Public Member Functions | |
Life Cycle | |
| BDF2TurbulentScheme () | |
| Default constructor. More... | |
| BDF2TurbulentScheme (Process::Pointer pTurbulenceModel) | |
| Constructor to use the formulation combined with a turbulence model. More... | |
| BDF2TurbulentScheme (const Kratos::Variable< int > &rPeriodicVar) | |
| Constructor for periodic boundary conditions. More... | |
| ~BDF2TurbulentScheme () override | |
| Destructor. More... | |
Operations | |
| int | Check (ModelPart &rModelPart) override |
| Check input data for errors. More... | |
| void | Initialize (ModelPart &rModelPart) override |
| This is the place to initialize the Scheme. More... | |
| void | InitializeSolutionStep (ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override |
| Set the time iteration coefficients. More... | |
| void | InitializeNonLinIteration (ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override |
| unction to be called when it is needed to initialize an iteration. It is designed to be called at the beginning of each non linear iteration More... | |
| void | FinalizeNonLinIteration (ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override |
| Function to be called when it is needed to finalize an iteration. It is designed to be called at the end of each non linear iteration. More... | |
| void | Predict (ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override |
| Start the iteration by providing a first approximation to the solution. More... | |
| void | Update (ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override |
| Store the iteration results as solution step variables and update acceleration after a Newton-Raphson iteration. More... | |
| void | CalculateSystemContributions (Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) override |
| This function is designed to be called in the builder and solver to introduce the selected time integration scheme. More... | |
| void | CalculateRHSContribution (Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) override |
| This function is designed to calculate just the RHS contribution. More... | |
| void | CalculateSystemContributions (Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) override |
| Functions totally analogous to the precedent but applied to the "condition" objects. More... | |
| void | CalculateRHSContribution (Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) override |
| Functions totally analogous to the precedent but applied to the "condition" objects. More... | |
| void | Clear () override |
| Free memory allocated by this object. More... | |
Input and output | |
| std::string | Info () const override |
| Turn back information as a string. More... | |
| void | PrintInfo (std::ostream &rOStream) const override |
| Print information about this object. More... | |
| void | PrintData (std::ostream &rOStream) const override |
| Print object's data. More... | |
| Public Member Functions inherited from Kratos::Scheme< TSparseSpace, TDenseSpace > | |
| Scheme () | |
| Default Constructor. More... | |
| Scheme (Parameters ThisParameters) | |
| Constructor with Parameters. More... | |
| Scheme (Scheme &rOther) | |
| virtual | ~Scheme () |
| KRATOS_CLASS_POINTER_DEFINITION (Scheme) | |
| Pointer definition of Scheme. More... | |
| virtual ClassType::Pointer | Create (Parameters ThisParameters) const |
| Create method. More... | |
| virtual Pointer | Clone () |
| Clone method. More... | |
| bool | SchemeIsInitialized () |
| This method returns if the scheme is initialized. More... | |
| void | SetSchemeIsInitialized (bool SchemeIsInitializedFlag=true) |
| This method sets if the elements have been initialized or not (true by default) More... | |
| bool | ElementsAreInitialized () |
| This method returns if the elements are initialized. More... | |
| void | SetElementsAreInitialized (bool ElementsAreInitializedFlag=true) |
| This method sets if the elements have been initialized or not (true by default) More... | |
| bool | ConditionsAreInitialized () |
| This method returns if the conditions are initialized. More... | |
| void | SetConditionsAreInitialized (bool ConditionsAreInitializedFlag=true) |
| This method sets if the conditions have been initialized or not (true by default) More... | |
| virtual void | InitializeElements (ModelPart &rModelPart) |
| This is the place to initialize the elements. More... | |
| virtual void | InitializeConditions (ModelPart &rModelPart) |
| This is the place to initialize the conditions. More... | |
| virtual void | FinalizeSolutionStep (ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) |
| Function called once at the end of a solution step, after convergence is reached if an iterative process is needed. More... | |
| virtual void | CalculateOutputData (ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) |
| Functions to be called to prepare the data needed for the output of results. More... | |
| virtual void | CleanOutputData () |
| Functions that cleans the results data. More... | |
| virtual void | Clean () |
| This function is intended to be called at the end of the solution step to clean up memory storage not needed after the end of the solution step. More... | |
| virtual int | Check (const ModelPart &rModelPart) const |
| This function is designed to be called once to perform all the checks needed on the input provided. Checks can be "expensive" as the function is designed to catch user's errors. More... | |
| virtual void | CalculateLHSContribution (Element &rElement, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &rEquationIdVector, const ProcessInfo &rCurrentProcessInfo) |
| This function is designed to calculate just the LHS contribution. More... | |
| virtual void | CalculateLHSContribution (Condition &rCondition, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &rEquationIdVector, const ProcessInfo &rCurrentProcessInfo) |
| Functions totally analogous to the precedent but applied to the "condition" objects. More... | |
| virtual void | EquationId (const Element &rElement, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) |
| This method gets the eqaution id corresponding to the current element. More... | |
| virtual void | EquationId (const Condition &rCondition, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) |
| Functions totally analogous to the precedent but applied to the "condition" objects. More... | |
| virtual void | GetDofList (const Element &rElement, Element::DofsVectorType &rDofList, const ProcessInfo &rCurrentProcessInfo) |
| Function that returns the list of Degrees of freedom to be assembled in the system for a Given element. More... | |
| virtual void | GetDofList (const Condition &rCondition, Element::DofsVectorType &rDofList, const ProcessInfo &rCurrentProcessInfo) |
| Function that returns the list of Degrees of freedom to be assembled in the system for a Given condition. More... | |
| virtual Parameters | GetDefaultParameters () const |
| This method provides the defaults parameters to avoid conflicts between the different constructors. More... | |
Protected Member Functions | |
Protected Operations | |
| void | SetTimeCoefficients (ProcessInfo &rCurrentProcessInfo) |
| Calculate the coefficients for time iteration. More... | |
| virtual void | UpdateDofs (DofsArrayType &rDofSet, TSystemVectorType &Dx) |
| Update Dof values after a Newton-Raphson iteration. More... | |
| void | UpdateAcceleration (ModelPart &rModelPart, const Vector &rBDFcoefs) |
| Update Dof values after a Newton-Raphson iteration. More... | |
| void | CombineLHSContributions (LocalSystemMatrixType &rLHS, LocalSystemMatrixType &rMass, LocalSystemMatrixType &rDamp, const ProcessInfo &rCurrentProcessInfo) |
| template<class TObject > | |
| void | AddDynamicRHSContribution (TObject &rObject, LocalSystemVectorType &rRHS, LocalSystemMatrixType &rMass, const ProcessInfo &rCurrentProcessInfo) |
| void | FullProjection (ModelPart &rModelPart) |
| void | LumpedProjection (ModelPart &rModelPart) |
| void | PeriodicConditionProjectionCorrection (ModelPart &rModelPart) |
| void | AssemblePeriodicContributionToProjections (Geometry< Node > &rGeometry) |
| void | CorrectContributionsOnPeriodicNode (Node &rNode) |
| Protected Member Functions inherited from Kratos::Scheme< TSparseSpace, TDenseSpace > | |
| virtual Parameters | ValidateAndAssignParameters (Parameters ThisParameters, const Parameters DefaultParameters) const |
| This method validate and assign default parameters. More... | |
| virtual void | AssignSettings (const Parameters ThisParameters) |
| This method assigns settings to member variables. More... | |
Type Definitions | |
| typedef Scheme< TSparseSpace, TDenseSpace > | BaseType |
| typedef TSparseSpace::DataType | TDataType |
| typedef TSparseSpace::MatrixType | TSystemMatrixType |
| typedef TSparseSpace::VectorType | TSystemVectorType |
| typedef TDenseSpace::MatrixType | LocalSystemMatrixType |
| typedef TDenseSpace::VectorType | LocalSystemVectorType |
| typedef Dof< TDataType > | TDofType |
| typedef BaseType::DofsArrayType | DofsArrayType |
| typedef CoordinateTransformationUtils< LocalSystemMatrixType, LocalSystemVectorType, double > | RotationToolType |
| typedef RotationToolType::UniquePointer | RotationToolPointerType |
| KRATOS_CLASS_POINTER_DEFINITION (BDF2TurbulentScheme) | |
| Pointer definition of BDF2TurbulentScheme. More... | |
Additional Inherited Members | |
| Public Types inherited from Kratos::Scheme< TSparseSpace, TDenseSpace > | |
| using | ClassType = Scheme< TSparseSpace, TDenseSpace > |
| The definition of the current class. More... | |
| using | TDataType = typename TSparseSpace::DataType |
| Data type definition. More... | |
| using | TSystemMatrixType = typename TSparseSpace::MatrixType |
| Matrix type definition. More... | |
| using | TSystemVectorType = typename TSparseSpace::VectorType |
| Vector type definition. More... | |
| using | LocalSystemMatrixType = typename TDenseSpace::MatrixType |
| Local system matrix type definition. More... | |
| using | LocalSystemVectorType = typename TDenseSpace::VectorType |
| Local system vector type definition. More... | |
| using | TDofType = Dof< double > |
| DoF type definition. More... | |
| using | DofsArrayType = ModelPart::DofsArrayType |
| DoF array type definition. More... | |
| using | ElementsArrayType = ModelPart::ElementsContainerType |
| Elements containers definition. More... | |
| using | ConditionsArrayType = ModelPart::ConditionsContainerType |
| Conditions containers definition. More... | |
| Static Public Member Functions inherited from Kratos::Scheme< TSparseSpace, TDenseSpace > | |
| static std::string | Name () |
| Returns the name of the class as used in the settings (snake_case format) More... | |
| Protected Attributes inherited from Kratos::Scheme< TSparseSpace, TDenseSpace > | |
| bool | mSchemeIsInitialized |
| bool | mElementsAreInitialized |
| Flag to be used in controlling if the Scheme has been initialized or not. More... | |
| bool | mConditionsAreInitialized |
| Flag taking in account if the elements were initialized correctly or not. More... | |
A scheme for BDF2 time integration.
| typedef Scheme<TSparseSpace,TDenseSpace> Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::BaseType |
| typedef BaseType::DofsArrayType Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::DofsArrayType |
| typedef TDenseSpace::MatrixType Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::LocalSystemMatrixType |
| typedef TDenseSpace::VectorType Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::LocalSystemVectorType |
| typedef RotationToolType::UniquePointer Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::RotationToolPointerType |
| typedef CoordinateTransformationUtils<LocalSystemMatrixType, LocalSystemVectorType, double> Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::RotationToolType |
| typedef TSparseSpace::DataType Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::TDataType |
| typedef Dof<TDataType> Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::TDofType |
| typedef TSparseSpace::MatrixType Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::TSystemMatrixType |
| typedef TSparseSpace::VectorType Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::TSystemVectorType |
|
inline |
Default constructor.
|
inline |
Constructor to use the formulation combined with a turbulence model.
The turbulence model is assumed to be implemented as a Kratos::Process. The model's Execute() method wil be called at the start of each non-linear iteration.
| pTurbulenceModel | pointer to the turbulence model |
|
inline |
Constructor for periodic boundary conditions.
| rPeriodicVar | the variable used to store periodic pair indices. |
|
inlineoverride |
Destructor.
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
Functions totally analogous to the precedent but applied to the "condition" objects.
| rCondition | The condition to compute |
| RHS_Contribution | The RHS vector contribution |
| rEquationIdVector | The ID's of the condition degrees of freedom |
| rCurrentProcessInfo | The current process info instance |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This function is designed to calculate just the RHS contribution.
| rElement | The element to compute |
| RHS_Contribution | The RHS vector contribution |
| rEquationIdVector | The ID's of the element degrees of freedom |
| rCurrentProcessInfo | The current process info instance |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Functions totally analogous to the precedent but applied to the "condition" objects.
| rCondition | The condition to compute |
| LHS_Contribution | The LHS matrix contribution |
| RHS_Contribution | The RHS vector contribution |
| rEquationIdVector | The ID's of the condition degrees of freedom |
| rCurrentProcessInfo | The current process info instance |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This function is designed to be called in the builder and solver to introduce the selected time integration scheme.
It "asks" the matrix needed to the element and performs the operations needed to introduce the selected time integration scheme. This function calculates at the same time the contribution to the LHS and to the RHS of the system
| rElement | The element to compute |
| LHS_Contribution | The LHS matrix contribution |
| RHS_Contribution | The RHS vector contribution |
| rEquationIdVector | The ID's of the element degrees of freedom |
| rCurrentProcessInfo | The current process info instance |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Check input data for errors.
| rModelPart | The fluid's ModelPart |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Free memory allocated by this object.
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
Function to be called when it is needed to finalize an iteration. It is designed to be called at the end of each non linear iteration.
| rModelPart | The model part of the problem to solve |
| A | LHS matrix |
| Dx | Incremental update of primary variables |
| b | RHS Vector |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
|
inlineprotected |
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
This is the place to initialize the Scheme.
This is intended to be called just once when the strategy is initialized
| rModelPart | The model part of the problem to solve |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
unction to be called when it is needed to initialize an iteration. It is designed to be called at the beginning of each non linear iteration
The function is called in the builder for memory efficiency
| rModelPart | The model part of the problem to solve |
| A | LHS matrix |
| Dx | Incremental update of primary variables |
| b | RHS Vector |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Set the time iteration coefficients.
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
| Kratos::BDF2TurbulentScheme< TSparseSpace, TDenseSpace >::KRATOS_CLASS_POINTER_DEFINITION | ( | BDF2TurbulentScheme< TSparseSpace, TDenseSpace > | ) |
Pointer definition of BDF2TurbulentScheme.
|
inlineprotected |
|
inlineprotected |
On periodic boundaries, the nodal area and the values to project need to take into account contributions from elements on both sides of the boundary. This is done using the conditions and the non-historical nodal data containers as follows:
1- The partition that owns the PeriodicCondition adds the values on both nodes to their non-historical containers.
2- The non-historical containers are added across processes, communicating the right value from the condition owner to all partitions.
3- The value on all periodic nodes is replaced by the one received in step 2.
|
inlineoverridevirtual |
Start the iteration by providing a first approximation to the solution.
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Print object's data.
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
Reimplemented in Kratos::BDF2TurbulentSchemeDEMCoupled< TSparseSpace, TDenseSpace >.
|
inlineprotected |
Calculate the coefficients for time iteration.
| rCurrentProcessInfo | ProcessInfo instance from the fluid ModelPart. Must contain DELTA_TIME and BDF_COEFFICIENTS variables. |
|
inlineoverridevirtual |
Store the iteration results as solution step variables and update acceleration after a Newton-Raphson iteration.
| rModelPart | fluid ModelPart |
| rDofSet | DofSet containing the Newton-Raphson system degrees of freedom. |
| A | Newton-Raphson system matrix (unused) |
| Dx | Newton-Raphson iteration solution |
| b | Newton-Raphson right hand side (unused) |
Reimplemented from Kratos::Scheme< TSparseSpace, TDenseSpace >.
|
inlineprotected |
|
inlineprotectedvirtual |
Update Dof values after a Newton-Raphson iteration.
| rDofSet | Container for the Degrees of freedom in the system |
| Dx | Solution of the linear system |


| Number of Classes | Line Coverage | Mutation Coverage | Mutation Score |
|---|---|---|---|
| 4 | 96% | 60% | 91%
Killed: 31
Uncertain: 0
|
| Name | Line Coverage | Mutation Coverage | Mutation Score |
|---|---|---|---|
| ImageInlineUtils.java | 79% |
63% |
86%
Killed: 6
Uncertain: 0
|
| JsoupAttachImageInliner.java | 100% |
67% |
100%
Killed: 4
Uncertain: 0
|
| JsoupBase64ImageInliner.java | 100% |
67% |
100%
Killed: 3
Uncertain: 0
|
| JsoupCssInliner.java | 97% |
57% |
90%
Killed: 18
Uncertain: 0
|


Publications
See ORCID page and Google Scholar page for a fairly complete list of publications and citations.
Six Selected Publications
D. Buscombe, P. E. Grams, M. A. Kaplinski (2014) Characterizing riverbed sediment using high-frequency acoustics 2: Scattering signatures of Colorado River bed sediment in Marble and Grand Canyons. JOURNAL OF GEOPHYSICAL RESEARCH - EARTH SURFACE 119:F003191, 2014.(pdf)
D. Buscombe. (2013) Transferable Wavelet Method for Grain Size-Distribution from Images of Sediment Surfaces and Thin Sections, and Other Natural Granular Patterns. SEDIMENTOLOGY 60:1709--1732, 2013.(pdf)
D. Buscombe, D. Conley (2012) Effective Shear Stress of Graded Sediment. WATER RESOURCES RESEARCH, 48:W05506, 2012.(pdf)
J.R. Lacy, D.M. Rubin, D. Buscombe (2012) Currents and sediment transport induced by a tsunami far from its source. JOURNAL OF GEOPHYSICAL RESEARCH - OCEANS 117:C09028, 2012.(pdf)
M. J. Austin, Buscombe (2008) Morphological Change and Sediment Dynamics of the Beach Step on a Macrotidal Gravel Beach. MARINE GEOLOGY 249:167--183, 2008.(pdf)
Buscombe, G. Masselink. (2006) Concepts in Gravel Beach Dynamics. EARTH SCIENCE REVIEWS 79:33--52, 2006.(pdf)